submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s729658166 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[101];
int cnt,x,b,c,d,e,f,g,h,ans;
int main()
{
int n; cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
sort(a,a+n);
for(int i=0;i<n;i++)
{
if(a[i]>=0 && a[i]<=399)x=1;
else if(a[i]>=400 && a[i]<=799)b=1;
else if(a[i]>=800 && a[i]<=1199)c=1;
else if(a[i]>=1200 && a[i]<=1599)d==1;
else if(a[i]>=1600 && a[i]<=1999)e=1;
else if(a[i]>=2000 && a[i]<=2399)f=1;
else if(a[i]>=2400 && a[i]<=2799)h=1;
else if(a[i]>=2800 && a[i]<=3199)g=1;
else cnt++;
}
if(ans==0) return cout<<1<<' '<<cnt;
else cout<<ans<<' '<<cnt+ans;
}
| a.cc: In function 'int main()':
a.cc:23:34: error: cannot convert 'std::basic_ostream<char>' to 'int' in return
23 | if(ans==0) return cout<<1<<' '<<cnt;
| ~~~~~~~~~~~~^~~~~
| |
| std::basic_ostream<char>
|
s267704642 | p03695 | C++ | #include<iostream>
#include<fstream>
#include<bitset>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>
#include<regex>
#include<climits>
void Init() {
std::cin.tie(0); std::ios::sync_with_stdio(false);
struct Init_caller { Init_caller() { Init(); } }caller;
}
#define int LL
#define rep(i,n) for(LL (i)=0;(i)<(n);(i)++)
#define all(a) (a).begin(),(a).end()
#define size(s) ((LL)s.size())
#define F first
#define S second
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl
#define INT_INF INT_MAX
#define INF LLONG_MAX
#define MOD ((int)pow(10,9)+7)
using namespace std;
using LL = long long;
using st = string;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<int>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<int>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<int, int>;
using ppi = pair<pi, int>;
using mii = map<int, int>;
using mpii = map<pi, int>;
using mib = map<int, bool>;
using mci = map<char, int>;
using msb = map<st, bool>;
using vpi = vector<pi>;
using vppi = vector<ppi>;
using spi = stack<pi>;
using qpi = queue<pi>;
//4,2,8,6,1,7,3,9,5
int dx[] = { -1,0,0,1,-1,-1,1,1,0 };
int dy[] = { 0,1,-1,0,1,-1,1,-1,0 };
istream &operator>>(istream &in, vi &v) {
rep(i, size(v)) {
in >> v[i];
}
return in;
}
ostream &operator<<(ostream &out, vi &v) {
rep(i, size(v)) {
out << "v[" << i << "] = " << v[i] << endl;
}
return out;
}
void y_n(bool p) {
p ? _y() : _n();
}
void Y_N(bool p) {
p ? _Y() : _N();
}
LL vmax(vi v) {
int n = size(v);
int MAX = 0;
rep(i, n) {
MAX = max(MAX, v[i]);
}
return MAX;
}
LL vmin(vi v) {
int n = size(v);
int MIN = INF;
rep(i, n) {
MIN = min(MIN, v[i]);
}
return MIN;
}
LL vsum(vi v) {
int n = size(v);
int sum = 0;
rep(i, n) {
sum += v[i];
}
return sum;
}
LL gcd(LL a, LL b) {
if (b == 0) {
swap(a, b);
}
LL r;
while ((r = a % b) != 0) {
a = b;
b = r;
}
return b;
}
LL lcm(LL a, LL b) {
return (a / gcd(a, b) * b);
}
bool is_square(int n) {
if ((int)sqrt(n)*(int)sqrt(n) == n) {
return true;
}
else {
return false;
}
}
bool is_prime(int n) {
if (n == 1) {
return false;
}
else {
for (int i = 2; i*i <= n; i++) {
if (n % i == 0) {
return false;
}
}
}
return true;
}
void dec_num(int n, vi &v) {
int a = 2;
v.push_back(1);
v.push_back(n);
while (a*a <= n) {
if (n%a == 0) {
v.push_back(a);
v.push_back(n / a);
}
a++;
}
sort(all(v));
}
void dec_prime(int n, vi &v) {
v.push_back(1);
int a = 2;
while (a*a <= n) {
if (n % a == 0) {
v.push_back(a);
n /= a;
}
else {
a++;
}
}
v.push_back(n);
}
int sieve_prime(LL a, LL b) {
if (a > b)swap(a, b);
vb s(b + 1, true);
int cnt_a = 0, cnt_b = 0;
for (int i = 2; i <= b; i++) {
for (int j = 2; i*j <= b; j++) {
s[i*j] = false;
}
}
for (int i = 2; i <= b; i++) {
if (s[i]) {
//cout << i << " ";
if (i < a) {
cnt_a++;
}
cnt_b++;
}
}
return cnt_b - cnt_a;
}
LL factorial(LL n) {
LL a = 1, ret = 1;
while (a < n) {
a++;
ret *= a;
//ret %= MOD;
}
return ret;
}
const int COMBMAX = 4000;
int comb[COMBMAX+5][COMBMAX+5];
void init_comb() {
comb[0][0] = 1;
rep(i, COMBMAX) {
rep(j, i + 1) {
comb[i + 1][j] += comb[i][j];
comb[i + 1][j] %= MOD;
comb[i + 1][j + 1] += comb[i][j];
comb[i + 1][j + 1] %= MOD;
}
}
}
int combination(int n, int k) {
if (k<0 || k>n)return 0;
else return comb[n][k];
}
const int COMBMODMAX = 510000;
int fac[COMBMODMAX], facinv[COMBMODMAX], inv[COMBMODMAX];
void init_comb_mod() {
fac[0] = fac[1] = 1;
facinv[0] = facinv[1] = 1;
inv[1] = 1;
for (int i = 2; i < COMBMODMAX; i++) {
fac[i] = fac[i - 1] * i%MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
facinv[i] = facinv[i - 1] * inv[i] % MOD;
}
}
int comb_mod(int n, int k) {
if (n < k)return 0;
if (n < 0 || k < 0)return 0;
return fac[n] * (facinv[k] * facinv[n - k] % MOD) % MOD;
}
int pow_mod(int x, int n, int p) {
if (n == 0)return 0;
int res = pow_mod(x*x%p, n / 2, p);
if (n % 2 == 1)res = res * x % p;
return res;
}
class UF {
public:
vi par;
vi rank;
UF(int n) {
par.resize(n, -1);
rank.resize(n, 0);
}
int root(int x) {
if (par[x] == -1)return x;
return par[x] = root(par[x]);
}
//xの集合の位数
int order(int x) {
return -par[root(x)];
}
//xとyを併合
void unite(int x, int y) {
x = root(x);
y = root(y);
if (x == y) {
return;
}
if (rank[x] < rank[y]) {
par[x] = y;
}
else {
par[y] = x;
if(rank[x]==rank[y])rank[x]++;
}
}
//xとyが同じ集合にあるか
bool is_same(int x, int y) {
return root(x) == root(y);
}
};
struct edge {
int to;
int cost;
};
using ve = vector<edge>;
using vve = vector<ve>;
/*****************************************************************************/
signed main() {
int n;
cin >> n;
vi a(n);
cin >> a;
vi color(9, 0);
rep(i, n) {
if (a[i] < 400) {
color[0]++;
}
else if (a[i] < 800) {
color[1]++;
}
else if (a[i] < 1200) {
color[2]++;
}
else if (a[i] < 1600) {
color[3]++;
}
else if (a[i] < 2000) {
color[4]++;
}
else if (a[i] < 2400) {
color[5]++;
}
else if (a[i] < 2800) {
color[6]++;
}
else if (a[i] < 3200) {
color[7]++;
}
else {
color[8]++;
}
}
int ans = 0;
rep(i, 8) {
if (color[i] > 0) {
ans++;
}
}
cout << max(ans,1) <<" "<< ans + color[8];
return 0;
} | a.cc: In function 'int main()':
a.cc:379:20: error: no matching function for call to 'max(LL&, int)'
379 | cout << max(ans,1) <<" "<< ans + color[8];
| ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:379:20: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
379 | cout << max(ans,1) <<" "<< ans + color[8];
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:379:20: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
379 | cout << max(ans,1) <<" "<< ans + color[8];
| ~~~^~~~~~~
|
s775369642 | p03695 | C++ | #include <bits/stdc++.h>
#define mod 1000000007
#define rep(i, n) for(int i=0; i<n; ++i)
using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
int main(void){
int N, count = 0, ans = 0;
cin >> N;
bool check[8];
check.assign(N, false);
rep(i, N){
int a;
cin >> a;
if(a <= 399)
check[0] = true;
else if(a <= 799)
check[1] = true;
else if(a <= 1199)
check[2] = true;
else if(a <= 1599)
check[3] = true;
else if(a <= 1999)
check[4] = true;
else if(a <= 2399)
check[5] = true;
else if(a <= 2799)
check[6] = true;
else if(a <= 3199)
check[7] = true;
else
count++;
}
rep(i, 8)
if(check[i])
ans++;
cout << ans << " " << ans + count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:15: error: request for member 'assign' in 'check', which is of non-class type 'bool [8]'
18 | check.assign(N, false);
| ^~~~~~
|
s562771515 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
vector<int> iro(8);
int tuyotuyo=0;
for(int i=0;i<n;i++){
cin >> a.at(i);
}
sort(a.begin(),a.end());
for(int k: a){
if(1<=k && k<400){
iro.at(0)++;
}
if(400<=k && k<800){
iro.at(1)++;
}
if(800<=k && k<1200){
iro.at(2)++;
}
if(1200<=k && k<1600){
iro.at(3)++;
}
if(1600<=k && k<2000){
iro.at(4)++;
}
if(2000<=k && k<2400){
iro.at(5)++;
}
if(2400<=k && k<2800){
iro.at(6)++;
}
if(2800<=k && k<3200){
iro.at(7)++;
}
else{
tuyotuyo++;
}
}
sort(iro.begin(),iro.end())
cout << iro(0) << iro(7)+tuyotuyo << endl;
}
| a.cc: In function 'int main()':
a.cc:46:30: error: expected ';' before 'cout'
46 | sort(iro.begin(),iro.end())
| ^
| ;
47 |
48 | cout << iro(0) << iro(7)+tuyotuyo << endl;
| ~~~~
|
s321097744 | p03695 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n;cin>>n;
map<int,int>se;
rep(i,n)
{
int a;cin>>a;
se[a/400]++;
}
cout<<se.size()-se[8]>0<<" "<<max(se.size(),se.size()+se[8]-1);
return 0;
}
| a.cc: In function 'int main()':
a.cc:45:26: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
45 | cout<<se.size()-se[8]>0<<" "<<max(se.size(),se.size()+se[8]-1);
| ~^~~~~
| | |
| | const char [2]
| int
|
s368593931 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007;
int main(){
int n;cin >> n;
int type[9] = {};
rep(i,n){
int rate;cin >> rate;
rate /= 400;
if(rate>= 8) rate = 8;
type[rate] += 1;
}
int small = 0;
for(int i = 0; i < 8; i++){
if(type[i] > 0) small += 1;
}
int large = small + type[8];
if(small == 0) small = 1;
cout << small <<" "<< large<<endl; | a.cc: In function 'int main()':
a.cc:24:39: error: expected '}' at end of input
24 | cout << small <<" "<< large<<endl;
| ^
a.cc:9:11: note: to match this '{'
9 | int main(){
| ^
|
s191010503 | p03695 | Java | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Solver solver = new Solver();
solver.solve();
solver.exit();
}
static class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
}else{
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
private boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
public boolean hasNext() { skipUnprintable(); return hasNextByte();}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while(true){
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
}else if(b == -1 || !isPrintableChar(b)){
return minus ? -n : n;
}else{
throw new NumberFormatException();
}
b = readByte();
}
}
}
static class Solver {
FastScanner sc = new FastScanner();
public Solver() { }
String ns() { return sc.next(); }
String[] ns(int n) {
String a[] = new String[n];
for(int i = 0; i < n; i ++) { a[i] = ns(); }
return a;
}
String[][] ns(int n, int m) {
String a[][] = new String[n][m];
for(int i = 0; i < n; i ++) { a[i] = ns(m); }
return a;
}
char[] nc(int n) {
String str = ns();
char a[] = new char[str.length()];
for(int i = 0; i < str.length(); i ++) { a[i] = str.charAt(i); }
return a;
}
char[][] nc(int n, int m) {
char a[][] = new char[n][m];
for(int i = 0; i < n; i ++) { a[i] = nc(m); }
return a;
}
boolean[] nb(int n, char t) {
boolean a[] = new boolean[n];
char c[] = nc(n);
for(int i = 0; i < n; i ++) { a[i] = c[i] == t; }
return a;
}
boolean[][] nb(int n, int m, char t) {
boolean a[][] = new boolean[n][m];
for(int i = 0; i < n; i ++) { a[i] = nb(m, t); }
return a;
}
int ni() { return (int)sc.nextLong(); }
int[] ni(int n) {
int a[] = new int[n];
for(int i = 0; i < n; i ++) { a[i] = ni(); }
return a;
}
int[][] ni(int n, int m) {
int a[][] = new int[n][m];
for(int i = 0; i < n; i ++) { a[i] = ni(m); }
return a;
}
long nl() { return sc.nextLong(); }
long[] nl(int n) {
long a[] = new long[n];
for(int i = 0; i < n; i ++) { a[i] = nl(); }
return a;
}
long[][] nl(int n, int m) {
long a[][] = new long[n][m];
for(int i = 0; i < n; i ++) { a[i] = nl(m); }
return a;
}
PrintWriter out = new PrintWriter(System.out);
PrintWriter err = new PrintWriter(System.err);
void prt() { out.print(""); }
void prt(int a) { out.print(a); }
void prt(long a) { out.print(a); }
void prt(double a) { out.print(a); }
void prt(String a) { out.print(a); }
void prtln() { out.println(""); }
void prtln(int a) { out.println(a); }
void prtln(long a) { out.println(a); }
void prtln(double a) { out.println(a); }
void prtln(String a) { out.println(a); }
void prtln(int... a) {
StringBuilder sb = new StringBuilder();
for(int element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(long... a) {
StringBuilder sb = new StringBuilder();
for(long element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(double... a) {
StringBuilder sb = new StringBuilder();
for(double element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(String... a) {
StringBuilder sb = new StringBuilder();
for(String element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(int[][] a) { for(int[] element : a){ prtln(element); } }
void prtln(long[][] a) { for(long[] element : a){ prtln(element); } }
void prtln(double[][] a) { for(double[] element : a){ prtln(element); } }
void prtln(String[][] a) { for(String[] element : a){ prtln(element); } }
void errprt() { err.print(""); }
void errprt(int a) { err.print(a); }
void errprt(long a) { err.print(a); }
void errprt(double a) { err.print(a); }
void errprt(String a) { err.print(a); }
void errprt(boolean a) { errprt(a ? "#" : "."); }
void errprtln() { err.println(""); }
void errprtln(int a) { err.println(a); }
void errprtln(long a) { err.println(a); }
void errprtln(double a) { err.println(a); }
void errprtln(String a) { err.println(a); }
void errprtln(boolean a) { errprtln(a ? "#" : "."); }
void errprtln(int... a) {
StringBuilder sb = new StringBuilder();
for(int element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(long... a) {
StringBuilder sb = new StringBuilder();
for(long element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(double... a) {
StringBuilder sb = new StringBuilder();
for(double element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(String... a) {
StringBuilder sb = new StringBuilder();
for(String element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(boolean... a) {
StringBuilder sb = new StringBuilder();
for(boolean element : a){ sb.append((element ? "#" : ".")+" "); }
errprtln(sb.toString().trim());
}
void errprtln(int[][] a) { for(int[] element : a){ errprtln(element); } }
void errprtln(long[][] a) { for(long[] element : a){ errprtln(element); } }
void errprtln(double[][] a) { for(double[] element : a){ errprtln(element); } }
void errprtln(String[][] a) { for(String[] element : a){ errprtln(element); } }
void errprtln(boolean[][] a) { for(boolean[] element : a){ errprtln(element); } }
void reply(boolean b) { prtln(b ? "Yes" : "No"); }
void REPLY(boolean b) { prtln(b ? "YES" : "NO"); }
void exit() { out.flush(); err.flush(); System.exit(0); }
int min(int a, int b) { return Math.min(a, b); }
long min(long a, long b) { return Math.min(a, b); }
double min(double a, double b) { return Math.min(a, b); }
int min(int... x) {
int min = x[0];
for(int val : x) { min = min(min, val); }
return min;
}
long min(long... x) {
long min = x[0];
for(long val : x) { min = min(min, val); }
return min;
}
double min(double... x) {
double min = x[0];
for(double val : x) { min = min(min, val); }
return min;
}
int max(int a, int b) { return Math.max(a, b); }
long max(long a, long b) { return Math.max(a, b); }
double max(double a, double b) { return Math.max(a, b); }
int max(int... x) {
int max = x[0];
for(int val : x) { max = max(max, val); }
return max;
}
long max(long... x) {
long max = x[0];
for(long val : x) { max = max(max, val); }
return max;
}
double max(double... x) {
double max = x[0];
for(double val : x) { max = max(max, val); }
return max;
}
long sum(int... a) {
long sum = 0;
for(int element : a) { sum += element; }
return sum;
}
long sum(long... a) {
long sum = 0;
for(long element : a) { sum += element; }
return sum;
}
double sum(double... a) {
double sum = 0;
for(double element : a) { sum += element; }
return sum;
}
long abs(double x) { return (long)Math.abs(x); }
long round(double x) { return Math.round(x); }
long floor(double x) { return (long)Math.floor(x); }
long ceil(double x) { return (long)Math.ceil(x); }
double sqrt(double x) { return Math.sqrt(x); }
double pow(double x, double y) { return Math.pow(x, y); }
long pow(long x, long y) { return (long)Math.pow(x, y); }
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); }
long lcm(long a, long b) { return a * b / gcd(a, b); }
long[] div(long a) {
List<Long> divList = new ArrayList<Long>();
for(long i = 1; i * i <= a; i ++) {
if(a % i == 0) {
divList.add(i);
if(i * i != a) { divList.add(a / i); };
}
}
long div[] = new long[divList.size()];
for(int i = 0; i < divList.size(); i ++) { div[i] = divList.get(i); }
return div;
}
long[][] factor(long a) {
List<Long> factorList = new ArrayList<Long>();
List<Long> degreeList = new ArrayList<Long>();
for(long i = 2; i * i <= a; i ++) {
if(a % i == 0) {
long count = 0;
while(a % i == 0) {
a /= i;
count ++;
}
factorList.add(i);
degreeList.add(count);
}
}
if(a > 1) {
factorList.add(a);
degreeList.add(1L);
}
long factor[][] = new long[factorList.size()][2];
for(int i = 0; i < factorList.size(); i ++) {
factor[i][0] = factorList.get(i);
factor[i][1] = degreeList.get(i);
}
return factor;
}
long[][] countElements(long[] a) {
int len = a.length;
long array[] = new long[len];
for(int i = 0; i < len; i ++) {
array[i] = a[i];
}
Arrays.sort(array);
List<Long> elem = new ArrayList<Long>();
List<Long> cnt = new ArrayList<Long>();
long tmp = 1;
for(int i = 1; i <= len; i ++) {
if(i == len || array[i] != array[i - 1]) {
elem.add(array[i - 1]);
cnt.add(tmp);
tmp = 1;
}else {
tmp ++;
}
}
long counts[][] = new long[elem.size()][2];
for(int i = 0; i < elem.size(); i ++) {
counts[i][0] = elem.get(i);
counts[i][1] = cnt.get(i);
}
return counts;
}
int numDigits(long a) { return Long.toString(a).length(); }
long bitFlag(int a) { return 1L << (long)a; }
boolean isFlagged(long x, int a) { return (x & bitFlag(a)) != 0; }
long countString(String str, String a) { return (str.length() - str.replace(a, "").length()) / a.length(); }
long countStringAll(String str, String a) { return str.length() - str.replaceAll(a, "").length(); }
void reverse(String array[]) {
String reversed[] = new String[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(int array[]) {
int reversed[] = new int[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(long array[]) {
long reversed[] = new long[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(double array[]) {
double reversed[] = new double[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(boolean array[]) {
boolean reversed[] = new boolean[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void fill(int array[], int x) { Arrays.fill(array, x); }
void fill(long array[], long x) { Arrays.fill(array, x); }
void fill(double array[], double x) { Arrays.fill(array, x); }
void fill(boolean array[], boolean x) { Arrays.fill(array, x); }
void fill(int array[][], int x) { for(int a[] : array) { fill(a, x); } }
void fill(long array[][], long x) { for(long a[] : array) { fill(a, x); } }
void fill(double array[][], double x) { for(double a[] : array) { fill(a, x); } }
void fill(boolean array[][], boolean x) { for(boolean a[] : array) { fill(a, x); } }
long INF = (long)1e+15;
boolean isINF(long a) { return abs(a) > INF / 1000; }
boolean isPlusINF(long a) { return a > 0 && isINF(a); }
boolean isMinusINF(long a) { return isPlusINF(- a); }
// mods
long MOD = (long)1e+9 + 7; // 998244353
public long mod(long i) { return i % MOD + ((i % MOD) < 0 ? MOD : 0); }
long pow_m(long x, long y) {
if (y == 0) { return 1;
}else {
long tmp = pow_m(x, y / 2);
return mod(mod(tmp * tmp) * (y % 2 == 0 ? 1 : x));
}
}
long inv(long x) { return pow_m(x, MOD - 2); }
int MAX_FACT = 5_000_100;
long fact[];
long invFact[];
void prepareFact() {
fact = new long[MAX_FACT];
Arrays.fill(fact, 0);
invFact = new long[MAX_FACT];
Arrays.fill(invFact, 0);
fact[0] = 1;
int maxIndex = min(MAX_FACT, (int)MOD);
for(int i = 1; i < maxIndex; i ++) { fact[i] = mod(fact[i - 1] * i); }
invFact[maxIndex - 1] = inv(fact[maxIndex - 1]);
for(int i = maxIndex - 1; i > 0; i --) { invFact[i - 1] = mod(invFact[i] * i); }
}
long P(int n, int r) {
if(n < 0 || r < 0 || n < r) { return 0; }
return mod(fact[n] * invFact[n - r]);
}
long C(int n, int r) {
if(n < 0 || r < 0 || n < r) { return 0; }
return mod(P(n, r) * invFact[r]);
}
long H(int n, int r) { return C((n - 1) + r, r); }
// grid
class Grid implements Comparable<Grid> {
int h;
int w;
long val;
Grid() { }
Grid(int h, int w) {
this.h = h;
this.w = w;
}
Grid(int h, int w, long val) {
this.h = h;
this.w = w;
this.val = val;
}
@Override
public int compareTo(Grid g) {
return Long.compare(this.val, g.val);
}
}
// graph
class Graph {
int numNode;
int numEdge;
Edge edges[];
Node nodes[];
Node reversedNodes[];
Graph(int numNode, int numEdge, Edge edges[], boolean directed) {
this.numNode = numNode;
this.numEdge = numEdge;
this.edges = edges;
nodes = new Node[numNode];
reversedNodes = new Node[numNode];
for(int i = 0; i < numNode; i ++) {
nodes[i] = new Node(i);
reversedNodes[i] = new Node(i);
}
for(Edge edge : edges) {
nodes[edge.source].add(edge.target, edge.cost);
if(directed) {
reversedNodes[edge.target].add(edge.source, edge.cost);
}else {
nodes[edge.target].add(edge.source, edge.cost);
}
}
}
void clearNodes() {
for(Node n : nodes) { n.clear(); }
for(Node n : reversedNodes) { n.clear(); }
}
}
class Node {
int id;
ArrayList<Edge> edges = new ArrayList<Edge>();
Node(int id) {
this.id = id;
}
void add(int target, long cost) {
edges.add(new Edge(id, target, cost));
}
void clear() {
edges.clear();
}
}
class Edge implements Comparable<Edge> {
int source;
int target;
long cost;
Edge(int source, int target, long cost) {
this.source = source;
this.target = target;
this.cost = cost;
}
@Override
public int compareTo(Edge e) {
return Long.compare(this.cost, e.cost);
}
}
public void solve() {
int num = ni();
long array[] = nl(num);
for(int i = 0; i < num; i ++) {
array[i] /= 400;
}
long cnt[][] = countElements(array);
if(cnt[cnt.length - 1][0] == 8) {
prtln(max(1, cnt.length - 1), cnt.length + cnt[cnt.length - 1][1] - 1);
}else {
prt(cnt.length, cnt.length);
}
}
}
} | Main.java:532: error: no suitable method found for prt(int,int)
prt(cnt.length, cnt.length);
^
method Solver.prt() is not applicable
(actual and formal argument lists differ in length)
method Solver.prt(int) is not applicable
(actual and formal argument lists differ in length)
method Solver.prt(long) is not applicable
(actual and formal argument lists differ in length)
method Solver.prt(double) is not applicable
(actual and formal argument lists differ in length)
method Solver.prt(String) is not applicable
(actual and formal argument lists differ in length)
1 error
|
s394019736 | p03695 | Java | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Solver solver = new Solver();
solver.solve();
solver.exit();
}
static class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
}else{
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
private boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
public boolean hasNext() { skipUnprintable(); return hasNextByte();}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while(true){
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
}else if(b == -1 || !isPrintableChar(b)){
return minus ? -n : n;
}else{
throw new NumberFormatException();
}
b = readByte();
}
}
}
static class Solver {
FastScanner sc = new FastScanner();
public Solver() { }
String ns() { return sc.next(); }
String[] ns(int n) {
String a[] = new String[n];
for(int i = 0; i < n; i ++) { a[i] = ns(); }
return a;
}
String[][] ns(int n, int m) {
String a[][] = new String[n][m];
for(int i = 0; i < n; i ++) { a[i] = ns(m); }
return a;
}
char[] nc(int n) {
String str = ns();
char a[] = new char[str.length()];
for(int i = 0; i < str.length(); i ++) { a[i] = str.charAt(i); }
return a;
}
char[][] nc(int n, int m) {
char a[][] = new char[n][m];
for(int i = 0; i < n; i ++) { a[i] = nc(m); }
return a;
}
boolean[] nb(int n, char t) {
boolean a[] = new boolean[n];
char c[] = nc(n);
for(int i = 0; i < n; i ++) { a[i] = c[i] == t; }
return a;
}
boolean[][] nb(int n, int m, char t) {
boolean a[][] = new boolean[n][m];
for(int i = 0; i < n; i ++) { a[i] = nb(m, t); }
return a;
}
int ni() { return (int)sc.nextLong(); }
int[] ni(int n) {
int a[] = new int[n];
for(int i = 0; i < n; i ++) { a[i] = ni(); }
return a;
}
int[][] ni(int n, int m) {
int a[][] = new int[n][m];
for(int i = 0; i < n; i ++) { a[i] = ni(m); }
return a;
}
long nl() { return sc.nextLong(); }
long[] nl(int n) {
long a[] = new long[n];
for(int i = 0; i < n; i ++) { a[i] = nl(); }
return a;
}
long[][] nl(int n, int m) {
long a[][] = new long[n][m];
for(int i = 0; i < n; i ++) { a[i] = nl(m); }
return a;
}
PrintWriter out = new PrintWriter(System.out);
PrintWriter err = new PrintWriter(System.err);
void prt() { out.print(""); }
void prt(int a) { out.print(a); }
void prt(long a) { out.print(a); }
void prt(double a) { out.print(a); }
void prt(String a) { out.print(a); }
void prtln() { out.println(""); }
void prtln(int a) { out.println(a); }
void prtln(long a) { out.println(a); }
void prtln(double a) { out.println(a); }
void prtln(String a) { out.println(a); }
void prtln(int... a) {
StringBuilder sb = new StringBuilder();
for(int element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(long... a) {
StringBuilder sb = new StringBuilder();
for(long element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(double... a) {
StringBuilder sb = new StringBuilder();
for(double element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(String... a) {
StringBuilder sb = new StringBuilder();
for(String element : a){ sb.append(element+" "); }
prtln(sb.toString().trim());
}
void prtln(int[][] a) { for(int[] element : a){ prtln(element); } }
void prtln(long[][] a) { for(long[] element : a){ prtln(element); } }
void prtln(double[][] a) { for(double[] element : a){ prtln(element); } }
void prtln(String[][] a) { for(String[] element : a){ prtln(element); } }
void errprt() { err.print(""); }
void errprt(int a) { err.print(a); }
void errprt(long a) { err.print(a); }
void errprt(double a) { err.print(a); }
void errprt(String a) { err.print(a); }
void errprt(boolean a) { errprt(a ? "#" : "."); }
void errprtln() { err.println(""); }
void errprtln(int a) { err.println(a); }
void errprtln(long a) { err.println(a); }
void errprtln(double a) { err.println(a); }
void errprtln(String a) { err.println(a); }
void errprtln(boolean a) { errprtln(a ? "#" : "."); }
void errprtln(int... a) {
StringBuilder sb = new StringBuilder();
for(int element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(long... a) {
StringBuilder sb = new StringBuilder();
for(long element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(double... a) {
StringBuilder sb = new StringBuilder();
for(double element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(String... a) {
StringBuilder sb = new StringBuilder();
for(String element : a){ sb.append(element+" "); }
errprtln(sb.toString().trim());
}
void errprtln(boolean... a) {
StringBuilder sb = new StringBuilder();
for(boolean element : a){ sb.append((element ? "#" : ".")+" "); }
errprtln(sb.toString().trim());
}
void errprtln(int[][] a) { for(int[] element : a){ errprtln(element); } }
void errprtln(long[][] a) { for(long[] element : a){ errprtln(element); } }
void errprtln(double[][] a) { for(double[] element : a){ errprtln(element); } }
void errprtln(String[][] a) { for(String[] element : a){ errprtln(element); } }
void errprtln(boolean[][] a) { for(boolean[] element : a){ errprtln(element); } }
void reply(boolean b) { prtln(b ? "Yes" : "No"); }
void REPLY(boolean b) { prtln(b ? "YES" : "NO"); }
void exit() { out.flush(); err.flush(); System.exit(0); }
int min(int a, int b) { return Math.min(a, b); }
long min(long a, long b) { return Math.min(a, b); }
double min(double a, double b) { return Math.min(a, b); }
int min(int... x) {
int min = x[0];
for(int val : x) { min = min(min, val); }
return min;
}
long min(long... x) {
long min = x[0];
for(long val : x) { min = min(min, val); }
return min;
}
double min(double... x) {
double min = x[0];
for(double val : x) { min = min(min, val); }
return min;
}
int max(int a, int b) { return Math.max(a, b); }
long max(long a, long b) { return Math.max(a, b); }
double max(double a, double b) { return Math.max(a, b); }
int max(int... x) {
int max = x[0];
for(int val : x) { max = max(max, val); }
return max;
}
long max(long... x) {
long max = x[0];
for(long val : x) { max = max(max, val); }
return max;
}
double max(double... x) {
double max = x[0];
for(double val : x) { max = max(max, val); }
return max;
}
long sum(int... a) {
long sum = 0;
for(int element : a) { sum += element; }
return sum;
}
long sum(long... a) {
long sum = 0;
for(long element : a) { sum += element; }
return sum;
}
double sum(double... a) {
double sum = 0;
for(double element : a) { sum += element; }
return sum;
}
long abs(double x) { return (long)Math.abs(x); }
long round(double x) { return Math.round(x); }
long floor(double x) { return (long)Math.floor(x); }
long ceil(double x) { return (long)Math.ceil(x); }
double sqrt(double x) { return Math.sqrt(x); }
double pow(double x, double y) { return Math.pow(x, y); }
long pow(long x, long y) { return (long)Math.pow(x, y); }
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); }
long lcm(long a, long b) { return a * b / gcd(a, b); }
long[] div(long a) {
List<Long> divList = new ArrayList<Long>();
for(long i = 1; i * i <= a; i ++) {
if(a % i == 0) {
divList.add(i);
if(i * i != a) { divList.add(a / i); };
}
}
long div[] = new long[divList.size()];
for(int i = 0; i < divList.size(); i ++) { div[i] = divList.get(i); }
return div;
}
long[][] factor(long a) {
List<Long> factorList = new ArrayList<Long>();
List<Long> degreeList = new ArrayList<Long>();
for(long i = 2; i * i <= a; i ++) {
if(a % i == 0) {
long count = 0;
while(a % i == 0) {
a /= i;
count ++;
}
factorList.add(i);
degreeList.add(count);
}
}
if(a > 1) {
factorList.add(a);
degreeList.add(1L);
}
long factor[][] = new long[factorList.size()][2];
for(int i = 0; i < factorList.size(); i ++) {
factor[i][0] = factorList.get(i);
factor[i][1] = degreeList.get(i);
}
return factor;
}
long[][] countElements(long[] a) {
int len = a.length;
long array[] = new long[len];
for(int i = 0; i < len; i ++) {
array[i] = a[i];
}
Arrays.sort(array);
List<Long> elem = new ArrayList<Long>();
List<Long> cnt = new ArrayList<Long>();
long tmp = 1;
for(int i = 1; i <= len; i ++) {
if(i == len || array[i] != array[i - 1]) {
elem.add(array[i - 1]);
cnt.add(tmp);
tmp = 1;
}else {
tmp ++;
}
}
long counts[][] = new long[elem.size()][2];
for(int i = 0; i < elem.size(); i ++) {
counts[i][0] = elem.get(i);
counts[i][1] = cnt.get(i);
}
return counts;
}
int numDigits(long a) { return Long.toString(a).length(); }
long bitFlag(int a) { return 1L << (long)a; }
boolean isFlagged(long x, int a) { return (x & bitFlag(a)) != 0; }
long countString(String str, String a) { return (str.length() - str.replace(a, "").length()) / a.length(); }
long countStringAll(String str, String a) { return str.length() - str.replaceAll(a, "").length(); }
void reverse(String array[]) {
String reversed[] = new String[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(int array[]) {
int reversed[] = new int[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(long array[]) {
long reversed[] = new long[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(double array[]) {
double reversed[] = new double[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void reverse(boolean array[]) {
boolean reversed[] = new boolean[array.length];
for(int i = 0; i < array.length; i ++) { reversed[array.length - i - 1] = array[i]; }
for(int i = 0; i < array.length; i ++) { array[i] = reversed[i]; }
}
void fill(int array[], int x) { Arrays.fill(array, x); }
void fill(long array[], long x) { Arrays.fill(array, x); }
void fill(double array[], double x) { Arrays.fill(array, x); }
void fill(boolean array[], boolean x) { Arrays.fill(array, x); }
void fill(int array[][], int x) { for(int a[] : array) { fill(a, x); } }
void fill(long array[][], long x) { for(long a[] : array) { fill(a, x); } }
void fill(double array[][], double x) { for(double a[] : array) { fill(a, x); } }
void fill(boolean array[][], boolean x) { for(boolean a[] : array) { fill(a, x); } }
long INF = (long)1e+15;
boolean isINF(long a) { return abs(a) > INF / 1000; }
boolean isPlusINF(long a) { return a > 0 && isINF(a); }
boolean isMinusINF(long a) { return isPlusINF(- a); }
// mods
long MOD = (long)1e+9 + 7; // 998244353
public long mod(long i) { return i % MOD + ((i % MOD) < 0 ? MOD : 0); }
long pow_m(long x, long y) {
if (y == 0) { return 1;
}else {
long tmp = pow_m(x, y / 2);
return mod(mod(tmp * tmp) * (y % 2 == 0 ? 1 : x));
}
}
long inv(long x) { return pow_m(x, MOD - 2); }
int MAX_FACT = 5_000_100;
long fact[];
long invFact[];
void prepareFact() {
fact = new long[MAX_FACT];
Arrays.fill(fact, 0);
invFact = new long[MAX_FACT];
Arrays.fill(invFact, 0);
fact[0] = 1;
int maxIndex = min(MAX_FACT, (int)MOD);
for(int i = 1; i < maxIndex; i ++) { fact[i] = mod(fact[i - 1] * i); }
invFact[maxIndex - 1] = inv(fact[maxIndex - 1]);
for(int i = maxIndex - 1; i > 0; i --) { invFact[i - 1] = mod(invFact[i] * i); }
}
long P(int n, int r) {
if(n < 0 || r < 0 || n < r) { return 0; }
return mod(fact[n] * invFact[n - r]);
}
long C(int n, int r) {
if(n < 0 || r < 0 || n < r) { return 0; }
return mod(P(n, r) * invFact[r]);
}
long H(int n, int r) { return C((n - 1) + r, r); }
// grid
class Grid implements Comparable<Grid> {
int h;
int w;
long val;
Grid() { }
Grid(int h, int w) {
this.h = h;
this.w = w;
}
Grid(int h, int w, long val) {
this.h = h;
this.w = w;
this.val = val;
}
@Override
public int compareTo(Grid g) {
return Long.compare(this.val, g.val);
}
}
// graph
class Graph {
int numNode;
int numEdge;
Edge edges[];
Node nodes[];
Node reversedNodes[];
Graph(int numNode, int numEdge, Edge edges[], boolean directed) {
this.numNode = numNode;
this.numEdge = numEdge;
this.edges = edges;
nodes = new Node[numNode];
reversedNodes = new Node[numNode];
for(int i = 0; i < numNode; i ++) {
nodes[i] = new Node(i);
reversedNodes[i] = new Node(i);
}
for(Edge edge : edges) {
nodes[edge.source].add(edge.target, edge.cost);
if(directed) {
reversedNodes[edge.target].add(edge.source, edge.cost);
}else {
nodes[edge.target].add(edge.source, edge.cost);
}
}
}
void clearNodes() {
for(Node n : nodes) { n.clear(); }
for(Node n : reversedNodes) { n.clear(); }
}
}
class Node {
int id;
ArrayList<Edge> edges = new ArrayList<Edge>();
Node(int id) {
this.id = id;
}
void add(int target, long cost) {
edges.add(new Edge(id, target, cost));
}
void clear() {
edges.clear();
}
}
class Edge implements Comparable<Edge> {
int source;
int target;
long cost;
Edge(int source, int target, long cost) {
this.source = source;
this.target = target;
this.cost = cost;
}
@Override
public int compareTo(Edge e) {
return Long.compare(this.cost, e.cost);
}
}
public void solve() {
int num = ni();
long array[] = nl(num);
for(int i = 0; i < num; i ++) {
array[i] /= 400;
}
long cnt[][] = countElements(a);
int x = ? cnt[cnt.length - 1][1] : 0;
if(cnt[cnt.length - 1][0] == 8) {
prtln(max(1, cnt.length - 1), crt.length + cnt[cnt.length - 1][1] - 1);
}else {
prt(cnt.length, cnt.length);
}
}
}
} | Main.java:529: error: illegal start of expression
int x = ? cnt[cnt.length - 1][1] : 0;
^
1 error
|
s452666848 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const auto INF = (ll)1e9+7;
using p = pair<int,int>;
using v = vector<int>;
auto c = vector<int>(9,0);
void color(int i){
if(i<3200)
c[i/400]++;
}else{
c[8]++;
}
}
int main(){
int n;
cin >> n;
auto a = vector<int>(n,0);
for (int i = 0; i < n; i++)
{
cin >> a[i];
color(a[i]);
}
ll _min = 0;
ll _max = 0;
ll num = c.size()-1;
for (int i = 0; i < c.size(); i++)
{
if(i!=num&&c[i]!=0){
_min++;
}
if(i!=num&&c[i]==0&&c[num]>1){
c[i]++;
c[num]--;
}
if(c[i]!=0) _max++;
}
cout << _min << " " << _max<<endl;
}
| a.cc:12:10: error: expected unqualified-id before 'else'
12 | }else{
| ^~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s107106376 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,x,ans=0;
vector<int> a(9,0);
cin >> N;
for(int i=0;i<N;i++){
cin >> x;
for(int j=0;j<9;j++){
if(j==8){
if(j*400<=x){
a[j]++;
}
}else(j*400<=x && x<400*(j+1)){
a[j]++;
}
}
}
for(int i=0;i<8;i++){
if(0<a[i]){
ans++;
}
}
cout << max(ans,1) << ' ' << ans + a[8] << endl;
} | a.cc: In function 'int main()':
a.cc:16:43: error: expected ';' before '{' token
16 | }else(j*400<=x && x<400*(j+1)){
| ^
| ;
|
s281034009 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,x,ans=0;
vector<int> a(9,0);
cin >> N;
for(int i=0;i<N;i++){
cin >> x;
for(int j=0;j<9;j++){
if(j==8){
if(j*400<=x){
a[j]++;
}else(j*400<=x && x<400*(j+1)){
a[j]++;
}
}
}
for(int i=0;i<8;i++){
if(0<a[i]){
ans++;
}
}
cout << max(ans,1) << ' ' << ans + a[8] << endl;
} | a.cc: In function 'int main()':
a.cc:15:43: error: expected ';' before '{' token
15 | }else(j*400<=x && x<400*(j+1)){
| ^
| ;
a.cc:28:2: error: expected '}' at end of input
28 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s185540891 | p03695 | C++ | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
int main()
{
int n;
cin >> n;
bool s[8];
int cnt = 0, f = 0;
rep(i, n)
{
int a;
cin >> a;
if (1 <= a && a <= 399 && !s[0])
{
s[0] = 1;
cnt++;
}
if (400 <= a && a <= 799 && !s[1])
{
s[1] = 1;
cnt++;
}
if (800 <= a && a <= 1199 && !s[2])
{
s[2] = 1;
cnt++;
}
if (1200 <= a && a <= 1599 && !s[3])
{
s[3] = 1;
cnt++;
}
if (1600 <= a && a <= 1999 && !s[4])
{
s[4] = 1;
cnt++;
}
if (2000 <= a && a <= 2399 && !s[5])
{
s[5] = 1;
cnt++;
}
if (2400 <= a && a <= 2799 && !s[6])
{
s[6] = 1;
cnt++;
}
if (2800 <= a && a <= 3199 && !s[7])
{
s[7] = 1;
cnt++;
}
if (a >= 3200)
free++;
}
cout << cnt << " " << min(8, cnt + free) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:65:13: warning: ISO C++ forbids incrementing a pointer of type 'void (*)(void*) noexcept' [-Wpointer-arith]
65 | free++;
| ^~~~
a.cc:65:17: error: lvalue required as increment operand
65 | free++;
| ^~
a.cc:68:38: warning: pointer to a function used in arithmetic [-Wpointer-arith]
68 | cout << cnt << " " << min(8, cnt + free) << endl;
| ~~~~^~~~~~
a.cc:68:30: error: no matching function for call to 'min(int, void (*)(void*) noexcept)'
68 | cout << cnt << " " << min(8, cnt + free) << endl;
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:68:30: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'void (*)(void*) noexcept')
68 | cout << cnt << " " << min(8, cnt + free) << endl;
| ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:68:30: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
68 | cout << cnt << " " << min(8, cnt + free) << endl;
| ~~~^~~~~~~~~~~~~~~
|
s358353630 | p03695 | C++ | #include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;
int a[9] = { 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 10000 };
int b[9];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; ++i)
{
int x;
cin >> x;
int j = 0;
while (x >= a[j])
++j;
b[j]++;
}
int sol = 0;
for (int i = 0; i < 8; ++i)
if (b[i])
sol++;
cout << max(1, sol) << ' ' << min(sol + b[8]);
}
| a.cc: In function 'int main()':
a.cc:31:38: error: no matching function for call to 'min(int)'
31 | cout << max(1, sol) << ' ' << min(sol + b[8]);
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: template argument deduction/substitution failed:
a.cc:31:38: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
31 | cout << max(1, sol) << ' ' << min(sol + b[8]);
| ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate expects 2 arguments, 1 provided
|
s212219292 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
set<int> st;
int cnt = 0;
int a;
for ( int i = 0; i < n; i++){
cin >> a;
if ( a/400 >= 8){
cnt ++;
} else {
st.insert(a/400);
}
}
cout << max(st.size(), 1) << " " << st.size() + cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:14: error: no matching function for call to 'max(std::set<int>::size_type, int)'
19 | cout << max(st.size(), 1) << " " << st.size() + cnt << endl;
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:19:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
19 | cout << max(st.size(), 1) << " " << st.size() + cnt << endl;
| ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:19:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
19 | cout << max(st.size(), 1) << " " << st.size() + cnt << endl;
| ~~~^~~~~~~~~~~~~~
|
s424825398 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
set<int> st;
int cnt = 0;
int a;
for ( int i = 0; i < n; i++){
cin >> a;
if ( a/400 >= 8){
cnt ++;
} else {
st.insert(a/400);
}
}
cout << min(st.size(), 1) << " " << st.size() + cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:14: error: no matching function for call to 'min(std::set<int>::size_type, int)'
19 | cout << min(st.size(), 1) << " " << st.size() + cnt << endl;
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:19:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
19 | cout << min(st.size(), 1) << " " << st.size() + cnt << endl;
| ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:19:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
19 | cout << min(st.size(), 1) << " " << st.size() + cnt << endl;
| ~~~^~~~~~~~~~~~~~
|
s985463783 | p03695 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;
int main() {
int N; cin >> N;
int a[N]; rep(i, N) cin >> a[i];
int rate[9]={};
rep(i, N) {
if (a[i] >= 3200) rate[8]++;
else rate[a[i]/400]++;
}
int r_min = 0;
rep(i, 8) if (rate[i]!=0) r_min++;
int r_max = r_min + rate[8];
r_min = max(r_min, 1)
cout << r_min << " " << r_max << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:24:24: error: expected ';' before 'cout'
24 | r_min = max(r_min, 1)
| ^
| ;
25 | cout << r_min << " " << r_max << endl;
| ~~~~
|
s649824697 | p03695 | C++ | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>
using namespace std;
int main() {
int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
cin >> N;
vector<int> A(N,0);
for(int i = 0; i < N;i++){
cin >> A[i];
if(A[i] < 400){
g = 1;
}else if(A[i] < 800){
b = 1;
}else if(A[i] < 1200){
gr = 1;
}else if(A[i] < 1600){
w = 1;
}else if(A[i] < 2000){
b = 1;
}else if(A[i] < 2400){
y = 1;
}else if(A[i] < 2800){
o = 1;
}else if(A[i] < 3200){
r = 1;
}else {
sai++;
}
}
ans = g + b + gr + w + b + y + o + r;
min = ans;
max = ans + sai;
if(8 <= max){
max = 8;
}
cout << min << " "<< max <<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
a.cc:13:17: note: 'int b' previously declared here
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
|
s807854750 | p03695 | C++ | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>
using namespace std;
int main() {
int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
cin >> N;
vector<int> A(N,0);
for(int i = 0; i < N;i++){
cin >> A[i];
if(A[i] < 400){
g = 1;
}else if(A[i] < 800){
b = 1;
}else if(A[i] < 1200){
gr = 1;
}else if(A[i] < 1600){
w = 1;
}else if(A[i] < 2000){
b = 1;
}else if(A[i] < 2400){
y = 1;
}else if(A[i] < 2800){
o = 1;
}else if(A[i] < 3200){
r = 1;
}else {
sai++;
}
}
ans = g + b + gr + w + b + y + o + r;
min = ans;
max = ans + sai;
if(8 <= max){
max = 8;
}
cout << min << max <<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
a.cc:13:17: note: 'int b' previously declared here
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
|
s172056555 | p03695 | C++ | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>
using namespace std;
int main() {
int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
cin >> N;
vector<int> A(N,0);
for(int i = 0; i < N;i++){
cin >> A[i];
if(A[i] < 400){
g = 1;
}else if(A[i] < 800){
b = 1;
}else if(A[i] < 1200){
gr = 1;
}else if(A[i] < 1600){
w = 1;
}else if(A[i] < 2000){
b = 1;
}else if(A[i] < 2400){
y = 1;
}else if(A[i] < 2800){
o = 1;
}else if(A[i] < 3200){
r = 1;
}else {
sai++;
}
}
}
ans = g + b + gr + w + b + y + o + r;
min = ans;
max = ans + sai;
if(8 <= max){
max = 8;
}
cout << min << endl;
cout << max << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
a.cc:13:17: note: 'int b' previously declared here
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
a.cc: At global scope:
a.cc:44:9: error: 'ans' does not name a type
44 | ans = g + b + gr + w + b + y + o + r;
| ^~~
a.cc:45:9: error: 'min' does not name a type
45 | min = ans;
| ^~~
a.cc:46:9: error: 'max' does not name a type
46 | max = ans + sai;
| ^~~
a.cc:47:9: error: expected unqualified-id before 'if'
47 | if(8 <= max){
| ^~
a.cc:51:9: error: 'cout' does not name a type
51 | cout << min << endl;
| ^~~~
a.cc:52:9: error: 'cout' does not name a type
52 | cout << max << endl;
| ^~~~
a.cc:53:9: error: expected unqualified-id before 'return'
53 | return 0;
| ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
54 | }
| ^
|
s674956198 | p03695 | C++ | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>
using namespace std;
int main() {
int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
cin >> N;
vector<int> A(N,0);
for(int i = 0; i < N;i++){
cin >> A[i];
}
for(int j = 0;j < N;j++){
if(A[j] < 400){
g = 1;
}else if(A[j] < 800){
b = 1;
}else if(A[j] < 1200){
gr = 1;
}else if(A[j] < 1600){
w = 1;
}else if(A[j] < 2000){
b = 1;
}else if(A[j] < 2400){
y = 1;
}else if(A[j] < 2800){
o = 1;
}else if(A[j] < 3200){
r = 1;
}else {
sai++;
}
}
ans = g + b + gr + w + b + y + o + r;
min = ans;
max = ans + sai;
if(8 <= max){
max = 8;
}
cout << min << endl;
cout << max << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
a.cc:13:17: note: 'int b' previously declared here
13 | int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
| ^
|
s622444432 | p03695 | C++ | #include <bits/stdc++.h>
#include <type_traits>
using namespace std;
using ll = int64_t;
#define int ll
#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()
using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
os << "{";
REP(i, (int)v.size()) {
if (i)
os << ",";
os << v[i];
}
os << "}";
return os;
}
ll read() {
ll i;
scanf("%" SCNd64, &i);
return i;
}
void printSpace() { printf(" "); }
void printEoln() { printf("\n"); }
void print(ll x, int suc = 1) {
printf("%" PRId64, x);
if (suc == 1)
printEoln();
if (suc == 2)
printSpace();
}
string readString() {
static char buf[3341000];
scanf("%s", buf);
return string(buf);
}
char *readCharArray() {
static char buf[3341000];
static int bufUsed = 0;
char *ret = buf + bufUsed;
scanf("%s", ret);
bufUsed += strlen(ret) + 1;
return ret;
}
template <class T, class U> void chmax(T &a, U b) {
if (a < b)
a = b;
}
template <class T, class U> void chmin(T &a, U b) {
if (b < a)
a = b;
}
template <class T> T Sq(const T &t) { return t * t; }
const int mod = 1e9 + 7;
bool isRate[8];
signed main() {
int n;
std::cin >> n;
int overCnt = 0;
REP(i, n) {
int a = read();
if (a >= 3200)
overCnt++;
else
isRate[a / 400] = true;
}
int ans = 0;
REP(i, 8)
if (isRate[i])
ans++;
print(max(ans, 1), 2);
print(ans + overCnt);
}
| a.cc: In function 'int main()':
a.cc:99:12: error: no matching function for call to 'max(ll&, int)'
99 | print(max(ans, 1), 2);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:99:12: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
99 | print(max(ans, 1), 2);
| ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:99:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
99 | print(max(ans, 1), 2);
| ~~~^~~~~~~~
|
s256702064 | p03695 | Java | import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] a = new int[N];
Map<String, Integer> map = new HashMap<>();
for(int i = 0; i < N; i++){
a[i] = sc.nextInt();
if(1 <= a[i] && a[i] <= 399){
map.put("grey", 1);
} else if(a[i] <= 799){
map.put("brown", 1);
} else if(a[i] <= 1199){
map.put("green", 1);
} else if(a[i] <= 1599){
map.put("mizu", 1);
} else if(a[i] <= 1999){
map.put("blue", 1);
} else if(a[i] <= 2399){
map.put("yellow", 1);
} else if(a[i] <= 2799){
map.put("orange", 1);
} else if(a[i] <= 3199){
map.put("red", 1);
} else {
if(map.containsKey("all"))
map.put("all", map.get("all") + 1);
else
map.put("all", 1);
}
}
sc.close();
int min = 0;
int max = 0;
if(map.size() == 1 && !(map.containKey("all"))){
min = 1;
max = 1;
} else if(map.size() == 1){
min = 1;
max = map.get("all");
}else{
for(String key: map.keySet()){
if(key.equals("all")){
max += map.get(key);
} else {
min += map.get(key);
max += map.get(key);
}
}
}
System.out.println(min + " " + max);
}
} | Main.java:40: error: cannot find symbol
if(map.size() == 1 && !(map.containKey("all"))){
^
symbol: method containKey(String)
location: variable map of type Map<String,Integer>
1 error
|
s736523101 | p03695 | Java | import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] a = new int[N];
Map<String, Integer> map = new HashMap<>();
for(int i = 0; i < N; i++){
a[i] = sc.nextInt();
if(1 <= a[i] && a[i] <= 399){
map.put("grey", 1);
} else if(a[i] <= 799){
map.put("brown", 1);
} else if(a[i] <= 1199){
map.put("green", 1);
} else if(a[i] <= 1599){
map.put("mizu", 1);
} else if(a[i] <= 1999){
map.put("blue", 1);
} else if(a[i] <= 2399){
map.put("yellow", 1);
} else if(a[i] <= 2799){
map.put("orange", 1);
} else if(a[i] <= 3199){
map.put("red", 1);
} else {
if(map.containsKey("all"))
map.put("all", map.get("all") + 1);
else
map.put("all", 1);
}
}
sc.close();
int min = 0;
int max = 0;
if(map.size() == 1){
min = 1;
max = 1;
} else{
for(String key: map.keySet()){
if(key.equals("all")){
max += map.get(key);
} else {
min += map.get(key);
max += map.get(key);
}
}
}
System.out.println(min + " " + max);s
}
} | Main.java:53: error: not a statement
System.out.println(min + " " + max);s
^
Main.java:53: error: ';' expected
System.out.println(min + " " + max);s
^
2 errors
|
s816683469 | p03695 | Java | mport java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] a = new int[N];
Map<String, Integer> map = new HashMap<>();
for(int i = 0; i < N; i++){
a[i] = sc.nextInt();
if(1 <= a[i] && a[i] <= 399){
map.put("grey", 1);
} else if(a[i] <= 799){
map.put("brown", 1);
} else if(a[i] <= 1199){
map.put("green", 1);
} else if(a[i] <= 1599){
map.put("mizu", 1);
} else if(a[i] <= 1999){
map.put("blue", 1);
} else if(a[i] <= 2399){
map.put("yellow", 1);
} else if(a[i] <= 2799){
map.put("orange", 1);
} else if(a[i] <= 3199){
map.put("red", 1);
} else {
if(map.containsKey("all"))
map.put("all", map.get("all") + 1);
else
map.put("all", 1);
}
}
sc.close();
int min = 0;
int max = 0;
for(String key: map.keySet()){
if(key.equals("all")){
max += map.get(key);
} else {
min += map.get(key);
max += map.get(key);
}
}
if(map.size() == 1 && !(map.containsKey("all")))
System.out.println(min + " " + max);
else
System.out.println(1 + " " + max);
}
} | Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
|
s755181852 | p03695 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int N;
int main(){
cin >> N;
map<char,int> m;
for(int i = 0; i < N; i++){
int tmp;
cin >> tmp;
if(tmp >= 1 && tmp < 400)m['g']++;
else if(tmp >= 400 && tmp < 800)m['n']++;
else if(tmp >= 800 && tmp < 1200)m['e']++;
else if(tmp >= 1200 && tmp < 1600)m['a']++;
else if(tmp >= 1600 && tmp < 2000)m['b']++;
else if(tmp >= 2000 && tmp < 2400)m['y']++;
else if(tmp >= 2400 && tmp < 2800)m['o']++;
else if(tmp >= 2800 && tmp < 3200)m['r']++;
else if(tmp >= 3200)m['f']++;
}
int fixed = 0;
int free = 0;
for(auto iter = m.begin(); iter != m.end(); i++){
if(iter->first != 'f' && iter->second != 0) fixed++;
else if(iter->first == 'f') free = iter->second;
}
int minc, maxc;
minc = fixed + min(1,free);
maxc = fixed + min((8-fixed), free);
cout << minc << " " << maxc;
}
| a.cc: In function 'int main()':
a.cc:31:47: error: 'i' was not declared in this scope
31 | for(auto iter = m.begin(); iter != m.end(); i++){
| ^
|
s784315843 | p03695 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int N;
int main(){
cin >> N;
map<char,int> m;
for(int i = 0; i < N; i++){
int tmp;
cin >> tmp;
if(tmp >= 1 && tmp < 400)m['g']++;
else if(tmp >= 400 && tmp < 800)m['n']++;
else if(tmp >= 800 && tmp < 1200)m['e']++;
else if(tmp >= 1200 && tmp < 1600)m['a']++;
else if(tmp >= 1600 && tmp < 2000)m['b']++;
else if(tmp >= 2000 && tmp < 2400)m['y']++;
else if(tmp >= 2400 && tmp < 2800)m['o']++;
else if(tmp >= 2800 && tmp < 3200)m['r']++;
else if(tmp >= 3200)m['f']++;
}
int fixed = 0;
int free = 0;
for(auto iter = m.begin(), iter != m.end(), i++){
if(iter->first != 'f' && iter->second != 0) fixed++;
else if(iter->first == 'f') free = iter->second;
}
int minc, maxc;
minc = fixed + min(1,free);
maxc = fixed + min((8-fixed), free);
cout << minc << " " << maxc;
}
| a.cc: In function 'int main()':
a.cc:31:34: error: expected ';' before '!=' token
31 | for(auto iter = m.begin(), iter != m.end(), i++){
| ^~~
| ;
a.cc:31:35: error: expected primary-expression before '!=' token
31 | for(auto iter = m.begin(), iter != m.end(), i++){
| ^~
a.cc:31:47: error: 'i' was not declared in this scope
31 | for(auto iter = m.begin(), iter != m.end(), i++){
| ^
a.cc:31:50: error: expected ';' before ')' token
31 | for(auto iter = m.begin(), iter != m.end(), i++){
| ^
| ;
|
s565524134 | p03695 | C++ | #include <bins/stdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
const segNum 8;
int colorCnt[segNum+1];
for (int i = 0; i < N; i++) {
int a;
cin >> a;
for (int j = 0; j < segNum; j++) {
if (j*400 <= a && a < (j+1)*400) {
colorCnt[j] = 1;
}
}
if (a >= 400*segNum) {
colorCnt[segNum+1]++;
}
}
int max, min;
for (int i = 0; i < segNum; i++) {
if (colorCnt) {
max++;
min++;
}
}
max += colorCnt[segNum+1];
if (min == 0) {
min = 1;
}
cout << min << " " << max;
return 0;
}
| a.cc:1:10: fatal error: bins/stdc++.h: No such file or directory
1 | #include <bins/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s189596497 | p03695 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if(a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
void print(const std::vector<int> &v) {
std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
std::cout << std::endl;
}
int main() {
int n;
cin >> n;
int b[9];
for(int i = 0; i < 9; i++) {
b[i] = 0;
}
for(int i = 0; i < n; i++) {
cin >> buf;
if(buf < 400) {
b[0]++;
} else if(buf < 800) {
b[1]++;
} else if(buf < 1200) {
b[2]++;
} else if(buf < 1600) {
b[3]++;
} else if(buf < 2000) {
b[4]++;
} else if(buf < 2400) {
b[5]++;
} else if(buf < 2800) {
b[6]++;
} else if(buf < 3200) {
b[7]++;
} else if(buf >= 3200) {
b[8]++;
}
}
int cnt = 0;
for(int i = 0; i < 8; i++) {
if(b[i] != 0) {
cnt += 1;
}
}
ans1 = cnt;
ans2 = cnt + b[8];
cout << max(ans1, 1) << " " << min(ans2, 8) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:41:16: error: 'buf' was not declared in this scope
41 | cin >> buf;
| ^~~
a.cc:68:5: error: 'ans1' was not declared in this scope
68 | ans1 = cnt;
| ^~~~
a.cc:69:5: error: 'ans2' was not declared in this scope
69 | ans2 = cnt + b[8];
| ^~~~
|
s659434426 | p03695 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef std::pair<ll,ll> pl;
typedef std::map<string, ll> msl;
typedef std::map<char, ll> mcl;
typedef std::map<ll, ll> mll;
typedef std::vector<ll> vl;
typedef std::vector<pl> vpl;
const ll MOD = 1e9 + 7;
const ll INF = MOD * MOD;
const long double EPS = 1e-9;
ll gcd(ll m, ll n){
ll a = max(m, n);
ll b = min(m, n);
while(b != 1 && b != 0){ a %= b; swap(a, b);}
return b == 1 ? 1 : a;
}
ll lcm(ll m, ll n){ return m / gcd(m, n) * n;}
ll power_mod(ll a, ll power, ll mod){
ll value = 1;
while(power != 0){
if(power & 1) value = (value * a) % mod;
a = (a * a) % mod;
power = power >> 1;
}
return value % mod;
}
ll modinv(ll a, ll mod){
return power_mod(a, mod - 2, mod);
}
ll power_normal(ll a, ll power){
ll value = 1;
while(power != 0){
if(power & 1) value = value * a;
a = a * a;
power = power >> 1;
}
return value;
}
ll combination(ll n, ll r){
ll numerator = 1;
ll denomenator = 1;
for(ll i = 0; i < r ; i++){
(numerator *= ll(n - i)) %= MOD;
(denomenator *= modinv(i + 1, MOD)) %= MOD;
}
return (numerator * denomenator) % MOD;
}
ll bin_search_range(ll key, ll S[], ll left, ll right) {
while (right >= left) {
ll mid = left + (right - left) / 2;
if (S[mid] >= key && S[mid - 1] < key) return mid;
else if (S[mid - 1] >= key) right = mid - 1;
else if (S[mid] < key) left = mid + 1;
}
return right + 1;
}
ll bin_search(ll key, ll A[], ll left, ll right){
// return the index idx where A[idx] = key.
// A[left] is start and A[right] is end.
while(right >= left){
ll mid = left + (right - left) / 2;
if (A[mid] == key) return mid;
else if (A[mid] > key) right = mid - 1;
else if (A[mid] < key) left = mid + 1;
}
return -1;
}
#define rep(i, n) for(ll (i) = 0; (i) < (n) ; (i)++ )
#define For(i, a, b) for(ll (i) = (a); (i) < (b) ; (i)++ )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define tol(c) char((c)+0x20)
#define tou(c) char((c)-0x20)
#define pb push_back
#define mp make_pair
#define pr(a) cout << (a)
#define prl(a) cout << (a) << endl
#define prl2(a,b) cout << (a) << " " << (b) << endl
#define prs(a) cout << (a) << " "
#define yn(condition) if ((condition)) prl("Yes"); else prl("No");
#define YN(condition) if ((condition)) prl("YES"); else prl("NO");
#define rpr(i,n,ans) rep((i),(n)) {if ((i) < n - 1) prs((ans[(i)])); if ((i) == n - 1) prl((ans[(i)]));}
#define cpr(i,n,ans) rep((i),(n)) prl((ans[(i)]))
#define in1(a) cin >> (a)
#define in2(a,b) cin >> (a) >> (b)
#define in3(a,b,c) cin >> (a) >> (b) >> (c)
#define in4(a,b,c,d) cin >> (a) >> (b) >> (c) >> (d)
#define rin1(i,n,a) rep((i),(n)) cin >> (a[(i)])
#define rin2(i,n,a,b) rep((i),(n)) cin >> (a[(i)]) >> (b[(i)])
#define rin3(i,n,a,b,c) rep((i),(n)) cin >> (a[(i)]) >> (b[(i)]) >> (c[(i)])
#define matin(i,h,j,w,a) rep((i),(h)) rep((j),(w)) cin >> a[i][j]
#define e1 first
#define e2 second
#define ctol(c) ll((c)) - ll('0')
#define ltos(n) to_string((n))
#define items(kv, v) for(auto &(kv): (v))
#define ndig(N, n) ctol(ll(ltos((N))[ll(ltos((N)).length()) - (n)]))
#define beto(a,b,c) (a) < (b) && (b) < (c)
#define betc(a,b,c) (a) <= (b) && (b) <= (c)
#define rsort(a,n) sort(a,a+n,greater<>())
#define Forchar(c,a,z) for(char (c) = (a); (c) <= (z); (c)++)
#define cntchar(s,c) count(all((s)), c)
const ll MAX_N = 100000;
int main(void){
ll n;
ll a[100];
ll c[9];
in1(n);
rin1(i,n,a);
ll answer={1,1};
rpr(i,2,answer);
return 0;
} | a.cc: In function 'int main()':
a.cc:141:12: error: scalar object 'answer' requires one element in initializer
141 | ll answer={1,1};
| ^~~~~~
|
s673559405 | p03695 | C++ | #include <iostream>
#include <map>
using namespace std;
int main() {
int n;
int vip=0;
set<int> s;
for (int i=0; i<n; i++) {
int c;
cin >> c;
if (c < 400) s.insert(1);
for (int j=1; j<=7; j++) {
if (400*j <= c && c < 400*j+400) s.insert(j+1);
}
if (c >= 3200) vip++;
}
int so = s.size(), p;
if (so == 8) vip = 0;
else if (8-so <= vip) p = 8-so;
else p = vip;
cout << so << " " << so+p << endl;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'set' was not declared in this scope
8 | set<int> s;
| ^~~
a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
2 | #include <map>
+++ |+#include <set>
3 | using namespace std;
a.cc:8:7: error: expected primary-expression before 'int'
8 | set<int> s;
| ^~~
a.cc:12:18: error: 's' was not declared in this scope
12 | if (c < 400) s.insert(1);
| ^
a.cc:14:42: error: 's' was not declared in this scope
14 | if (400*j <= c && c < 400*j+400) s.insert(j+1);
| ^
a.cc:18:12: error: 's' was not declared in this scope; did you mean 'so'?
18 | int so = s.size(), p;
| ^
| so
a.cc:20:25: error: 'p' was not declared in this scope
20 | else if (8-so <= vip) p = 8-so;
| ^
a.cc:21:8: error: 'p' was not declared in this scope
21 | else p = vip;
| ^
a.cc:22:27: error: 'p' was not declared in this scope
22 | cout << so << " " << so+p << endl;
| ^
|
s638513513 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> cols(9);
for (int i=0; i<N; ++i) {
int rate;
cin >> rate;
int start = 0;
for (int j=0; start!=2800; start+=400, ++j) {
if (start <= rate <= start + 399) {
++cols[j];
break;
}
}
if (3200 <= rate) {
++cols[j+1];
}
}
int min_n = 0, max_n = 0;
int cnt = 0;
for (int i=0; i<9; ++i) {
if (i != 8) {
if (0 < cols[i]) {
++min_n, ++max_n;
++cnt;
}
} else {
min_n += max(0, 2 - cnt);
max_n += cols[i];
}
}
cout << min_n << " " << max_n << endl;
} | a.cc: In function 'int main()':
a.cc:20:14: error: 'j' was not declared in this scope
20 | ++cols[j+1];
| ^
|
s901968103 | p03695 | C++ | #include <iostream>
#include <vector>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
int main() {
ll N;
cin >> N;
ll a[N];
REP(i,N)
{
cin >> a[i];
}
ll t[9] = {400,800,1200,1600,2000,2400,2800,3200,4801};
bool s[9] = {};
ll yaba = 0;
REP(i,N)
{
REP(j,9)
{
if(a[i] < t[j])
{
s[j] = true;
if(j == 8)++yaba;
break;
}
}
}
ll cnt = 0;
REP(i,8)
{
if(s[i])++cnt;
}
ll iMax = cnt;
ll iMin = max(1,cnt);
if(s[9])
{
iMax += yaba;
}
cout << iMin << " " << iMax << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:53:18: error: no matching function for call to 'max(int, ll&)'
53 | ll iMin = max(1,cnt);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:53:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
53 | ll iMin = max(1,cnt);
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:53:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
53 | ll iMin = max(1,cnt);
| ~~~^~~~~~~
|
s923583332 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> TUP;
#define a first
#define b second
#define sz size()
#define pb(x) push_back(x)
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;
//a,b x
int main(){
ll N; cin>>N;
vector<ll> A(N);
vector<bool> color(8,false);
rep(i,N) cin>>A[i];
ll i=0;
ll cnt=0;
while(i<=N-1){
if(A[i]<400){
color[0]=true;
}
else if(A[i]<800){
color[1]=true;
}
else if(A[i]<1200){
color[2]=true;
}
else if(A[i]<1600){
color[3]=true;
}
else if(A[i]<2000){
color[4]=true;
}
else if(A[i]<2400){
color[5]=true;
}
else if(A[i]<2800){
color[6]=true;
}
else if(A[i]<3200){
color[7]=true;
}else{
cnt++;
}
i++;
}
ll C=0;
rep(i,8){
if(color[i]==true) C++;
}
printf("%lld %lld",max(1,C),C+cnt);
} | a.cc: In function 'int main()':
a.cc:59:31: error: no matching function for call to 'max(int, ll&)'
59 | printf("%lld %lld",max(1,C),C+cnt);
| ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:59:31: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
59 | printf("%lld %lld",max(1,C),C+cnt);
| ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:59:31: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
59 | printf("%lld %lld",max(1,C),C+cnt);
| ~~~^~~~~
|
s129714667 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
int lcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
}
int gcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return f;
}
signed main(){
int a,c,d=0;
cin>>a;
vector<int> b(9,0);
fo(i,a){
cin>>c;
b.at(min<int>(8,c/400))++;
}
fo(i,8){
if(b.at(i)>0)
d++;
}
if(d>0)
cout<<d<<endl<<d+b.at(8)<<endl;
else
cout<<1<<<<endl<<b.at(8)<<endl;
}
| a.cc: In function 'int main()':
a.cc:72:14: error: expected primary-expression before '<<' token
72 | cout<<1<<<<endl<<b.at(8)<<endl;
| ^~
|
s813552041 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
int lcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
}
int gcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return f;
}
signed main(){
int a,c,d=0;
cin>>a;
vector<int> b(9,0);
fo(i,a){
cin>>c;
b.at(min(8,c/400))++;
}
fo(i,8){
if(b.at(i)>0)
d++;
}
cout<<d<<endl<<d+b.at(8)<<endl;
} | a.cc: In function 'int main()':
a.cc:63:13: error: no matching function for call to 'min(int, long long int)'
63 | b.at(min(8,c/400))++;
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:63:13: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
63 | b.at(min(8,c/400))++;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:63:13: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
63 | b.at(min(8,c/400))++;
| ~~~^~~~~~~~~
|
s221727093 | p03695 | C | #include <stdio.h>
int main(){
int N,a[110],i,num[10],temp,sum,max,min;
//Nとa[i]を入力
scanf("%d",&N);
for(i=0; i<N; i++){
scanf("%d",&a[i]);
}
//num[i],sum,max,minを初期化
for(i=0; i<9; i++){num[i]=0;}
sum=0; max=-1; min=10;
//a[i]がどのクラスnum[i]に入るか分別
//num[i]該当者がいればnum[i]をインクリ
for(i=0; i<N; i++){
temp=a[i]/400;
if(temp>=8){temp=8;}
num[temp]++;
}
for(i=0; i<8; i++){
if(num[i]!=0){sum++;}
}
min=sum;
max=sum+temp[8];
if(max>8){max=8;}
printf("%d %d",min,max);
return(0);
}
| main.c: In function 'main':
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
29 | max=sum+temp[8];
| ^
|
s926320878 | p03695 | C | #include <stdio.h>
int main(){
int N,a[110],i,num[10],temp,sum,max,min;
//Nとa[i]を入力
scanf("%d",&N);
for(i=0; i<N; i++){
scanf("%d",&a[i]);
}
//num[i],sum,max,minを初期化
for(i=0; i<9; i++){num[i]=0;}
sum=0; max=-1, min=10
//a[i]がどのクラスnum[i]に入るか分別
//num[i]該当者がいればnum[i]をインクリ
for(i=0; i<N; i++){
temp=a[i]/400;
if(temp>=8){temp=8;}
num[temp]++;
}
for(i=0; i<8; i++){
if(num[i]!=0){sum++;}
}
min=sum;
max=sum+temp[8];
if(max>8){max=8;}
printf("%d %d",min,max);
return(0);
}
| main.c: In function 'main':
main.c:14:24: error: expected ';' before 'for'
14 | sum=0; max=-1, min=10
| ^
| ;
......
18 | for(i=0; i<N; i++){
| ~~~
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
29 | max=sum+temp[8];
| ^
|
s868090824 | p03695 | C | #include <stdio.h>
main(){
int N,a[110],i,num[10],temp,sum,max,min;
//Nとa[i]を入力
scanf("%d",&N);
for(i=0; i<N; i++){
scanf("%d",&a[i]);
}
//num[i],sum,max,minを初期化
for(i=0; i<9; i++){num[i]=0;}
sum=0; max=-1, min=10
//a[i]がどのクラスnum[i]に入るか分別
//num[i]該当者がいればnum[i]をインクリ
for(i=0; i<N; i++){
temp=a[i]/400;
if(temp>=8){temp=8;}
num[temp]++;
}
for(i=0; i<8; i++){
if(num[i]!=0){sum++;}
}
min=sum;
max=sum+temp[8];
if(max>8){max=8;}
printf("%d %d",min,max);
}
| main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:14:24: error: expected ';' before 'for'
14 | sum=0; max=-1, min=10
| ^
| ;
......
18 | for(i=0; i<N; i++){
| ~~~
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
29 | max=sum+temp[8];
| ^
|
s366597633 | p03695 | C | #include <stdio.h>
main(){
int N,a[110],i,num[10],temp,sum,max,min;
//Nとa[i]を入力
scanf("%d",&N);
for(i=0; i<N; i++){
scanf("%d",a[i]);
}
//num[i],sum,max,minを初期化
for(i=0; i<9; i++){num[i]=0;}
sum=0; max=-1, min=10
//a[i]がどのクラスnum[i]に入るか分別
//num[i]該当者がいればnum[i]をインクリ
for(i=0; i<N; i++){
temp=a[i]/400;
if(temp>=8){temp=8;}
num[temp]++;
}
for(i=0; i<8; i++){
if(num[i]!=0){sum++;}
}
min=sum;
max=sum+temp[8];
if(max>8){max=8;}
printf("%d %d",min,max);
}
| main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:14:24: error: expected ';' before 'for'
14 | sum=0; max=-1, min=10
| ^
| ;
......
18 | for(i=0; i<N; i++){
| ~~~
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
29 | max=sum+temp[8];
| ^
|
s036842641 | p03695 | C | #include <stdio.h>
main(){
int N,a[100],color[8],sum,i,temp,max;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&a[i]);
}
for(i=0;i<8;i++){color[i]=0;}
sum=0; max=-1;
for(i=0;i<N;i++){
temp=a[i]/400;
if(temp>8){temp=7;}
color[temp]++;
}
for(i=0;i<8;i++){
if(max<=color[i]){max=clor[i];}
if(color[i]){sum++;}
}
printf("%d %d",sum,max+color[7]);
}
| main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:22:27: error: 'clor' undeclared (first use in this function); did you mean 'color'?
22 | if(max<=color[i]){max=clor[i];}
| ^~~~
| color
main.c:22:27: note: each undeclared identifier is reported only once for each function it appears in
|
s441721254 | p03695 | C | #include <stdio.h>
main(){
int N,a[100],color[8],sum,i,temp,max;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&a[i]);
}
for(i=0;i<8;i++){color[i]=0;}
sum=0; max=-1;
for(i=0;i<N;i++){
temp=a[i]/400;
if(temp>8){temp=7;}
color[temp]++;
}
for(i=0;i<7;i++){
if(max<=color[i]){max=clor[i];}
if(color[i]){sum++;}
}
printf("%d %d",sum,max+color[7]);
}
| main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:22:27: error: 'clor' undeclared (first use in this function); did you mean 'color'?
22 | if(max<=color[i]){max=clor[i];}
| ^~~~
| color
main.c:22:27: note: each undeclared identifier is reported only once for each function it appears in
|
s698351554 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;
int main() {
int N;
cin >> N;
int a[N];
REP(i, N)cin >> a[i];
int c[9];
fill(c, c + 9, 0);
REP(i, N) {
c[min(a[i]/400, 8)]++;
}
int mn = 0;
REP(i, 8) {
if(c[i])mn++;
}
mn = max(1, mn);
int mx = mn + c[8]
cout << mn << " " << mx << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:5: error: expected ',' or ';' before 'cout'
28 | cout << mn << " " << mx << endl;
| ^~~~
|
s510610727 | p03695 | C++ | // template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REP_AB(i, a, b) for (ll i = ll(a); i <= ll(b); ++i)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
#define REVERSE(v) reverse(ALL(v))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a / gcd(a, b)) * b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// template end
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
ll n, a;
in >> n;
vector<ll> rate(9);
REP(i, 9) rate[i] = 0;
REP(i, n){
in >> a;
if(a < 3200){
rate[int(a/400)] += 1;
}else{
rate[8] += 1;
}
}
ll ans = 0;
REP(i, 8){
if(rate[i] > 0) ans += 1;
}
out << max(1, ans) << " " << ans + rate[8] << endl;
}
| a.cc: In function 'int main()':
a.cc:46:15: error: no matching function for call to 'max(int, ll&)'
46 | out << max(1, ans) << " " << ans + rate[8] << endl;
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:46:15: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
46 | out << max(1, ans) << " " << ans + rate[8] << endl;
| ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:46:15: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
46 | out << max(1, ans) << " " << ans + rate[8] << endl;
| ~~~^~~~~~~~
|
s635484117 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std ;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define mem(x,val) memset((x),(val),sizeof(x))
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define PI acos(-1.0)
#define N 111111
const int INF = 1 << 30 ;
typedef long long ll ;
typedef pair < int , int > pii ;
int main() {
int n, a, sp = 0 ;
scanf("%d", &n) ;
set<int> color ;
for(int i = 0 ;i<n ;i++){
scanf("%d", &a) ;
if(a<=399)color[0]++ ;
else if(a<=799) color.insert(1) ;
else if(a<=1199)color.insert(2) ;
else if(a<=1599)color.insert(3) ;
else if(a<=1999)color.insert(4) ;
else if(a<=2399)color.insert(5) ;
else if(a<=2799)color.insert(6) ;
else if(a<=3199)color.insert(7);
sp++ ;
}
cout << max(color.size(),1) << ' ' << color.size()+sp << endl ;
return 0 ;
}
| a.cc: In function 'int main()':
a.cc:23:20: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
23 | if(a<=399)color[0]++ ;
| ^
a.cc:34:14: error: no matching function for call to 'max(std::set<int>::size_type, int)'
34 | cout << max(color.size(),1) << ' ' << color.size()+sp << endl ;
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:34:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
34 | cout << max(color.size(),1) << ' ' << color.size()+sp << endl ;
| ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:34:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
34 | cout << max(color.size(),1) << ' ' << color.size()+sp << endl ;
| ~~~^~~~~~~~~~~~~~~~
|
s026645945 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define lps(i,j,n) for(int i=j;i<n;i++)
#define fordebug int hoge;cin>>hoge;
#define DEKAI 1000000007;
#define INF (1<<28)
#define int long long
#define double long double
#define floot10 cout<<fixed<<setprecision(10)
int x[9];
signed main(){
int n;
cin>>n;
lp(i,n){
int a;
cin>>a;
a/=400;
x[min(a,8)]++;
}
int cnt=0;
lp(i,8)if(x[i]>0)cnt++;
cout<<cnt<<" "<<cnt+x[8]<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:23:10: error: no matching function for call to 'min(long long int&, int)'
23 | x[min(a,8)]++;
| ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:23:10: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
23 | x[min(a,8)]++;
| ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:23:10: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
23 | x[min(a,8)]++;
| ~~~^~~~~
|
s390531571 | p03695 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#define int long
using namespace std;
signed main() {
int N;
cin >> N;
int A = 0;
int B = 0;
int C = 0;
int D = 0;
int E = 0;
int F = 0;
int G = 0;
int H = 0;
int I = 0;
for(int i = 0;i < N;i++) {
int S;
cin >> S;
if(1 <= S && S <= 399) {
A++;
}
else if(400 <= S && S <= 799) {
B++;
}
else if(800 <= S && S <= 1199) {
C++;
}
else if(1200 <= S && S <= 1599) {
D++;
}
else if(1600 <= S && S <= 1999) {
E++;
}
else if(2000 <= S && S <= 2399) {
F++;
}
else if(2400 <= S && S <= 2799) {
G++;
}
else if(2800 <= S && S <= 3199) {
H++;
}
else {
I++;
if(I > 8) {
I = 8;
}
}
}
int answer = 0;
if(A != 0) {
answer++;
}
if(B != 0) {
answer++;
}
if(C != 0) {
answer++;
}
if(D != 0) {
answer++;
}
if(E != 0) {
answer++;
}
if(F != 0) {
answer++;
}
if(G != 0) {
answer++;
}
if(H != 0) {
answer++;
}
if(answer == 0 && I != 0) {
if(I > 8) {
cout << 1 << " " << 8 << endl;
}
else {
cout << 1 << " " << I << endl;
}
else if(answer != 0 && I == 0) {
cout << answer << " " << answer << endl;
}
else {
if(answer + I > 8) {
cout << answer << " " << 8 << endl;
}
else {
cout << answer << " " << answer + I << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:89:9: error: expected '}' before 'else'
89 | else if(answer != 0 && I == 0) {
| ^~~~
a.cc:82:35: note: to match this '{'
82 | if(answer == 0 && I != 0) {
| ^
|
s831474783 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
signed main(){
int a;
int c=0;
int d=0;
int e=0;
int f=0;
int g=0;
int h=0;
int j=0;
int k=0;
int l=0;
int m=0;
cin>>a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
rep(i,b.size()){
if(b.at(i)<400){
d++;
if(d==1)
c++;
}
if(400<=b.at(i)&&b.at(i)<800){
m++;
if(m==1)
c++;
}
if(800<=b.at(i)&&b.at(i)<1200){
f++;
if(f==1)
c++;
}
if(1200<=b.at(i)&&b.at(i)<1600){
g++;
if(g==1)
c++;
}
if(1600<=b.at(i)&&b.at(i)<2000){
h++;
if(h==1)
c++;
}
if(2000<=b.at(i)&&b.at(i)<2400){
j++;
if(j==1)
c++;
}
if(2400<=b.at(i)&&b.at(i)<2800){
k++;
if(k==1)
c++;
}
if(2800<=b.at(i)&&b.at(i)<3200){
l++;
if(l==1)
c++;
}
if(3200<=b.at(i))
e++;
}
if(d==0&&m==0&&f==0&&g==0&&h==0&&j==0&&k==0&&l==0)
cout<<1<<' '<<e
else
cout<<c<<' '<<c+e;
}
| a.cc: In function 'int main()':
a.cc:66:20: error: expected ';' before 'else'
66 | cout<<1<<' '<<e
| ^
| ;
67 | else
| ~~~~
|
s342369150 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
signed main(){
int a;
int c=0;
int d=0;
int e=0;
int f=0;
int g=0;
int h=0;
int j=0;
int k=0;
int l=0;
cin>>a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
rep(i,b.size()){
if(b.at(i)<400){
d++;
if(d==1)
c++;
}
if(400<=b.at(i)&&b.at(i)<800){
e++;
if(e==1)
c++;
}
if(800<=b.at(i)&&b.at(i)<1200){
f++;
if(f==1)
c++;
}
if(1200<=b.at(i)&&b.at(i)<1600){
g++;
if(g==1)
c++;
}
if(1600<=b.at(i)&&b.at(i)<2000){
h++;
if(h==1)
c++;
}
if(2000<=b.at(i)&&b.at(i)<2400){
j++;
if(j==1)
c++;
}
if(2400<=b.at(i)&&b.at(i)<2800){
k++;
if(k==1)
c++;
}
if(2800<=b.at(i)&&b.at(i)<3200){
l++;
if(l==1)
c++;
}
cout<<c<<' '<<c+e;
} | a.cc: In function 'int main()':
a.cc:62:6: error: expected '}' at end of input
62 | }
| ^
a.cc:5:14: note: to match this '{'
5 | signed main(){
| ^
|
s680582185 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
signed main(){
int a;
int c=0;
int d=0;
int e=0;
int f=0;
int g=0;
int h=0;
int j=0;
int k=0;
int l=0;
cin>>a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
rep(i,b.size()){
if(b.at(i)<400){
d++;
if(d==1)
c++;
}
if(400<=b.at(i)&&b.at(i)<800){
e++;
if(e==1)
c++;
}
if(800<=b.at(i)&&b.at(i)<1200){
f++;
if(f==1)
c++;
}
if(1200<=b.at(i)&&b.at(i)<1600){
g++;
if(g==1)
c++;
}
if(1600<=b.at(i)&&b.at(i)<2000){
h++;
if(h==1)
c++;
}
if(2000<=b.at(i)&&b.at(i)<2400){
j++;
if(j==1)
c++;
}
if(2400<=b.at(i)&&b.at(i)<2800){
k++;
if(k==1)
c++;
}
if(2800<=b.at(i)&&b.at(i)<3200){
l++;
if(l==1)
c++;
} | a.cc: In function 'int main()':
a.cc:60:10: error: expected '}' at end of input
60 | }
| ^
a.cc:20:18: note: to match this '{'
20 | rep(i,b.size()){
| ^
a.cc:60:10: error: expected '}' at end of input
60 | }
| ^
a.cc:5:14: note: to match this '{'
5 | signed main(){
| ^
|
s233864225 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main(){
int a;
int c=0;
int e=0;
cin>>a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
rep(i,b.size()){
if(b.at(i)<400){
int d=0;
d++;
if(d==1)
c++;
}
if(400<=b.at(i)&&b.at(i)<800){
int d=0;
d++;
if(d==1)
c++;
}
if(800<=b.at(i)&&b.at(i)<1200){
int d=0;
d++;
if(d==1)
c++;
}
if(1200<=b.at(i)&&b.at(i)<1600){
int d=0;
d++;
if(d==1)
c++;
}
if(1600<=b.at(i)&&b.at(i)<2000){
int d=0;
d++;
if(d==1)
c++;
}
if(2000<=b.at(i)&&b.at(i)<2400){
int d=0;
d++;
if(d==1)
c++;
}
if(2400<=b.at(i)&&b.at(i)<2800){
int d=0;
d++;
if(d==1)
c++;
}
if(2800<=b.at(i)&&b.at(i)<3200){
int d=0;
d++;
if(d==1)
c++;
}
if(3200<b.at(i))
e++;
}
cout<<c;
cout<<c+e;
} | cc1plus: error: '::main' must return 'int'
|
s906100698 | p03695 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main{
int a;
int c=0;
int e=0;
cin>>a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
rep(i,b.size()){
if(b.at(i)<400){
int d=0;
d++;
if(d==1)
c++;
}
if(400<=b.at(i)&&b.at(i)<800){
int d=0;
d++;
if(d==1)
c++;
}
if(800<=b.at(i)&&b.at(i)<1200){
int d=0;
d++;
if(d==1)
c++;
}
if(1200<=b.at(i)&&b.at(i)<1600){
int d=0;
d++;
if(d==1)
c++;
}
if(1600<=b.at(i)&&b.at(i)<2000){
int d=0;
d++;
if(d==1)
c++;
}
if(2000<=b.at(i)&&b.at(i)<2400){
int d=0;
d++;
if(d==1)
c++;
}
if(2400<=b.at(i)&&b.at(i)<2800){
int d=0;
d++;
if(d==1)
c++;
}
if(2800<=b.at(i)&&b.at(i)<3200){
int d=0;
d++;
if(d==1)
c++;
}
if(3200<b.at(i))
e++;
}
cout<<c;
cout<<c+e;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: expected primary-expression before 'int'
5 | int a;
| ^~~
a.cc:5:3: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:8:3: error: 'cin' does not name a type
8 | cin>>a;
| ^~~
a.cc:9:17: error: 'a' was not declared in this scope
9 | vector<int> b(a);
| ^
a.cc:2:18: error: expected unqualified-id before 'for'
2 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~~
a.cc:10:3: note: in expansion of macro 'rep'
10 | rep(i,a)
| ^~~
a.cc:10:7: error: 'i' does not name a type
10 | rep(i,a)
| ^
a.cc:2:30: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
a.cc:2:34: error: expected unqualified-id before '++' token
2 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~
a.cc:10:3: note: in expansion of macro 'rep'
10 | rep(i,a)
| ^~~
a.cc:2:18: error: expected unqualified-id before 'for'
2 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~~
a.cc:12:3: note: in expansion of macro 'rep'
12 | rep(i,b.size()){
| ^~~
a.cc:12:7: error: 'i' does not name a type
12 | rep(i,b.size()){
| ^
a.cc:2:30: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
a.cc:2:34: error: expected unqualified-id before '++' token
2 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~
a.cc:12:3: note: in expansion of macro 'rep'
12 | rep(i,b.size()){
| ^~~
a.cc:64:3: error: 'cout' does not name a type
64 | cout<<c;
| ^~~~
a.cc:65:3: error: 'cout' does not name a type
65 | cout<<c+e;
| ^~~~
a.cc:66:3: error: expected declaration before '}' token
66 | }
| ^
|
s659946226 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main{
int a;
int c=0;
int e=0;
cin>>a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
rep(i,b.size()){
if(b.at(i)<400){
int d=0;
d++;
if(d==1)
c++;
}
if(400<=b.at(i)&&b.at(i)<800){
int d=0;
d++;
if(d==1)
c++;
}
if(800<=b.at(i)&&b.at(i)<1200){
int d=0;
d++;
if(d==1)
c++;
}
if(1200<=b.at(i)&&b.at(i)<1600){
int d=0;
d++;
if(d==1)
c++;
}
if(1600<=b.at(i)&&b.at(i)<2000){
int d=0;
d++;
if(d==1)
c++;
}
if(2000<=b.at(i)&&b.at(i)<2400){
int d=0;
d++;
if(d==1)
c++;
}
if(2400<=b.at(i)&&b.at(i)<2800){
int d=0;
d++;
if(d==1)
c++;
}
if(2800<=b.at(i)&&b.at(i)<3200){
int d=0;
d++;
if(d==1)
c++;
}
if(3200<b.at(i))
e++;
}
cout<<c;
cout<<c+e;
} | a.cc:5:5: error: cannot declare '::main' to be a global variable
5 | int main{
| ^~~~
a.cc:2:13: error: expected primary-expression before 'long'
2 | #define int long long
| ^~~~
a.cc:6:3: note: in expansion of macro 'int'
6 | int a;
| ^~~
a.cc:2:13: error: expected '}' before 'long'
2 | #define int long long
| ^~~~
a.cc:6:3: note: in expansion of macro 'int'
6 | int a;
| ^~~
a.cc:5:9: note: to match this '{'
5 | int main{
| ^
a.cc:9:3: error: 'cin' does not name a type
9 | cin>>a;
| ^~~
a.cc:10:17: error: 'a' was not declared in this scope
10 | vector<int> b(a);
| ^
a.cc:3:18: error: expected unqualified-id before 'for'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~~
a.cc:11:3: note: in expansion of macro 'rep'
11 | rep(i,a)
| ^~~
a.cc:11:7: error: 'i' does not name a type
11 | rep(i,a)
| ^
a.cc:3:30: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
a.cc:3:34: error: expected unqualified-id before '++' token
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~
a.cc:11:3: note: in expansion of macro 'rep'
11 | rep(i,a)
| ^~~
a.cc:3:18: error: expected unqualified-id before 'for'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~~
a.cc:13:3: note: in expansion of macro 'rep'
13 | rep(i,b.size()){
| ^~~
a.cc:13:7: error: 'i' does not name a type
13 | rep(i,b.size()){
| ^
a.cc:3:30: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
a.cc:3:34: error: expected unqualified-id before '++' token
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~
a.cc:13:3: note: in expansion of macro 'rep'
13 | rep(i,b.size()){
| ^~~
a.cc:65:3: error: 'cout' does not name a type
65 | cout<<c;
| ^~~~
a.cc:66:3: error: 'cout' does not name a type
66 | cout<<c+e;
| ^~~~
a.cc:67:3: error: expected declaration before '}' token
67 | }
| ^
|
s981091911 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main{
int a;
int c=0;
int e=0;
cin>>a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
rep(i,b.size()){
if(b.at(i)<400){
int d=0;
d++;
if(d==1)
c++;
}
if(400<=b.at(i)&&b.at(i)<800){
int d=0;
d++;
if(d==1)
c++;
}
if(800<=b.at(i)&&b.at(i)<1200){
int d=0;
d++;
if(d==1)
c++;
}
if(1200<=b.at(i)&&b.at(i)<1600){
int d=0;
d++;
if(d==1)
c++;
}
if(1600<=b.at(i)&&b.at(i)<2000){
int d=0;
d++;
if(d==1)
c++;
}
if(2000<=b.at(i)&&b.at(i)<2400){
int d=0;
d++;
if(d==1)
c++;
}
if(2400<=b.at(i)&&b.at(i)<2800){
int d=0;
d++;
if(d==1)
c++;
}
if(2800<=b.at(i)&&b.at(i)<3200){
int d=0;
d++;
if(d==1)
c++;
}
if(3200<b.at(i))
e++;
}
cout<<c;
cout<<c+e; | a.cc:5:5: error: cannot declare '::main' to be a global variable
5 | int main{
| ^~~~
a.cc:2:13: error: expected primary-expression before 'long'
2 | #define int long long
| ^~~~
a.cc:6:3: note: in expansion of macro 'int'
6 | int a;
| ^~~
a.cc:2:13: error: expected '}' before 'long'
2 | #define int long long
| ^~~~
a.cc:6:3: note: in expansion of macro 'int'
6 | int a;
| ^~~
a.cc:5:9: note: to match this '{'
5 | int main{
| ^
a.cc:9:3: error: 'cin' does not name a type
9 | cin>>a;
| ^~~
a.cc:10:17: error: 'a' was not declared in this scope
10 | vector<int> b(a);
| ^
a.cc:3:18: error: expected unqualified-id before 'for'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~~
a.cc:11:3: note: in expansion of macro 'rep'
11 | rep(i,a)
| ^~~
a.cc:11:7: error: 'i' does not name a type
11 | rep(i,a)
| ^
a.cc:3:30: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
a.cc:3:34: error: expected unqualified-id before '++' token
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~
a.cc:11:3: note: in expansion of macro 'rep'
11 | rep(i,a)
| ^~~
a.cc:3:18: error: expected unqualified-id before 'for'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~~
a.cc:13:3: note: in expansion of macro 'rep'
13 | rep(i,b.size()){
| ^~~
a.cc:13:7: error: 'i' does not name a type
13 | rep(i,b.size()){
| ^
a.cc:3:30: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^
a.cc:3:34: error: expected unqualified-id before '++' token
3 | #define rep(i,n) for(int i=0;i<n;++i)
| ^~
a.cc:13:3: note: in expansion of macro 'rep'
13 | rep(i,b.size()){
| ^~~
a.cc:65:3: error: 'cout' does not name a type
65 | cout<<c;
| ^~~~
a.cc:66:3: error: 'cout' does not name a type
66 | cout<<c+e;
| ^~~~
|
s819066075 | p03695 | C++ | #include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
int main()
{
int N;
cin >> N;
auto over = 0;
set<int> s;
for (auto i = 0; i < N; ++i)
{
int a;
cin >> a;
auto temp = a / 400;
if (temp >= 8)
{
++over;
}
else
{
s.insert(temp);
}
}
cout << s.size() << " " << min(8u, s.size() + over) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:39:39: error: no matching function for call to 'min(unsigned int, std::set<int>::size_type)'
39 | cout << s.size() << " " << min(8u, s.size() + over) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:39:39: note: deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::set<int>::size_type' {aka 'long unsigned int'})
39 | cout << s.size() << " " << min(8u, s.size() + over) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:39:39: note: mismatched types 'std::initializer_list<_Tp>' and 'unsigned int'
39 | cout << s.size() << " " << min(8u, s.size() + over) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~
|
s953509417 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<pair<int, int>q(n);
for(int i=0; i<n; ++i){
int a=0; cin >> a;
int b=0;
if(a<=399) b=0;
else if(a>400 && a<=799) b=1;
else if(a>800 && a<=1199) b=2;
else if(a>1200 && a<=1599) b=3;
else if(a>1600 && a<=1999) b=4;
else if(a>2000 && a<=2399) b=5;
else if(a>2400 && a<=2799) b=6;
else if(a>2800 && a<=3199) b=7;
else if(a>3200) b=8;
q[i]=make_pair(b ,a);
}
sort(q.begin(), q.end());
int res1=count(q.begin(), q.end(), 8);
int res2=q.erase(unique(q.begin(), q.end()), q.end());
cout << res1+res2-1 << ""<< res2<< endl;
} | a.cc: In function 'int main()':
a.cc:8:27: error: template argument 1 is invalid
8 | vector<pair<int, int>q(n);
| ^
a.cc:8:27: error: template argument 2 is invalid
a.cc:29:5: error: 'q' was not declared in this scope
29 | q[i]=make_pair(b ,a);
| ^
a.cc:33:8: error: 'q' was not declared in this scope
33 | sort(q.begin(), q.end());
| ^
|
s280554387 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define ub upper_bound
#define lb upper_bound
#define mp make_pair
#define F first
#define S second
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define ve vector
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
typedef long long ll;
const ll INF = LLONG_MAX - 100;
const ll mod = 1e9 + 7;
const int MAX_N = 2e5 + 5;
int dx[] = {-1,0,1,0}, dy[] = {0,1,0,-1};
vector<ll> prime;
int fac[MAX_N], inv[MAX_N];
template <class T = ll> T in() {T x; cin >> x; return (x);}
void DEBUG(vector<int> a) {for(int i=0;i<a.size();i++)cout<<a[i]<<" ";cout<<endl;}
void EMP(int x) {cout<<"!!!"<<x<<"!!!"<<endl;}
ll GCD(ll a, ll b) {ll c; while (b != 0) {c = a % b; a = b; b = c;}return a;}
ll LCM(ll a, ll b) {return a * b / GCD(a, b);}
ll POW(ll a, ll b, bool usemod = true) {ll c = 1LL; while (b > 0) {if (b & 1LL) {if(!usemod)c*=a;else c = a * c%mod;}if (!usemod) a*=a;else a = a * a%mod; b >>= 1LL;}return c;}
void _nCr() {fac[0] = 1LL; for (int i = 1LL; i < MAX_N; i++) {fac[i] = fac[i - 1LL] * i%mod;}for (int i = 0; i < MAX_N; i++) {inv[i] = POW(fac[i], mod - 2);}}
ll nCr(ll n, ll r) {return (fac[n] * inv[r] % mod)*inv[n - r] % mod;}
void PRI(ll n) {bool a[n + 1LL]; for (int i = 0; i < n + 1LL; i++) {a[i] = 1LL;}for (int i = 2; i < n + 1LL; i++) {if (a[i]) {prime.pb(i); ll b = i; while (b <= n) {a[b] = 0; b += i;}}}}
template <typename T> T chmin(T& a, T b) {if(a>b)a=b;return a;}
template <typename T> T chmax(T& a, T b) {if(a<b)a=b;return b;}
int col[9];
bool solve() {
int n; cin >> n;
REP (i,n) {
int a; cin >> a;
col[a/400]++;
}
int tmp = 0;
REP (i,8) {
if (col[i]) {
tmp++;
}
}
if (tmp == 0) {
cout << 1 << " ";
} else {
cout << tmp <<" ";
}
cout << min(9,tmp + col[9]) << endl;
}
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
solve();
} | a.cc: In function 'bool solve()':
a.cc:61:20: error: no matching function for call to 'min(int, long long int)'
61 | cout << min(9,tmp + col[9]) << endl;
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:61:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
61 | cout << min(9,tmp + col[9]) << endl;
| ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:61:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
61 | cout << min(9,tmp + col[9]) << endl;
| ~~~^~~~~~~~~~~~~~~~
a.cc:62:1: warning: no return statement in function returning non-void [-Wreturn-type]
62 | }
| ^
|
s187016806 | p03695 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long ll;
//typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define revrep(i, n) for(ll i = n-1; i >= 0; i--)
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 1000000000;//10^9
ll MOD = 1000000007;
//vector<int> dy = {0,0,1,-1};
//vector<int> dx = {1,-1,0,0};
int main(){
int N;
cin >> N;
vector<int> S(20);
rep(i, N){
int a; cin >> a;
S[a / 400]++;
}
ll ans = 0;
ll m = 0;
rep(i, 7){
ans += (S[i] > 0);
}
min = ans;
for(int i = 7; i < 20; i++){
ans += S[i];
}
cout << min(m, 1) << endl;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:119:9: error: overloaded function with no contextual type information
119 | min = ans;
| ^~~
|
s138026185 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
typedef long long ll;
int main() {
int n;
cin >> n;
int a, mini = 0, maxi = 0;
rep(i, n) {
cin >> a;
if(a < 3200) {
maxi++;
mini++;
else {
maxi++;
}
}
cout << mini << maxi << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:5: error: expected '}' before 'else'
15 | else {
| ^~~~
a.cc:12:18: note: to match this '{'
12 | if(a < 3200) {
| ^
|
s754081004 | p03695 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
ll n;
ci(n);
vll A(9);
FOR(i,0,n){
ll a;
ci(a);
if(a/400<=7) A[a/400]=1;
else A[8]++;
}
ll ans=0;
FOR(i,0,8) ans+=A[i];
cout<<M(1,ans)<<" ";
co(ans+A[8])
}
| a.cc: In function 'int main()':
a.cc:26:19: error: no matching function for call to 'max(int, ll&)'
26 | #define M(a,b) max(a,b)
| ~~~^~~~~
a.cc:88:9: note: in expansion of macro 'M'
88 | cout<<M(1,ans)<<" ";
| ^
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:26:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
26 | #define M(a,b) max(a,b)
| ~~~^~~~~
a.cc:88:9: note: in expansion of macro 'M'
88 | cout<<M(1,ans)<<" ";
| ^
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:26:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
26 | #define M(a,b) max(a,b)
| ~~~^~~~~
a.cc:88:9: note: in expansion of macro 'M'
88 | cout<<M(1,ans)<<" ";
| ^
|
s612221669 | p03695 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int main() {
int N;
cin >> N;
int count[9];
REP(i, 9)
count[i] = 0;
REP(i, N) {
int a;
cin >> a;
++count[min(a / 400, 8)];
}
int min_val = 0, max_val = 0;
if (count[8] == N) {
min_val = 1;
max_val = min(count[8], 8);
} else {
REP(i, 8) {
if (count[i] != 0)
++min_val;
}
max_val = min(8, min_val + count[8]);
}
cout << min_val << " " << max_val << endl;
return 0;
}
3200以上がいる・いない
色数が8色・それ以外 | a.cc:40:1: error: expected unqualified-id before numeric constant
40 | 3200以上がいる・いない
| ^~~~~~~~~~~~~~~~~~~~~~
|
s785108567 | p03695 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rfor(i, a, b) for(int i = a; i < (int)b; i++)
#define all(ary) (ary).begin(), (ary).end()
#define debug(x) cerr << #x << ": " << x << '\n'
const long long INF = 1LL << 60;
const int MOD = 1000000007; // 1e9 + 7
using namespace std;
using vec = vector<int>;
using ll = long long;
template <class T = int> T in(){ T x; cin >> x; return (x);}
template <class T> inline bool chmin(T &a, T b) { if ( a > b ) { a = b; return 1; } return 0; }
template <class T> inline bool chmax(T &a, T b) { if ( a < b ) { a = b; return 1; } return 0; }
const int dy[4] = {-1, 0, 0, 1};
const int dx[4] = {0, -1, 1, 0};
int N;
int main(int argc, char *argv[]){
cin >> N;
vec A(N);
rep(i, N) cin >> A[i];
vec R(8);
int cnt = 0;
rep(i, N){
if(A[i] < 400) R[0]++;
else if(400 <= A[i] && A[i] < 800) R[1]++;
else if(800 <= A[i] && A[i] < 1200) R[2]++;
else if(1200 <= A[i] && A[i] < 1600) R[3]++;
else if(1600 <= A[i] && A[i] < 2000) R[4]++;
else if(2000 <= A[i] && A[i] < 2400) R[5]++;
else if(2400 <= A[i] && A[i] < 2800) R[6]++;
else if(2800 <= A[i] && A[i] < 3200) R[7]++;
else cnt++;
}
ll Min = INF;
ll Max = -1;
int color = 0;
rep(i, 8)
if(R[i]) color++;
Min = color;
Max = color + cnt;
// if(color == 8) Min = Max = 8;
// else if(Max > 8) Max = 8;
Min = max(Min, 1);
cout << Min << " " << Max << endl;
return 0;
} | a.cc: In function 'int main(int, char**)':
a.cc:46:14: error: no matching function for call to 'max(ll&, int)'
46 | Min = max(Min, 1);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:46:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
46 | Min = max(Min, 1);
| ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:46:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
46 | Min = max(Min, 1);
| ~~~^~~~~~~~
|
s885072275 | p03695 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] colors = new int[9];
while (n-- > 0) {
int rate = sc.nextInt();
int colorNumber = getColor(rate);
colors[colorNumber]++;
}
int min = 0;
int max = 0;
for (int i = 0; i < 8; i++) {
if (colors[i] > 0) min++;
}
max = Math.min(8, min + colors[8]);
if (min == 0) {
min == 1;
}
System.out.println(min + " " + max);
}
public static int getColor(int rate) {
if (rate < 400) {
return 0;
} else if (rate < 800) {
return 1;
} else if (rate < 1200) {
return 2;
} else if (rate < 1600) {
return 3;
} else if (rate < 2000) {
return 4;
} else if (rate < 2400) {
return 5;
} else if (rate < 2800) {
return 6;
} else if (rate < 3200) {
return 7;
}
return 8;
}
}
| Main.java:24: error: not a statement
min == 1;
^
1 error
|
s064277881 | p03695 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] colors = new int[9];
while (n-- > 0) {
int rate = sc.nextInt();
int colorNumber = getColor(rate);
colors[colorNumber]++;
}
int min = 0;
int max = 0;
for (int i = 0; i < 8; i++) {
if (colors[i] > 0) min++;
}
if (min == 0) {
min = 1;
max = Math.min(8, colors[8]);
}
} else {
max = Math.min(8, min + colors[8]);
}
System.out.println(min + " " + max);
}
public static int getColor(int rate) {
if (rate < 400) {
return 0;
} else if (rate < 800) {
return 1;
} else if (rate < 1200) {
return 2;
} else if (rate < 1600) {
return 3;
} else if (rate < 2000) {
return 4;
} else if (rate < 2400) {
return 5;
} else if (rate < 2800) {
return 6;
} else if (rate < 3200) {
return 7;
}
return 8;
}
}
| Main.java:25: error: illegal start of type
} else {
^
Main.java:29: error: <identifier> expected
System.out.println(min + " " + max);
^
Main.java:29: error: <identifier> expected
System.out.println(min + " " + max);
^
Main.java:32: error: unnamed classes are a preview feature and are disabled by default.
public static int getColor(int rate) {
^
(use --enable-preview to enable unnamed classes)
Main.java:52: error: class, interface, enum, or record expected
}
^
5 errors
|
s940287029 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
bool col[8]=true;
int mas=0;
int g=0;
for(int i=0;i<N;i++){
int a;
cin >> a;
if(a<400 && col[0]){
mas++;
col[0]=false;
}
else if(a<800 && col[1]){
mas++;
col[1]=false;
}
else if(a<1200 && col[2]){
mas++;
col[2]=false;
}
else if(a<1600 && col[3]){
mas++;
col[3]=false;
}
else if(a<2000 && col[4]){
mas++;
col[4]=false;
}
else if(a<2400 && col[5]){
mas++;
col[5]=false;
}
else if(a<2800 && col[6]){
mas++;
col[6]=false;
}
else {
g++;
}
cout << min(mas,g) << ' ' << mas+g;
}
| a.cc: In function 'int main()':
a.cc:7:15: error: array must be initialized with a brace-enclosed initializer
7 | bool col[8]=true;
| ^~~~
a.cc:45:4: error: expected '}' at end of input
45 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s899512920 | p03695 | C++ | #include <bits/stdc++.h>
int num_to_color(int n) {
if (n >= 1 && n <= 399) {
return 1;
}
else if (n >= 400 && n <= 799) {
return 2;
}
else if (n >= 800 && n <= 1199) {
return 3;
}
else if (n >= 1200 && n <= 1599) {
return 4;
}
else if (n >= 1600 && n <= 1999) {
return 5;
}
else if (n >= 2000 && n <= 2399) {
return 6;
}
else if (n >= 2400 && n <= 2799) {
return 7;
}
else if (n >= 2800 && n <= 3199) {
return 8;
}
else {
return -1;
}
}
std::vector<int> vec, colors;
int n, a;
int main() {
int rainbow = 0;
std::cin >> n;
vec.assign(n, 0);
colors.assign(n+1, 0);
for (int i = 0; i < n; i++) {
std::cin >> a;
vec.push_back(num_to_color(a));
}
for (int j = 0; j < n; j++) {
if (vec[j] == -1) {
rainbow++;
}
else {
colors[vec[j]]++;
}
}
int max_num = 0;
int min_num = 0;
for (int r = 1; r <= 8; r++) {
if (color[r] >= 1) {
min_num++;
}
}
if (min_num == 0) {
min_num = 1;
max_num = std::min(rainbow, 8);
else {
max_num = std::min(min_num+rainbow, 8);
}
std::cout << min_num << " " << max_num << std::endl;
}
| a.cc: In function 'int main()':
a.cc:58:13: error: 'color' was not declared in this scope; did you mean 'colors'?
58 | if (color[r] >= 1) {
| ^~~~~
| colors
a.cc:65:5: error: expected '}' before 'else'
65 | else {
| ^~~~
a.cc:62:23: note: to match this '{'
62 | if (min_num == 0) {
| ^
|
s340619916 | p03695 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
ll n;
ci(n);
vll A(9);
FOR(i,0,n){
ll a;
ci(a);
A[a/400]++;
}
ll mini=0;
ll maxi=0
ll e=8;
FOR(i,0,e){
if(A[i]!=0) mini++;
}
if(mini==0) cout<<1<<" ";
else cout<<mini<<" ";
if(mini+A[8]<=9) co(mini+A[8])
else co(9)
} | a.cc: In function 'int main()':
a.cc:87:3: error: expected ',' or ';' before 'll'
87 | ll e=8;
| ^~
a.cc:88:11: error: 'e' was not declared in this scope
88 | FOR(i,0,e){
| ^
a.cc:19:40: note: in definition of macro 'FOR'
19 | #define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
| ^
|
s954944146 | p03695 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
ll n;
ci(n);
vll A(9);
FOR(i,0,n){
ll a;
ci(a);
A[a/400]++;
}
ll mini=0;
ll maxi=0
FOR(i,0,8){
if(A[i]!=0) mini++;
}
if(mini==0) cout<<1<<" ";
else cout<<mini<<" ";
if(mini+A[8]<=9) co(mini+A[8])
else co(9)
} | a.cc: In function 'int main()':
a.cc:19:20: error: expected ',' or ';' before 'for'
19 | #define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
| ^~~
a.cc:87:3: note: in expansion of macro 'FOR'
87 | FOR(i,0,8){
| ^~~
a.cc:87:7: error: 'i' was not declared in this scope
87 | FOR(i,0,8){
| ^
a.cc:19:33: note: in definition of macro 'FOR'
19 | #define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
| ^
|
s785338144 | p03695 | C++ | #include"bits/stdc++.h"
using namespace std;
#define LL long long
LL N,M,ans,r,a,col[8];
pair<LL, LL>bc;
vector<pair<LL, LL>>BC;
int main() {
vector<LL> A;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> a;
if(a<3200)col[a / 400]++;
else r++;
}
for (int i = 0; i < 8; i++) {
if (col[i] > 0)ans++;
}
cout<<ans<<" "<<min(ans + r, long long(8))<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:23:46: error: expected primary-expression before 'long'
23 | cout<<ans<<" "<<min(ans + r, long long(8))<<endl;
| ^~~~
|
s047175140 | p03695 | C++ | #include"bits/stdc++.h"
using namespace std;
#define LL long long
LL N,M,ans,r,a,col[8];
pair<LL, LL>bc;
vector<pair<LL, LL>>BC;
int main() {
vector<LL> A;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> a;
if(a<3200)col[a / 400]++;
else r++;
}
for (int i = 0; i < 8; i++) {
if (col[i] > 0)ans++;
}
cout<<ans<<" "<<min(ans + r, LL(8))<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:3:12: error: expected primary-expression before 'long'
3 | #define LL long long
| ^~~~
a.cc:23:46: note: in expansion of macro 'LL'
23 | cout<<ans<<" "<<min(ans + r, LL(8))<<endl;
| ^~
|
s401271952 | p03695 | C++ | #ifdef _DEBUG
#include "MyLib.h"
#else
#define main_C main
#include "bits/stdc++.h"
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
//#define INF (INT_MAX/2)
#define EPS (1.0e-8)
//#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions
template<ll MOD>
#endif
int main_C() {
std::cin.tie(0);
ios::sync_with_stdio(false);
int N; cin >> N;
vi A(N); REP(i, N) cin >> A[i];
map<string, int> mp;
REP(i,N){
if (1<=A[i] && A[i]<=399) {
mp["gray"]++;
} else if (400 <= A[i] && A[i] <= 799) {
mp["brown"]++;
} else if (800 <= A[i] && A[i] <= 1199) {
mp["green"]++;
} else if (1200 <= A[i] && A[i] <= 1599) {
mp["light_blue"]++;
} else if (1600 <= A[i] && A[i] <= 1999) {
mp["blue"]++;
} else if (2000 <= A[i] && A[i] <= 2399) {
mp["yellow"]++;
} else if (2400 <= A[i] && A[i] <= 2799) {
mp["orange"]++;
} else if (2800 <= A[i] && A[i] <= 3199) {
mp["red"]++;
} else if (3200 <= A[i]) {
mp["super"]++;
}
}
int lo = 0; int hi;
for(auto p : mp) {
lo++;
}
if (mp.count("super")>0) {
lo--;
hi = lo + mp["super"];
} else {
hi = lo;
}
cout << lo << " " << hi << endl;
return 0;
} | a.cc:4:16: error: cannot declare '::main' to be a template
4 | #define main_C main
| ^~~~
a.cc:30:5: note: in expansion of macro 'main_C'
30 | int main_C() {
| ^~~~~~
|
s269036473 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,count;cin>>N;
vector<int> a(9);
for(int i=0;i<N;i++){
cin>>p;
if(p<=399)a.at(0)++;
else if(p<=799)a.at(1)++;
else if(p<=1199)a.at(2)++;
else if(p<=1599)a.at(3)++;
else if(p<=1999)a.at(4)++;
else if(p<=2399)a.at(5)++;
else if(p<=2799)a.at(6)++;
else if(p<=3199)a.at(7)++;
else a.at(8)++;
}
for(int i=0;i<9;i++)
if(a.at(i)!=0)count++;
cout<<count<<" "<<count+a.at(8)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'p' was not declared in this scope
7 | cin>>p;
| ^
|
s299637417 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,count;cin>>N;
vector<int> a(9);
for(int i=0;i<N;i++){
cin>>p;
if(p<=399)a.at(0)++;
else if(p<=799)a.at(1)++;
else if(p<=1199)a.at(2)++;
else if(p<=1599)a.at(3)++;
else if(p<=1999)a.at(4)++;
else if(p<=2399)a.at(5)++;
else if(p<=2799)a.at(6)++;
else if(p<=3199)a.at(7)++;
else a.at(8)++;
}
for(int i=0;i<9;i++)
if(a.at(i)!=0)count++;
cout<<count<<" "<<cout+a.at(8)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'p' was not declared in this scope
7 | cin>>p;
| ^
a.cc:20:25: error: no match for 'operator+' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ~~~~^~~~~~~~
| | |
| | __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}
| std::ostream {aka std::basic_ostream<char>}
a.cc:20:25: note: candidate: 'operator+(int, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int})' (built-in)
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ~~~~^~~~~~~~
a.cc:20:25: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3726 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
20 | cout<<count<<" "<<cout+a.at(8)<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed:
a.cc:20:32: note: 'std:: |
s874417693 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;
int main() {
int n, a, c = 0, gra = 0, br = 0, gre = 0, cy = 0, bl = 0, ye = 0, o = 0, re = 0, sp = 0;
cin >> n;
for (int i = 0; i < n; i++){
cin >> a;
if (0 < a && a < 400 && gra < 1){
c++;
gra++;
}
if (400 < a && a < 800 && br < 1){
c++;
br++;
}
if (800 < a && a < 1200 && gre < 1){
c++;
gre++;
}
if (1200 < a && a < 1600 && cy < 1){
c++;
cy++;
}
if (1600 < a && a < 2000 && bl < 1){
c++;
bl++;
}
if (2000 < a && a < 2400 && ye < 1){
c++;
ye++;
}
if (2400 < a && a < 2800 && o < 1){
c++;
o++;
}
if (2800 < a && a < 3200 && re < 1){
c++;
re++;
}
if (a > 3199){
sp++;
}
if (sp + c > 8){
cout << c << ' ' << 8 << endl;
}else{
cout << c << ' ' << c + sp << endl;
}
} | a.cc: In function 'int main()':
a.cc:50:6: error: expected '}' at end of input
50 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s932624348 | p03695 | C++ | #include<iostream>
using namespace std;
int main(){
int N,a[100],rank[8]={0,0,0,0,0,0,0,0};
cin >> N;
int count=0;
for(int i=0;i<N;i++){
cin >> a[i];
for(int j=0;j<8;j++){
if(400*i<=a[i]&&a[i]<400*(i+1)) rank[j]=1
}
if(a[i]>3200)count++;
}
int ans1=0,ans2;
for(int i=0;i<8;i++) ans1+=rank[i];
ans2=min(ans1+count,8);
cout <<ans1 <<" "<<ans2<<endl;
} | a.cc: In function 'int main()':
a.cc:11:48: error: expected ';' before '}' token
11 | if(400*i<=a[i]&&a[i]<400*(i+1)) rank[j]=1
| ^
| ;
12 | }
| ~
|
s237073200 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
map<int,int> mapa;
int l=1,r=399;
int n,sz=0,rat;
cin >> n;
for(int i = 0;i<n;i++){
l = 1,r=399;
bool f = 0;
cin >> rat;
for(int j = 1;j<=8;j++){
if(rat>=l and rat <=r){
f = 1;
mapa[j]=1;
break;
}
l = 400*j;
r =l+399;
}
if(!f)
sz++;
}
cout<<max(1,mapa.size())<<" "<<min(8,(int)mapa.size()+sz);
} | a.cc: In function 'int main()':
a.cc:30:18: error: no matching function for call to 'max(int, std::map<int, int>::size_type)'
30 | cout<<max(1,mapa.size())<<" "<<min(8,(int)mapa.size()+sz);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:30:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'})
30 | cout<<max(1,mapa.size())<<" "<<min(8,(int)mapa.size()+sz);
| ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:30:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
30 | cout<<max(1,mapa.size())<<" "<<min(8,(int)mapa.size()+sz);
| ~~~^~~~~~~~~~~~~~~
|
s099261128 | p03695 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
void solve() {
int n;
cin >> n;
set<int> s;
int rainbow = 0;
while(n--) {
int t;
cin >> t;
if(t/400 >= 8) rainbow++;
else s.insert(t/400);
}
cout << max(1, s.size()) << " " << min(8, s.size() + rainbow) << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
/*
int t;
cin >> t;
for(int i = 1; i <= t; i++) {
cout << "Case #" << i << ": ";
solve();
}
*/
solve();
}
| a.cc: In function 'void solve()':
a.cc:34:14: error: no matching function for call to 'max(int, std::set<int>::size_type)'
34 | cout << max(1, s.size()) << " " << min(8, s.size() + rainbow) << "\n";
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:34:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<int>::size_type' {aka 'long unsigned int'})
34 | cout << max(1, s.size()) << " " << min(8, s.size() + rainbow) << "\n";
| ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:34:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
34 | cout << max(1, s.size()) << " " << min(8, s.size() + rainbow) << "\n";
| ~~~^~~~~~~~~~~~~
a.cc:34:41: error: no matching function for call to 'min(int, std::set<int>::size_type)'
34 | cout << max(1, s.size()) << " " << min(8, s.size() + rainbow) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:34:41: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<int>::size_type' {aka 'long unsigned int'})
34 | cout << max(1, s.size()) << " " << min(8, s.size() + rainbow) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:34:41: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
34 | cout << max(1, s.size()) << " " << min(8, s.size() + rainbow) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
|
s976362503 | p03695 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef long long llt;
const int MaxN = 100000 + 5, MaxM = 100000 + 5;
int main(){
int n, rate, max;
int ncount;
cin >> n;
vector<int> a(9);
for(int i=0;i<n;i++)
{
cin >> rate;
rate = rate/400;
if(rate > 7) rate = 8;
a[rate] += 1;
}
for (int i=0;i<8;i++) {
if(a[i] > 0) ncount++;
}
ncount = max(1,ncount);
max = ncount+a[8];
max = min(max, 8);
cout << ncount << ' ' << max << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:25:17: error: 'max' cannot be used as a function
25 | ncount = max(1,ncount);
| ~~~^~~~~~~~~~
|
s334515646 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long llt;
const int MaxN = 100000 + 5, MaxM = 100000 + 5;
const llt INF = 0x7F7F7F7F7F7F7F7F;
int main(){
int n
llt rate;
int ncount=0;
cin >> n;
vector<int> a(8);
for(int i=0;i<n;i++)
{
cin >> rate;
rate = rate/400;
if(rate > 7) rate = 8;
//cout << rate << endl;
a[rate] += 1;
}
for (int i=0;i<9;i++) if(a[i] != 0) ncount++;
if (ncount > a[8]) ncount = a[8]/ncount+(7-ncount);
cout << ncount << ' ' << ncount+a[8] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:5: error: expected initializer before 'llt'
12 | llt rate;
| ^~~
a.cc:14:12: error: 'n' was not declared in this scope; did you mean 'yn'?
14 | cin >> n;
| ^
| yn
a.cc:19:16: error: 'rate' was not declared in this scope
19 | cin >> rate;
| ^~~~
|
s816811588 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lint long long
#define P pair<int, int>
signed main() {
int N;
cin >> N;
int a[N];
int lis[9] = {};
for(int i = 0; i < N; ++i){
cin >> a[i];
int tmp = a[i] / 400;
if(tmp <= 7){
lis[tmp]++;
} else {
lis[8]++;
}
}
int cnt= 0;
for(int i = 0; i < 8; ++i){
if(lis[i] > 0){
cnt++;
}
}
cout << max(1, cnt) << " " << cnt + lis[8] << endl;
}#include <bits/stdc++.h>
using namespace std;
#define lint long long
#define P pair<int, int>
signed main() {
int N;
cin >> N;
int a[N];
int lis[9] = {};
for(int i = 0; i < N; ++i){
cin >> a[i];
int tmp = a[i] / 400;
if(tmp <= 7){
lis[tmp]++;
} else {
lis[8]++;
}
}
int cnt= 0;
for(int i = 0; i < 8; ++i){
if(lis[i] > 0){
cnt++;
}
}
cout << max(1, cnt) << " " << cnt + lis[8] << endl;
} | a.cc:31:2: error: stray '#' in program
31 | }#include <bits/stdc++.h>
| ^
a.cc:31:3: error: 'include' does not name a type
31 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:37:8: error: redefinition of 'int main()'
37 | signed main() {
| ^~~~
a.cc:7:8: note: 'int main()' previously defined here
7 | signed main() {
| ^~~~
|
s371109733 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,c=0,a=0;
vector<int> vec(8);
cin>>N;
vector<int> R(N);
for(int i=0;i<N;i++){
cin >> R.at(i);
}
for(int i=0;i<N;i++){
if(0<R.at(i)&&R.at(i)<400){
vec.at(0)=1;
}else if(R.at(i)<800){
vec.at(1)=1;
}else if(R.at(i)<1200){
vec.at(2)=1;
}else if(R.at(i)<1600){
vec.at(3)=1;
}else if(R.at(i)<2000){
vec.at(4)=1;
}else if(R.at(i)<2400){
vec.at(5)=1;
}else if(R.at(i)<2800){
vec.at(6)=1;
}else if(R.at(i)<3200){
vec.at(7)=1;
}else{
a=2;
}
for(int i=0;i<8;i++){
if(vec.at(i)==1)
c++;
}
cout << c <<" "<<c+a<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:43:4: error: expected '}' at end of input
43 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s429034983 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,c=0;
vector<int> vec(8)
cin>>N;
vector<int> R(N);
for(int i=0;i<N;i++){
cin >> R.at(i);
}
for(int i=0;i<N;i++){
if(0<R.at(i)&&R.at(i)<400){
vec.at(0)=1;
}else if(R.at(i)<800){
vec.at(1)=1;
}else if(R.at(i)<1200){
vec.at(2)=1;
}else if(R.at(i)<1600){
vec.at(3)=1;
}else if(R.at(i)<2000){
vec.at(4)=1;
}else if(R.at(i)<2400){
vec.at(5)=1;
}else if(R.at(i)<2800){
vec.at(6)=1;
}else{
vec.at(7)=1;
}
}
for(int i=0;i<8;i++){
if(vec.at(i)==1)
c++;
}
cout << c <<c+2 <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'cin'
7 | cin>>N;
| ^~~
|
s451980399 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,c=0;
vector<int> vec(8)
cin >> N;
vector<int> R(N);
for(int i=0;i<N;i++){
cin >> R.at(i);
}
for(int i=0;i<N;i++){
if(0<R.at(i)&&R.at(i)<400){
vec.at(0)=1;
}else if(R.at(i)<800){
vec.at(1)=1;
}else if(R.at(i)<1200){
vec.at(2)=1;
}else if(R.at(i)<1600){
vec.at(3)=1;
}else if(R.at(i)<2000){
vec.at(4)=1;
}else if(R.at(i)<2400){
vec.at(5)=1;
}else if(R.at(i)<2800){
vec.at(6)=1;
}else{
vec.at(7)=1;
}
}
for(int i=0;i<8;i++){
if(vec.at(i)==1)
c++;
}
cout << c <<c+2 <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'cin'
7 | cin >> N;
| ^~~
|
s571208483 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,c=0;
vector<int> vec(8)
cin >> N;
vector<int> R(N);
for(int i=0;i<N;i++){
cin >> R.at(i);
}
for(int i=0;i<N;i++){
if(0<R.at(i)&&R.at(i)<400){
vec.at(0)=1;
}else if(R.at(i)<800){
vec.at(1)=1;
}else if(R.at(i)<1200){
vec.at(2)=1;
}else if(R.at(i)<1600){
vec.at(3)=1;
}else if(R.at(i)<2000){
vec.at(4)=1;
}else if(R.at(i)<2400){
vec.at(5)=1;
}else if(R.at(i)<2800){
vec.at(6)=1;
}else{
vec.at(7)=1;
}
for(int i=0;i<8;i++){
if(vec.at(i)==1)
c++;
}
cout << c <<c+2 <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'cin'
7 | cin >> N;
| ^~~
a.cc:41:4: error: expected '}' at end of input
41 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s773141452 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,c=0;
vecter<int> vec(8)
cin >> N;
vector<int> R(N);
for(int i=0;i<N;i++){
cin >> R.at(i);
}
for(int i=0;i<N;i++){
if(0<R.at(i)&&R.at(i)<400){
vec.at(0)=1;
}else if(R.at(i)<800){
vec.at(1)=1;
}else if(R.at(i)<1200){
vec.at(2)=1;
}else if(R.at(i)<1600){
vec.at(3)=1;
}else if(R.at(i)<2000){
vec.at(4)=1;
}else if(R.at(i)<2400){
vec.at(5)=1;
}else if(R.at(i)<2800){
vec.at(6)=1;
}else{
vec.at(7)=1;
}
for(int i=0;i<8;i++){
if(vec.at(i)==1)
c++;
}
cout << c <<c+2 <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'vecter' was not declared in this scope
6 | vecter<int> vec(8)
| ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
6 | vecter<int> vec(8)
| ^~~
a.cc:17:7: error: 'vec' was not declared in this scope
17 | vec.at(0)=1;
| ^~~
a.cc:19:7: error: 'vec' was not declared in this scope
19 | vec.at(1)=1;
| ^~~
a.cc:21:7: error: 'vec' was not declared in this scope
21 | vec.at(2)=1;
| ^~~
a.cc:23:7: error: 'vec' was not declared in this scope
23 | vec.at(3)=1;
| ^~~
a.cc:25:7: error: 'vec' was not declared in this scope
25 | vec.at(4)=1;
| ^~~
a.cc:27:7: error: 'vec' was not declared in this scope
27 | vec.at(5)=1;
| ^~~
a.cc:29:7: error: 'vec' was not declared in this scope
29 | vec.at(6)=1;
| ^~~
a.cc:31:7: error: 'vec' was not declared in this scope
31 | vec.at(7)=1;
| ^~~
a.cc:35:10: error: 'vec' was not declared in this scope
35 | if(vec.at(i)==1)
| ^~~
a.cc:41:4: error: expected '}' at end of input
41 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s952199776 | p03695 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repb(i, n) for (int i = (int)n; i >= 0; i--)
#define reps(i, m, n) for (int i = (int)m; i < (int)n; i++)
#define repsb(i, m, n) for (int i = (int)m; i >= (int)n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999999999999
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
using namespace std;
int main(int argc, char const *argv[])
{
int n, t = 0, c = 0;
cin >> n;
vector<int> v(n, 0);
rep(i, n)
{
cin >> v[i];
}
vector<int> cnt(8, 0);
rep(i, v.size())
{
rep(j, cnt.size())
{
if (v[i] < (j + 1) * 400)
{
cnt[j]++;
break;
}
}
if (v[i] >= 3200)
cnt++;
}
rep(i, num.size())
{
if (num[i] > 0)
c++;
}
if (c != 0)
cout << c << " " << c + t << endl;
else
cout << 1 << " " << t << endl;
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:34:16: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
34 | cnt++;
| ~~~^~
a.cc:36:12: error: 'num' was not declared in this scope; did you mean 'enum'?
36 | rep(i, num.size())
| ^~~
a.cc:2:44: note: in definition of macro 'rep'
2 | #define rep(i, n) for (int i = 0; i < (int)n; i++)
| ^
|
s202182142 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int R;
int C[9]={};
for (int i=0;i<N;i++){
cin >> R;
C[R>=3200?8:R/400]++;
}
int ans=0;
for (int i=0;i<8;inti++){
ans+=C[i]>0?1:0;
}
cout << ans << " " << ans+c[8] << endl;
}
| a.cc: In function 'int main()':
a.cc:14:20: error: 'inti' was not declared in this scope; did you mean 'int'?
14 | for (int i=0;i<8;inti++){
| ^~~~
| int
a.cc:17:29: error: 'c' was not declared in this scope
17 | cout << ans << " " << ans+c[8] << endl;
| ^
|
s251028539 | p03695 | C++ | #include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a) (a).begin(),(a).end()
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int freedom = 0;
bool colors[8];
REP(i, 8) {
colors[i] = false;
}
bool hai = false;
bool cha = false;
bool midori = false;
bool mizu = false;
bool ao = false;
bool ki = false;
bool dai = false;
bool aka = false;
REP(i, n) {
int tmp;
cin >> tmp;
if(tmp <= 399) {
colors[0] = true;
} else if(tmp <= 799) {
colors[1] = true;
} else if(tmp <= 1199) {
colors[2] = true;
} else if(tmp <= 1599) {
colors[3] = true;
} else if(tmp <= 1999) {
colors[4] = true;
} else if(tmp <= 2399) {
colors[5] = true;
} else if(tmp <= 2799) {
colors[6] = true;
} else if(tmp <= 3199) {
colors[7] = true;
} else {
freedom++;
}
}
int colorsCount = 0;
REP(i, 8) {
if(colors[i]) {
colorsCount++;
}
}
int maxAns = colorsCount + freedom;
if(maxAns > 8) {
maxAns = 8;
}
cout << colorsCountm << " " << axAns << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:73:11: error: 'colorsCountm' was not declared in this scope; did you mean 'colorsCount'?
73 | cout << colorsCountm << " " << axAns << endl;
| ^~~~~~~~~~~~
| colorsCount
a.cc:73:34: error: 'axAns' was not declared in this scope; did you mean 'maxAns'?
73 | cout << colorsCountm << " " << axAns << endl;
| ^~~~~
| maxAns
|
s119306019 | p03695 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
//もう二度とつかわん//
// ↓ ↓ ↓ //
#define ll long long
// ↑ ↑ ↑ //
//フェルマー方程式の恨み//
#define rep(i,n) for(int i=0;i<n;i++)
#define ggr getchar(); getchar();return 0;
using namespace std;
ll n;
ll a[114];
ll cnt[9];
signed main() {
ll p = 0, c = 0;
cin >> n;
rep(i, n)cin >> a[i];
rep(i, n) {
cnt[a[i] / 400]++;
if (a[i] >= 3200)c++;
}
rep(i, 8) {
if (cnt[i])p++;
}
if (c == n)cout << 1 << " " << < n << endl;
else cout << p << " " << p + c << endl;
ggr
}
| a.cc: In function 'int main()':
a.cc:33:40: error: expected primary-expression before '<' token
33 | if (c == n)cout << 1 << " " << < n << endl;
| ^
a.cc:33:44: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
33 | if (c == n)cout << 1 << " " << < n << endl;
| ~~^~~~~~~
|
s103508116 | p03695 | C++ | # include<bits/stdc++.h>
using namespace std;
int main(){
int N;
int cnt = 0;
int d[9] = {0,0,0,0,0,0,0,0,0};
cin >> N;
int a[N];
for(int i = 0;i < N;i++){
cin >> a[i];
}
for(int i = 0;i < N;i++){
if((a[i] <= 399) && (a[i] >= 1)) d[0]++;
else if((a[i] <= 799) && (a[i] >= 400)) d[1]++;
else if((a[i] <= 1199) && (a[i] >= 800)) d[2]++;
else if((a[i] <= 1599) && (a[i] >= 1200)) d[3]++;
else if((a[i] <= 1999) && (a[i] >= 1600)) d[4]++;
else if((a[i] <= 2399) && (a[i] >= 2000)) d[5]++;
else if((a[i] <= 2799) && (a[i] >= 2400)) d[6]++;
else if((a[i] <= 3199) && (a[i] >= 2800)) d[7]++;
else if((a[i] >= 3200) && (a[i] <= 4800)) d[8]++;
}
for(int i = 0;i < 8;i++){
if(d[i] > 0) cnt++;
}
if(d[8] > 0) && (d[8] + cnt <= 9){
cout << cnt << " " << cnt + d[8];
}
if(d[8] > 0) && (d[8] + cnt >= 10){
cout << cnt << " " << 9;
}
else{
cout << cnt << " " << cnt;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:30:19: error: expected identifier before '(' token
30 | if(d[8] > 0) && (d[8] + cnt <= 9){
| ^
a.cc:34:18: error: expected identifier before '(' token
34 | if(d[8] > 0) && (d[8] + cnt >= 10){
| ^
|
s651251613 | p03695 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<sstream>
#include<iomanip>
#include<limits>
#include<deque>
#include<map>
#include<list>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>
#include<cstdio>
#include<memory>
#include<bitset>
using namespace std;
#define MOD 1000000007
#define INF 1050000000
int main() {
int n; cin >> n;
int a;
int ans[9];
memset(ans, 0, sizeof(ans));
for (int i = 0; i < n; i++) {
cin >> a;
if (a >= 3200) { ans[8]++; }
else { ans[a / 400]++; }
}
int x = 0;
for (int i = 0; i < 8; i++) {
if (ans[i] > 0) { x++; }
}
cout << x << " " << min(x + ans[8], 8) << endl;
} | a.cc: In function 'int main()':
a.cc:27:9: error: 'memset' was not declared in this scope
27 | memset(ans, 0, sizeof(ans));
| ^~~~~~
a.cc:17:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
16 | #include<bitset>
+++ |+#include <cstring>
17 |
|
s973910623 | p03695 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,c,r=0;
cin>>n;
map<int,int> m;
for(int i=0;i<n;++i){
cin>>c;
if((c/=400)>=8)r++;
else m[c]++;
}
cout<<max(m.size(),1)<<" "<<m.size()+r<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:12: error: no matching function for call to 'max(std::map<int, int>::size_type, int)'
12 | cout<<max(m.size(),1)<<" "<<m.size()+r<<endl;
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:12:12: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
12 | cout<<max(m.size(),1)<<" "<<m.size()+r<<endl;
| ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:12:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
12 | cout<<max(m.size(),1)<<" "<<m.size()+r<<endl;
| ~~~^~~~~~~~~~~~
|
s092610832 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef map<int, int> mi;
typedef set<int> si;
#define VV(T) vector<vector< T > >
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE" ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible" ) << endl
#define rep(i, n) REP(i, 0, n) // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++) // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )
#define SORT(x) sort(x.begin(), x.end())
#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define pb push_back
#define pu push
#define mp make_pair
#define fi first
#define sc second
#define COUT(x) cout << (x) << endl
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int N; cin >> N;
int flg = 0;
int cnt = 0;
rep(i, N) {
int a; cin >> a;
if (a >= 3200) cnt++;
else if (a >= 2800) flg |= (1<<1);
else if (a >= 2400) flg |= (1<<2);
else if (a >= 2000) flg |= (1<<3);
else if (a >= 1600) flg |= (1<<4);
else if (a >= 1200) flg |= (1<<5);
else if (a >= 800) flg |= (1<<6);
else if (a >= 400) flg |= (1<<7);
else flg |= (1<<8);
}
int temp = 0;
rep(i, 8) {
if(flg & (1<<i)) temp++;
}
if(temp == 0) {
m = 1;
}
cout << temp << " " << temp + cnt << endl;
} | a.cc: In function 'int main()':
a.cc:68:9: error: 'm' was not declared in this scope
68 | m = 1;
| ^
|
s607204577 | p03695 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<int> a(n);
for(int i=0; i<n; i++)cin>>a.at(i);
set<int> fl;
int free=0;
for(int i=0; i<n; i++){
if(a.at(i)<400)fl.insert(0);
else if(a.at(i)<800)fl.insert(1);
else if(a.at(i)<1200)fl.insert(2);
else if(a.at(i)<1600)fl.insert(3);
else if(a.at(i)<2000)fl.insert(4);
else if(a.at(i)<2400)fl.insert(5);
else if(a.at(i)<2800)fl.insert(6);
else if(a.at(i)<3200)fl.insert(7);
else free++;
}
cout<<max(fl.size(), 1)<<" "<<fl.size()+free<<endl;
} | a.cc: In function 'int main()':
a.cc:24:12: error: no matching function for call to 'max(std::set<int>::size_type, int)'
24 | cout<<max(fl.size(), 1)<<" "<<fl.size()+free<<endl;
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:24:12: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
24 | cout<<max(fl.size(), 1)<<" "<<fl.size()+free<<endl;
| ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:24:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
24 | cout<<max(fl.size(), 1)<<" "<<fl.size()+free<<endl;
| ~~~^~~~~~~~~~~~~~
|
s935719727 | p03695 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <numeric>
using namespace std;
int cnt[8];
int main(){
int n;
cin>>n;
vector<int> a(n);
int r=0;
for(int i=0;i<n;i++){
cin>>a[i];
if(a[i]<3200)cnt[a[i]/400]=1;
else r++;
}
int ans=0;
for(int i=0;i<8;i++){
ans+=cnt[i];
}
if(ans==0){
cout<<1<<" "<<r<<endl;
return 0;
}
cout<<ans<<" "<<ans+r<<endl;
}#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <numeric>
using namespace std;
int cnt[8];
int main(){
int n;
cin>>n;
vector<int> a(n);
int r=0;
for(int i=0;i<n;i++){
cin>>a[i];
if(a[i]<3200)cnt[a[i]/400]=1;
else r++;
}
int ans=0;
for(int i=0;i<8;i++){
ans+=cnt[i];
}
if(ans==0){
cout<<1<<" "<<r<<endl;
return 0;
}
cout<<ans<<" "<<ans+r<<endl;
} | a.cc:35:2: error: stray '#' in program
35 | }#include <iostream>
| ^
a.cc:35:3: error: 'include' does not name a type
35 | }#include <iostream>
| ^~~~~~~
a.cc:47:5: error: redefinition of 'int cnt [8]'
47 | int cnt[8];
| ^~~
a.cc:13:5: note: 'int cnt [8]' previously declared here
13 | int cnt[8];
| ^~~
a.cc:49:5: error: redefinition of 'int main()'
49 | int main(){
| ^~~~
a.cc:15:5: note: 'int main()' previously defined here
15 | int main(){
| ^~~~
|
s049845578 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF LLONG_MAX
#define eps LDBL_EPSILON
#define moder 1000000007
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
using namespace std;
int n,a;
set<int> st;
signed main(){
cin>>n;
int ans=0;
rep(i,n){
cin>>a;
if(a>=3200)ans++;
else st.insert(a/400);
}
cout<<max(1,(int)st.size())<<" "<<st.size()+ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:18: error: no matching function for call to 'max(int, long long int)'
22 | cout<<max(1,(int)st.size())<<" "<<st.size()+ans<<endl;
| ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:22:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
22 | cout<<max(1,(int)st.size())<<" "<<st.size()+ans<<endl;
| ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:22:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
22 | cout<<max(1,(int)st.size())<<" "<<st.size()+ans<<endl;
| ~~~^~~~~~~~~~~~~~~~~~
|
s368638561 | p03695 | C++ | #include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF LLONG_MAX
#define eps LDBL_EPSILON
#define moder 1000000007
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
using namespace std;
int n,a;
set<int> st;
signed main(){
cin>>n;
int ans=0;
rep(i,n){
cin>>a;
if(a>=3200)ans++;
else st.insert(a/400);
}
cout<<max(1,st.size())<<" "<<st.size()+ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:18: error: no matching function for call to 'max(int, std::set<long long int>::size_type)'
22 | cout<<max(1,st.size())<<" "<<st.size()+ans<<endl;
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:22:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<long long int>::size_type' {aka 'long unsigned int'})
22 | cout<<max(1,st.size())<<" "<<st.size()+ans<<endl;
| ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:22:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
22 | cout<<max(1,st.size())<<" "<<st.size()+ans<<endl;
| ~~~^~~~~~~~~~~~~
|
s935947496 | p03695 | C++ | #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
ll n, s[8], ya = 0, ans = 0;
int main() {
cin >> n;
REP(i, n) {
ll a; cin >> a;
if (a >= 3200)ya++;
else s[a / 400]++;
}
REP(i, 8) if (s[i] > 0)ans++;
cout << max(ans,1) << " " << ans + ya<< endl;
} | a.cc: In function 'int main()':
a.cc:38:20: error: no matching function for call to 'max(long long int&, int)'
38 | cout << max(ans,1) << " " << ans + ya<< endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:38:20: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
38 | cout << max(ans,1) << " " << ans + ya<< endl;
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:38:20: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
38 | cout << max(ans,1) << " " << ans + ya<< endl;
| ~~~^~~~~~~
|
s282648990 | p03695 | C++ | // https://atcoder.jp/contests/
#include <bits/stdc++.h>
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for (int(i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for (int(i) = (m); (i) < (n); i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
ll N, a, mc;
set<ll> c;
int main()
{
cin >> N;
REP(i, N)
{
cin >> a;
if (3200 <= a)
mc++;
else
c.insert((ll)(a / 400));
}
cout << c.size() << " " << min(8ll, c.size() + mc) << '\n';
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:33: error: no matching function for call to 'min(long long int, long long unsigned int)'
28 | cout << c.size() << " " << min(8ll, c.size() + mc) << '\n';
| ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:28:33: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
28 | cout << c.size() << " " << min(8ll, c.size() + mc) << '\n';
| ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:28:33: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
28 | cout << c.size() << " " << min(8ll, c.size() + mc) << '\n';
| ~~~^~~~~~~~~~~~~~~~~~~~
|
s657431184 | p03695 | C++ | #include <iostream>
using namespace std;
void f(int c[],int r) {
if (r < 400) c[0]++;
else if (r < 800) c[1]++;
else if (r < 1200) c[2]++;
else if (r < 1600) c[3]++;
else if (r < 2000) c[4]++;
else if (r < 2400) c[5]++;
else if (r < 2800) c[6]++;
else if (r < 3200) c[7]++;
else c[8]++;
}
int main() {
int n, c[9],r[101];
cin >> n;
for (int i = 0; i < 9; i++) {
c[i] = 0;
}
for (int i = 0; i < n; i++) {
cin >> r[i];
f(c, r[i]);
}
int min, max;
min = 0; max = 0;
for (int i = 0; i < 8; i++) {
if (c[i] != 0) min++;
}
max = min + c[8];
cout << min << ' ' << max << endl;
return 0;
} | a.cc:32:2: error: '\U0000200b' does not name a type
32 | }
|
|
s935753189 | p03695 | C++ | #include <iostream>
using namespace std;
void f(int c[],int r) {
if (r < 400) c[0]++;
else if (r < 800) c[1]++;
else if (r < 1200) c[2]++;
else if (r < 1600) c[3]++;
else if (r < 2000) c[4]++;
else if (r < 2400) c[5]++;
else if (r < 2800) c[6]++;
else if (r < 3200) c[7]++;
else c[8]++;
}
int main() {
int n, c[9],r[101];
cin >> n;
for (int i = 0; i < 9; i++) {
c[i] = 0;
}
for (int i = 0; i < n; i++) {
cin >> r[i];
f(c, r[i]);
}
int min, max;
min = 0; max = 0;
for (int i = 0; i < 8; i++) {
if (c[i] != 0) min++;
}
max = min + c[8];
cout << min << ' ' << max << endl;
return 0;
| a.cc: In function 'int main()':
a.cc:31:18: error: expected '}' at end of input
31 | return 0;
| ^
a.cc:14:12: note: to match this '{'
14 | int main() {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.