submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s889399551
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> Pii; typedef vector<ll> Vi; typedef vector<Vi> VVi; const double EPS = (1e-7); const ll INF =(1e13); const double PI = (acos(-1)); const ll MOD = ll(1e9) + 7; #define REP(i, n) for(ll i = 0; i < (ll)(n); i++) #define REPR(i, n) for(ll i = n; i > -1; i--) #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define ALL(x) (x).begin(),(x).end() #define SORT(x) sort((x).begin(), (x).end()) #define RSORT(x) sort((x).rbegin(), (x).rend()) #define REVERSE(x) reverse((x).begin(), (x).end()) #define SZ(x) ((ll)(x).size()) #define pb push_back #define mp make_pair //chmax(a, b): a>bならaをbで更新 更新したときにtrueを返す //chmin(a, b): a<bならaをbで更新 更新したときにtrueを返す 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; } #define dump(x) cerr<< #x << "= " << (x) << endl; ll gcd(ll a, ll b){return b?gcd(b,a%b):a;} ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;} ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (b % 2 == 0) return (pow(a * a, b / 2, m) % m); else return (pow(a * a, b / 2) * a) % m;} ll residue(ll a, ll m){return ((a % m) + m) % m;}; ll dx[4]={1,0,-1,0}; ll dy[4]={0,1,0,-1}; ll N; set<ll> s; int main(){ cin >> N; ll temp = 0; REP(i, N){ ll a; cin >> a; if(a < 3200) s.insert(a / 400); else temp++; } printf("%lld %lld\n", s.size(), min(8ll, (ll)(s.size()) + temp); }
a.cc: In function 'int main()': a.cc:50:66: error: expected ')' before ';' token 50 | printf("%lld %lld\n", s.size(), min(8ll, (ll)(s.size()) + temp); | ~ ^ | )
s091662108
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> Pii; typedef vector<ll> Vi; typedef vector<Vi> VVi; const double EPS = (1e-7); const ll INF =(1e13); const double PI = (acos(-1)); const ll MOD = ll(1e9) + 7; #define REP(i, n) for(ll i = 0; i < (ll)(n); i++) #define REPR(i, n) for(ll i = n; i > -1; i--) #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define ALL(x) (x).begin(),(x).end() #define SORT(x) sort((x).begin(), (x).end()) #define RSORT(x) sort((x).rbegin(), (x).rend()) #define REVERSE(x) reverse((x).begin(), (x).end()) #define SZ(x) ((ll)(x).size()) #define pb push_back #define mp make_pair //chmax(a, b): a>bならaをbで更新 更新したときにtrueを返す //chmin(a, b): a<bならaをbで更新 更新したときにtrueを返す 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; } #define dump(x) cerr<< #x << "= " << (x) << endl; ll gcd(ll a, ll b){return b?gcd(b,a%b):a;} ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;} ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (b % 2 == 0) return (pow(a * a, b / 2, m) % m); else return (pow(a * a, b / 2) * a) % m;} ll residue(ll a, ll m){return ((a % m) + m) % m;}; ll dx[4]={1,0,-1,0}; ll dy[4]={0,1,0,-1}; ll N; set<ll> s; int main(){ cin >> N; ll temp = 0; REP(i, N){ ll a; cin >> a; if(a < 3200) s.insert(a / 400); else temp++; } printf("%lld %lld\n", s.size(), min(8ll, s.size() + temp)); }
a.cc: In function 'int main()': a.cc:50:38: error: no matching function for call to 'min(long long int, long long unsigned int)' 50 | printf("%lld %lld\n", s.size(), min(8ll, s.size() + temp)); | ~~~^~~~~~~~~~~~~~~~~~~~~~ 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:50:38: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int') 50 | printf("%lld %lld\n", s.size(), min(8ll, s.size() + temp)); | ~~~^~~~~~~~~~~~~~~~~~~~~~ /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:50:38: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 50 | printf("%lld %lld\n", s.size(), min(8ll, s.size() + temp)); | ~~~^~~~~~~~~~~~~~~~~~~~~~
s759978774
p03695
C++
#include <bits/stdc++.h> #define INF (1<<31) - 1 //INT_MAX/2 #define MOD 1000000007 #define PI acos(-1) using ll = long long; using ull = unsigned long long; using P = std::pair<int, int>; int main(int argc, char *argv[]) { int N; std::cin >> N; std::vector<int> a(N); for (int i = 0; i < N; i++) { std::cin >> a[i]; } int max = 0; int min = 0; std::set<int> s; int cnt = 0; for (int i = 0; i < N; i++) { int temp = 0; if (a[i] < 400) { temp = 1; } else if (a[i] < 800) { temp = 2; } else if (a[i] < 1200) { temp = 3; } else if (a[i] < 1600) { temp = 4; } else if (a[i] < 2000) { temp = 5; } else if (a[i] < 2400) { temp = 6; } else if (a[i] < 2800) { temp = 7; } else if (a[i] < 3200) { temp = 8; } else { cnt++; continue; } s.insert(temp); } flag = true; for (int i = 0; i < N; i++) { if (a[i] < 3200) { break; } if (i == N-1) { flag = false; } } if (flag) { min = s.size(); max = s.size() + cnt; } else { min = 1; max = cnt; } std::cout << min << " " << max << std::endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:52:5: error: 'flag' was not declared in this scope 52 | flag = true; | ^~~~
s978137814
p03695
C++
#include <bits/stdc++.h> typedef long long ll; const int INF = 1e9; const ll LINF = 1e18; const int MOD = 1e9 + 7; using namespace std; int main() { int n; cin >> n; vector<bool> color(8, ); int pro = 0; for (int i = 0; i < n; i++) { int a = 0; cin >> a; if (a >= 3200) pro++; else { for (int j = 0; j < 8; j++) { if (400 * j <= a && a < 400 * (j + 1)) color[j] = true; } } } int rateColor = 0; for (int i = 0; i < 8; i++) if (color[i] == true) rateColor++; cout << (pro == n ? 1 : rateColor) << " " << rateColor + pro << endl; }
a.cc: In function 'int main()': a.cc:11:25: error: expected primary-expression before ')' token 11 | vector<bool> color(8, ); | ^
s127421323
p03695
C
#include <stdio.h> int main (){ int k=0,o=0,sum=0,a[8]=0,yo=0,max=0,min=10; scanf ("%d",&k); for (int i=0;i<k;i++){ scanf ("%d",&o); for (int j=0;j<8;j++){ if (400*j<=o<400*(j+1)){ if(a[j]==0){ a[j]=1; } } else{ yo=yo+1; } } } for (int l=0;l<k;l++){ sum=sum+a[l]; } max=sum+yo; min=sum; if(max>8){ max=8; } printf ("%d%d",min,max); return 0; }
main.c: In function 'main': main.c:3:24: error: invalid initializer 3 | int k=0,o=0,sum=0,a[8]=0,yo=0,max=0,min=10; | ^
s875603586
p03695
C
#include <stdio.h> int main (){ int k,o,sum=0,a[8],yo=0,max=0,min=10; scanf ("%d",&k); for (int i=0;i<k;i++){ scanf ("%d",&o); for (int j=0;j<8;j++){ if (400*j<=o<400*(j+1)){ if(a[j]==0){ a[j]=1; } } else{ yo=yo+1; } } } for (int l=0;l<k;l++){ sum=sum+a[l]; } max=sum+yo; min=sum; if(max>8){ max=8; } printf ("%d%d",min,max) return 0; }
main.c: In function 'main': main.c:26:26: error: expected ';' before 'return' 26 | printf ("%d%d",min,max) | ^ | ; 27 | return 0; | ~~~~~~
s041876767
p03695
C
#include <stdio.h> int main (){ int k,o,sum=0,a[8],yo=0,max=0,min=10; scanf ("%d",&k); for (int i=0;i<k;i++){ scanf ("%d",&o); for (int j=0;j<8;j++){ if (400*j=<o<400*(j+1)){ if(a[j]==0){ a[j]=1; } } else{ yo=yo+1; } } } for (int l=0;l<k;l++){ sum=sum+a[l]; } max=sum+yo; min=sum; if(max>8){ max=8; } printf ("%d%d",min,max) return 0; }
main.c: In function 'main': main.c:8:13: error: expected expression before '<' token 8 | if (400*j=<o<400*(j+1)){ | ^ main.c:26:26: error: expected ';' before 'return' 26 | printf ("%d%d",min,max) | ^ | ; 27 | return 0; | ~~~~~~
s911774296
p03695
C++
#ifdef LOCAL #include <cstdio> #include <vector> #include <algorithm> #include <iostream> #include <cstring> #else #include <bits/stdc++.h> #endif using namespace std ; typedef long long ll ; #define rep(i , n ) for ( int i =0; i < n ; i++) #define _sort(arg) sort(begin(arg), end(arg)) #define MOD 1000000007 #define pb push_back #define DEBUG(x) cout << #x << ": " << x << endl; /* __attribute__((constructor)) void initial() { cin.tie(NULL); ios::sync_with_stdio(false); } */ int check(int x) { if ((x >= 1) && (x <= 399)) { return 0; } if ((x >= 400) && (x <= 799)) { return 1; } if ((x >= 800) && (x <= 1199)) { return 2; } if ((x >= 1200) && (x <= 1599)) { return 3; } if ((x >= 1600) && (x <= 1999)) { return 4; } if ((x >= 2000) && (x <= 2399)) { return 5; } if ((x >= 2400) && (x <= 2799)) { return 6; } if ((x >= 2800) && (x <= 3199)) { return 7; } return 8; } int main() { cin.tie(NULL); ios::sync_with_stdio(false); int N; cin >> N; int a[9]; memset(a, 0, sizeof(a)); rep(i, N) { int tmp; cin >> tmp; //int ret = check(tmp); a[check(tmp)]++; } int min = 0; int max = 0; rep(i, 9) { if ((a[i] > 0) && (i < 8)) { min++; max++; } if (i == 8) { max += a[8]; } } min = max(1, min); cout << min << " " << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:100:18: error: 'max' cannot be used as a function 100 | min = max(1, min); | ~~~^~~~~~~~
s849645748
p03695
C++
#include "bits/stdc++.h" using namespace std; void solve() { bitset<8> distribution; int N; cin >> N; int a = 0; while (N--) { int d; cin >> d; if (d >= 3200) { a++; } else distribution[d/400] = 1; } int ans = distribution.count; cout << ans << ' ' << ans+a << endl; } int main() { solve(); //cout << "yui(*-v・)yui" << endl; return 0; }
a.cc: In function 'void solve()': a.cc:22:32: error: cannot convert 'std::bitset<8>::count' from type 'std::size_t (std::bitset<8>::)() const noexcept' {aka 'long unsigned int (std::bitset<8>::)() const noexcept'} to type 'int' 22 | int ans = distribution.count; | ^~~~~
s104987667
p03695
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <string> #include <sstream> #include <complex> #include <vector> #include <list> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <array> #include <tuple> #include <random> using namespace std; typedef long long int ll; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for(int i = int(a); i < int(b); i++) #define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__) #define all(x) (x).begin(), (x).end() #define INF 10000000000 ll a, b, c, n, m, x, y, z, w, h, ans = 0, cnt = 0, mx = 0, mn = INF; string s; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n; ll list[9]; rep(i, n){ cin >> a; if(a < 3200){ list[a / 400]++; } else{ list[8]++; } } rep(i, n){ if(list[i]){ cnt++; } } cout << max(cnt, 1) << ' ' << cnt + list[8] << endl; }
a.cc: In function 'int main()': a.cc:55:16: error: no matching function for call to 'max(ll&, int)' 55 | cout << max(cnt, 1) << ' ' << cnt + list[8] << 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:55:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 55 | cout << max(cnt, 1) << ' ' << cnt + list[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, 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:55:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 55 | cout << max(cnt, 1) << ' ' << cnt + list[8] << endl; | ~~~^~~~~~~~
s120296953
p03695
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <string> #include <sstream> #include <complex> #include <vector> #include <list> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <array> #include <tuple> #include <random> using namespace std; typedef long long int ll; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for(int i = int(a); i < int(b); i++) #define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__) #define all(x) (x).begin(), (x).end() #define INF 10000000000 ll a, b, c, n, m, x, y, z, w, h, ans = 0, cnt = 0, mx = 0, mn = INF; string s; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n; ll list[9]; rep(i, n){ cin >> a; if(a < 3200){ list[a / 400]++; } else{ list[8]++; } } rep(i, n){ if (color[i]){ cnt++; } } cout << max(cnt, 1) << ' ' << cnt + color[8] << endl; }
a.cc: In function 'int main()': a.cc:51:13: error: 'color' was not declared in this scope 51 | if (color[i]){ | ^~~~~ a.cc:55:16: error: no matching function for call to 'max(ll&, int)' 55 | cout << max(cnt, 1) << ' ' << cnt + color[8] << 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:55:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 55 | cout << max(cnt, 1) << ' ' << cnt + color[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, 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:55:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 55 | cout << max(cnt, 1) << ' ' << cnt + color[8] << endl; | ~~~^~~~~~~~ a.cc:55:41: error: 'color' was not declared in this scope 55 | cout << max(cnt, 1) << ' ' << cnt + color[8] << endl; | ^~~~~
s308686717
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef pair<int,int> P; typedef pair<ll,ll> PL; const int INF=1<<30,MOD=1000000007; const ll LINF=1ll<<60; #define _overload3(_1,_2,_3,name,...) name #define _rep(i,n) _repi(i,0,n) #define _repi(i,a,b) for(int i=a,i##_l=(b);i<i##_l;++i) #define REP(...) _overload3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__) #define REPR(i,n) for(int i=n-1;i>=0;--i) #define REPARR(i,v) for(int i=0;i<v.size();++i) #define all(v) (v).begin(),(v).end() #define uniq(v) sort(all(v));v.erase(unique(all(v)),v.end()) #define bit(n) (1ll<<(n)) template<class T>bool chmax(T&a,const T&b){if(a<b){a=b;return true;}return false;} template<class T>bool chmin(T&a,const T&b){if(a>b){a=b;return true;}return false;} #define YES(n) cout<<((n)?"YES":"NO")<<endl #define Yes(n) cout<<((n)?"Yes":"No")<<endl #define yes(n) cout<<((n)?"yes":"no")<<endl #define poss(n) cout<<((n)?"":"im")<<"possible"<<endl #define Poss(n) cout<<((n)?"P":"Imp")<<"ossible"<<endl template<typename T>ostream&operator<<(ostream&o,const vector<T>&v){for(T i:v)o<<i<<' ';return o;} template<typename T>istream&operator>>(istream&i,vector<T>&v){for(T&j:v)i>>j;return i;} template<typename T>ostream&operator<<(ostream&o,const set<T>&v){for(T i:v)o<<i<<' ';return o;} template<typename T,typename U>ostream&operator<<(ostream&o,const pair<T,U>&v){o<<v.first<<' '<<v.second;return o;} int main(){ vi c(9); cin>>n; REP(i,n){ int a; cin>>a; c[min(8,a/400)]++; } int ans=0; REP(i,7)ans+=!!c[i]; cout<<ans+!!c[8]<<endl; cout<<ans+c[8]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:35:10: error: 'n' was not declared in this scope 35 | cin>>n; | ^
s956578210
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ vi c(9); cin>>n; REP(i,n){ int a; cin>>a; c[min(8,a/400)]++; } int ans=0; REP(i,7)ans+=!!c[i]; cout<<ans+!!c[8]<<endl; cout<<ans+c[8]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:4:5: error: 'vi' was not declared in this scope 4 | vi c(9); | ^~ a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | cin>>n; | ^ | yn a.cc:6:9: error: 'i' was not declared in this scope 6 | REP(i,n){ | ^ a.cc:6:5: error: 'REP' was not declared in this scope 6 | REP(i,n){ | ^~~ a.cc:13:17: error: 'c' was not declared in this scope 13 | cout<<ans+!!c[8]<<endl; | ^
s714437679
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int_fast64_t N; scanf("%lld", &N); set<int_fast64_t> s; int_fast64_t ans(0); for(int_fast64_t i = 0, a; i < N; ++i){ scanf("%lld", &a); if(a > 3199){ ++ans; }else{ s.insert(a / 400); } } cout << max(1LL, s.size()) << " " << ans + s.size() << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:16: error: no matching function for call to 'max(long long int, std::set<long int>::size_type)' 17 | cout << max(1LL, s.size()) << " " << ans + s.size() << 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:17:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::set<long int>::size_type' {aka 'long unsigned int'}) 17 | cout << max(1LL, s.size()) << " " << ans + s.size() << 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:17:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 17 | cout << max(1LL, s.size()) << " " << ans + s.size() << endl; | ~~~^~~~~~~~~~~~~~~
s595331020
p03695
C++
//#include <bits/stdc++.h> //#include <stdio.h> #include<iostream> #include<cstdio> #include<bitset> #include<algorithm> #include<vector> #include<list> #include<queue> #include<stack> //#include <bits/stdc++.h> #include<string> #include<string.h> #include<cmath> #include<utility> #include<functional> #include<map> #include<set> #include<cctype> #include<fstream> #include <numeric> #include <iomanip> #include <cstring> using namespace std; using ll=long long; #define FOR(i, a, b) for( int i=(a);i<=(b);i++) #define RFOR(i, a, b) for( int i=(a);i>=(b);i--) #define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++) #define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--) #define MOD 1000000007 #include <iostream> #include <cmath> using namespace std; bool isPrimeNum( ll x ){ // 素数である場合 true を返す if( x <= 1 ){ // 1以下である場合は素数でないことがすぐにわかる return false; } // sqrt( double型 ) は引数の平方根を double型で返すので、int型でキャスト int n = (int)sqrt( (double)x ); for( int i = 2; i <= n; i++ ){ if( x % i == 0 ){ // 割り切る整数がある場合、即判定終了 return false; } } return true; // 割り切る整数がない場合、素数である } constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} constexpr ll lcm(int a,int b){return a*b/gcd(a,b);} constexpr ll abs(ll a,ll b){ if(a>=b)return a-b; if(a<b)return b-a; } int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; int main() { ll N,K; cin >> N; ll a[N]; ll ans=0; ll sum=0; FOR(i,0,N-1){ cin>>a[i]; } ll c1=0; ll c2=0; ll c3=0; ll c4=0; ll c5=0; ll c6=0; ll c7=0; ll c8=0; ll c9=0; FOR(i,0,N-1){ if(a[i]<400){ c1=1; }else if(a[i]<=800){ c2=1; }else if(a[i]<=1200){ c3=1; }else if(a[i]<=1600){ c4=1; }else if(a[i]<=2000){ c5=1; }else if(a[i]<=2400){ c6=1; }else if(a[i]<=2800){ c7=1; }else if(a[i]<=3200){ c9=1; }else{ c8++; } } ans=c1+c2+c3+c4+c5+c6+c7+c8+c9S; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:107:33: error: 'c9S' was not declared in this scope; did you mean 'c9'? 107 | ans=c1+c2+c3+c4+c5+c6+c7+c8+c9S; | ^~~ | c9
s623529712
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,c=0; cin>>n; int a[9]={}; for(int i=0;i<n;i++){ int b; cin>>b; if(b<400) a[0]++; else if(b<800) a[1]++; else if(b<1200) a[2]++; else if(b<1600) a[3]++; else if(b<2000) a[4]++; else if(b<2400) a[5]++; else if(b<2800) a[6]++; else if(b<3200) a[7]++; else a[8]++; if(b<3200) c++; } if(c==0){ cout<<"1 "<<b; }else{ c=0; for(int i=0;i<8;i++){ if(a[i]>0) c++; } cout<<c<<" "<<c+a[8]; } }
a.cc: In function 'int main()': a.cc:32:17: error: 'b' was not declared in this scope 32 | cout<<"1 "<<b; | ^
s900373461
p03695
C++
#include <iostream> #include <iomanip> #include <cmath> #include <algorithm> #include <functional> #include <stack> #include <queue> #include <string> #include <map> #include <unordered_map> #include <bitset> #include <numeric> using namespace std; typedef long long ll; typedef pair<ll,ll> P; const ll mod=1000000007ll; const ll inf=1000000000000000ll; const ll nmax=2*100000+1; ll lis[9]; int main(){ ll n,a,tmp,amin,amax; cin>>n; for(ll i=0;i<n;i++){ cin>>a; for(ll j=0;j<8;j++){ if(400*j<=a && a<400*(j+1)-1) lis[j]=1; } if(400*8<=a) lis[8]++; } amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; if(lis[8]>0&&amin==0){ amin=1; } cout<<amin<<" "<<amax<<endl; return 0; }
a.cc: In function 'int main()': a.cc:37:11: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:37:16: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:37:21: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:37:26: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:37:31: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:37:36: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:37:41: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:37:46: error: invalid types 'll {aka long long int}[int]' for array subscript 37 | amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]; | ^ a.cc:38:11: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:16: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:21: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:26: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:31: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:36: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:41: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:46: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^ a.cc:38:51: error: invalid types 'll {aka long long int}[int]' for array subscript 38 | amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]; | ^
s750461477
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,fr = 0; cin >> n; int a[n]; for(int i = 0;i < n;i++){ cin >> a[i]; if(a[i] >= 3200){ fr++; } } int color = 0; for(int i = 0;i < 2801;i += 400){ for(int j = 0;j < n;j++){ if(a[j] < i + 400 && i <= a[j]){ color++; break; } } } int mi = color,fr,ma = color+fr; if(color != 0){ cout << mi << " " << ma << endl; } else{ cout << 1 << " " << ma << endl; } } }
a.cc: In function 'int main()': a.cc:23:18: error: redeclaration of 'int fr' 23 | int mi = color,fr,ma = color+fr; | ^~ a.cc:5:9: note: 'int fr' previously declared here 5 | int n,fr = 0; | ^~ a.cc: At global scope: a.cc:31:1: error: expected declaration before '}' token 31 | } | ^
s657603242
p03695
C++
#include <vector> #include <algorithm> #include <map> using namespace std; int main(void){ int N; cin>>N; int a[N],b[9]; for(int i=0;i<N;i++){ cin>>a[i]; } for(int i=0;i<10;i++){ b[i]=0; } for(int i=0;i<N;i++){ if(a[i]<400) b[0]++; if(400<=a[i]&&a[i]<800) b[1]++; if(800<=a[i]&&a[i]<1200) b[2]++; if(1200<=a[i]&&a[i]<1600) b[3]++; if(1600<=a[i]&&a[i]<2000) b[4]++; if(2000<=a[i]&&a[i]<2400) b[5]++; if(2400<=a[i]&&a[i]<2800) b[6]++; if(2800<=a[i]&&a[i]<3200) b[7]++; if(3200<=a[i]) b[8]++; } int sum=0; for(int i=0;i<=7;i++){ if(b[i]!=0) sum++; } if(sum!=0) {cout<<sum<<' '<<sum+b[8];} else {cout<<1<<' '<<b[8];} return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin>>N; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include <map> +++ |+#include <iostream> 4 | using namespace std; a.cc:30:17: error: 'cout' was not declared in this scope 30 | if(sum!=0) {cout<<sum<<' '<<sum+b[8];} | ^~~~ a.cc:30:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:31:11: error: 'cout' was not declared in this scope 31 | else {cout<<1<<' '<<b[8];} | ^~~~ a.cc:31:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s281449815
p03695
C++
#include <bits/stdc++.h> using namespace std; signed main() { long long i = 0, j = 0, k = 0, ans = 0; long long n, a[200], color[9]={0}; cin >> n; for (i=0; i < n;i++){ cin >> a[i]; if(a[i]<3200) color[a[i] / 400]++; else color[8]++; } for (i = 0; i < 8;i++){ if(color[i]>0) ans++; } cout << max(1,ans) << " "; ans += color[8]; if(ans>=8) ans = 8; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:16: error: no matching function for call to 'max(int, long long int&)' 22 | cout << max(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:22:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 22 | cout << max(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:22:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | cout << max(1,ans) << " "; | ~~~^~~~~~~
s068462428
p03695
C++
#include<iostream> #include<algorithm> #include<cmath> #include<map> #include<numeric> #include<set> #include<string> #include<utility> #include<vector> #define rep(i, a, n) for(int i=a; i<n; i++) #define per(i, a, n) for(int i=n-1; i>=a; i--) #define all(x) (x).begin(), (x).end() #define MAX 10000 using namespace std; typedef long long int ll; int main(){ int n; cin >> n; map<string, int> mp; int other = 0; int minAns, maxAns; vector<int> rate(100); rep(i, 0, n){ cin >> rate[i]; if(1 <= rate[i] and rate[i] <= 399){ mp["灰色"]++; } else if(400 <= rate[i] and rate[i] <= 799){ mp["茶色"]++; } else if(800 <= rate[i] and rate[i] <= 1199){ mp["緑色"]++; } else if(1200 <= rate[i] and rate[i] <= 1599){ mp["水色"]++; } else if(1600 <= rate[i] and rate[i] <= 1999){ mp["青色"]++; } else if(2000 <= rate[i] and rate[i] <= 2399){ mp["黄色"]++; } else if(2400 <= rate[i] and rate[i] <= 2799){ mp["橙色"]++; } else if(2800 <= rate[i] and rate[i] <= 3199){ mp["赤色"]++; } else{ other++; } } if(mp.size() == 0) { minAns = 1; maxAns = other; else { minAns = mp.size(); maxAns = minAns + other; } cout << minAns << " " << maxAns << endl; return 0; }
a.cc: In function 'int main()': a.cc:57:3: error: expected '}' before 'else' 57 | else { | ^~~~ a.cc:54:22: note: to match this '{' 54 | if(mp.size() == 0) { | ^
s020051565
p03695
Java
import java.util.*; class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[9]; for(int i = 0; i < n; i++){ int k = sc.nextInt() / 400; if(k > 8) k = 8; a[k]++; } int ans1 = 0; for(int i = 0; i < 8; i++) if(a[i] > 0) ans1++; int ans2; if(ans1 == 0){ ans1 = 1; ans2 = Math.min(9, a[8]); }else ans2 = Math.min(9, ans1 + a[8]); System.out.print(ans1 + " " + ans2); } } } }
Main.java:25: error: class, interface, enum, or record expected } } ^ 1 error
s001670532
p03695
C
#include <stdio.h> int main(void){ int tmp[8] = {0}; int b=0,cnt=0,max=0,i,n; scanf("%d",&n); int a[n]; for(i=0;i<n;i++){ scanf("%d",&a[i]); if(a[i] >= 3200){ b++; }else{ tmp[a[i]/400]++; } } for(i=0;i<8;i++){ if(tmp[i] > 0){ cnt++; } } max = cnt; if(max < 8){ for(;max < 8 && b > 0;b--){ max++; } } if(cnt == 0){ cnt++; } } if(b==0){ max++; } printf("%d %d",cnt,max); }
main.c:30:5: error: expected identifier or '(' before 'if' 30 | if(b==0){ | ^~ main.c:33:12: error: expected declaration specifiers or '...' before string constant 33 | printf("%d %d",cnt,max); | ^~~~~~~ main.c:33:20: error: unknown type name 'cnt'; did you mean 'int'? 33 | printf("%d %d",cnt,max); | ^~~ | int main.c:33:24: error: unknown type name 'max' 33 | printf("%d %d",cnt,max); | ^~~ main.c:34:1: error: expected identifier or '(' before '}' token 34 | } | ^
s991482275
p03695
C
case 0: flg[0]=1; break; case 1: flg[1]=1; break; case 2: flg[2]=1; break; case 3: flg[3]=1; break; case 4: flg[4]=1; break; case 5: flg[5]=1; break; case 6: flg[6]=1; break; case 7: flg[7]=1; break; default: flg[8]++; } } for(i=0;i<8;i++) min+=flg[i]; printf("%d %d\n",min,min+flg[8]); free(a); return 0; }
main.c:1:10: error: expected identifier or '(' before 'case' 1 | case 0: | ^~~~ main.c:3:13: error: expected identifier or '(' before 'break' 3 | break; | ^~~~~ main.c:4:10: error: expected identifier or '(' before 'case' 4 | case 1: | ^~~~ main.c:6:13: error: expected identifier or '(' before 'break' 6 | break; | ^~~~~ main.c:7:10: error: expected identifier or '(' before 'case' 7 | case 2: | ^~~~ main.c:9:13: error: expected identifier or '(' before 'break' 9 | break; | ^~~~~ main.c:10:10: error: expected identifier or '(' before 'case' 10 | case 3: | ^~~~ main.c:12:13: error: expected identifier or '(' before 'break' 12 | break; | ^~~~~ main.c:13:10: error: expected identifier or '(' before 'case' 13 | case 4: | ^~~~ main.c:15:13: error: expected identifier or '(' before 'break' 15 | break; | ^~~~~ main.c:16:10: error: expected identifier or '(' before 'case' 16 | case 5: | ^~~~ main.c:18:13: error: expected identifier or '(' before 'break' 18 | break; | ^~~~~ main.c:19:10: error: expected identifier or '(' before 'case' 19 | case 6: | ^~~~ main.c:21:13: error: expected identifier or '(' before 'break' 21 | break; | ^~~~~ main.c:22:10: error: expected identifier or '(' before 'case' 22 | case 7: | ^~~~ main.c:24:13: error: expected identifier or '(' before 'break' 24 | break; | ^~~~~ main.c:25:10: error: expected identifier or '(' before 'default' 25 | default: | ^~~~~~~ main.c:27:10: error: expected identifier or '(' before '}' token 27 | } | ^ main.c:28:7: error: expected identifier or '(' before '}' token 28 | } | ^ main.c:30:4: error: expected identifier or '(' before 'for' 30 | for(i=0;i<8;i++) | ^~~ main.c:30:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 30 | for(i=0;i<8;i++) | ^ main.c:30:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 30 | for(i=0;i<8;i++) | ^~ main.c:32:11: error: expected declaration specifiers or '...' before string constant 32 | printf("%d %d\n",min,min+flg[8]); | ^~~~~~~~~ main.c:32:21: error: unknown type name 'min' 32 | printf("%d %d\n",min,min+flg[8]); | ^~~ main.c:32:25: error: unknown type name 'min' 32 | printf("%d %d\n",min,min+flg[8]); | ^~~ main.c:34:4: warning: data definition has no type or storage class 34 | free(a); | ^~~~ main.c:34:4: error: type defaults to 'int' in declaration of 'free' [-Wimplicit-int] main.c:34:4: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type] main.c:34:4: warning: conflicting types for built-in function 'free'; expected 'void(void *)' [-Wbuiltin-declaration-mismatch] main.c:1:1: note: 'free' is declared in header '<stdlib.h>' +++ |+#include <stdlib.h> 1 | case 0: main.c:36:4: error: expected identifier or '(' before 'return' 36 | return 0; | ^~~~~~ main.c:37:1: error: expected identifier or '(' before '}' token 37 | } | ^
s394012075
p03695
C++
#include<iostream> using namespace std; int main() { int N; int a[110]; int b[9]; for (int i = 0; i < 9; ++i) { b[i] = 0; } cin >> N; for (int i = 0; i < N; ++i) { cin >> a[i]; for (int j = 0; j < 8; ++j) { if (j * 400 <= a[i] && a[i] < (j + 1) * 400) b[j]++; } if (3200 <= a[i]) b[8]++; } int mn = 0, int mx = 0; for (int j = 0; j < 8; ++j) { if (b[j] > 0) { mn++; mx++; } } if (mn == 0)mn++; if (b[8] > 0)mx += b[8]; cout << mn << " " << mx; return 0; }
a.cc: In function 'int main()': a.cc:20:21: error: expected unqualified-id before 'int' 20 | int mn = 0, int mx = 0; | ^~~ a.cc:24:25: error: 'mx' was not declared in this scope; did you mean 'mn'? 24 | mx++; | ^~ | mn a.cc:28:22: error: 'mx' was not declared in this scope; did you mean 'mn'? 28 | if (b[8] > 0)mx += b[8]; | ^~ | mn a.cc:29:30: error: 'mx' was not declared in this scope; did you mean 'mn'? 29 | cout << mn << " " << mx; | ^~ | mn
s267534552
p03695
C++
#include<bits/stdc++.h> using namespace std; typedef long long int llint; typedef pair<int, int> pii; typedef pair<llint, llint> pll; typedef vector<int> vi; typedef vector<llint> vli; typedef vector<pii> vpii; typedef vector<pll> vpll; #define I cin #define O cout #define EN endl #define ln cout<<endl #define pb(a) push_back(a) #define x first #define y second #define MOD 1000000007 template<typename Tn> Tn gcd(Tn a, Tn b) { return (b ? gcd(b, a % b) : a); } template<typename Tn> Tn lcm(Tn a, Tn b) { return a / gcd(a, b) * b; } llint cnt = 0; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; int main() { int n; I >> n; int a[10] = {}; for(int i = 0; i < n; i++) { int m; I >> m; a[min(m / 400, 8)]++; } for(int i = 0; i < 8; i++) if(a[i]) cnt++; O << max(cnt, 1) << ' ' << min((int)cnt + a[8], 8) << EN; return 0; }
a.cc: In function 'int main()': a.cc:50:11: error: no matching function for call to 'max(llint&, int)' 50 | O << max(cnt, 1) << ' ' << min((int)cnt + a[8], 8) << EN; | ~~~^~~~~~~~ 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:50:11: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 50 | O << max(cnt, 1) << ' ' << min((int)cnt + a[8], 8) << EN; | ~~~^~~~~~~~ /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:50:11: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 50 | O << max(cnt, 1) << ' ' << min((int)cnt + a[8], 8) << EN; | ~~~^~~~~~~~
s691352153
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; int pro = 0; int num[N]; int p[8] = {0,0,0,0,0,0,0,0} for(int i = 0;i<N;i++){ cin >> num[i]; for(int k = 0;k<8;k++){ if(k*400 <= num[i] < (k+1)*400){ p[k]++; } if(p[i]>=3200){ pro++; } } } int ans = 0; for(int i = 0;i<8;i++){ if(p[k] != 0){ ans++; } } int ansmax = 0; ansmax = max(8,ans+pro); cout << ans << " " << ansmax << endl; }
a.cc: In function 'int main()': a.cc:9:3: error: expected ',' or ';' before 'for' 9 | for(int i = 0;i<N;i++){ | ^~~ a.cc:9:17: error: 'i' was not declared in this scope 9 | for(int i = 0;i<N;i++){ | ^ a.cc:22:10: error: 'k' was not declared in this scope 22 | if(p[k] != 0){ | ^
s493304778
p03695
C++
#include <bits.stdc++.h> using namespace std; int main(){ int N; cin>>N; int pro = 0; int num[N]; int p[8] = {0,0,0,0,0,0,0,0} for(int i = 0;i<N;i++){ cin >> num[i]; for(int k = 0;k<8;k++){ if(k*400 <= num[i] < (k+1)*400){ p[k]++; } if(p[i]>=3200){ pro++; } } } int ans = 0; for(int i = 0;i<8;i++){ if(p[k] != 0){ ans++; } } int ansmax = 0; ansmax = max(8,ans+pro); cout << ans << " " << ansmax << endl; }
a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory 1 | #include <bits.stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s521889229
p03695
C++
//15:32 #include <stdio.h> #include <string.h> #include <algorithm> typedef long long ll; ll max(ll a, ll b){return(a>b)?a:b;} ll min(ll a, ll b){return(a<b)?a:b;} ll abs(ll a){return(a<0)?-a:a;} ll gcd(ll a, ll b){ if(b > a){ ll tmp = b; b = a; a = tmp; } if(b == 0) return a; else return gcd(b, a%b); } ll lcm(ll a, ll b){ ll gcdi = gcd(a,b); return a/gcdi*(b); } #define MOD (1000000000+7) int main(){ int N; scanf("%d",&N); char cnt[8]; memset(cnt,0,sizeof(cnt)); int score; int cnt32 = 0; for(int i = 0; i < N; i++){ scanf("%d",&score); if(score >= 3200) cnt32++; else cnt[score/400] = 1; } int total = 0; for(int i = 0; i < 8; i++){ total += cnt[i]; } if(total == 0){ printf("%d %d\n", 1, cnt32); }else{ printf("%d %d\n", total, total+cnt32); } } ~
a.cc:50:2: error: expected class-name at end of input 50 | ~ | ^
s757343562
p03695
C++
#include<bits/stdc++.h> int res; int a[10]; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++) { int t; scanf("%d",&t); a[min(t/400,8)]++; } for(int i=0;i<8;i++) res+=(bool)a[i]; if(!res&&a[9]) { printf("1 %d\n",a[9]); } else { printf("%d %d\n",res,min(res+a[9],8)); } return 0; }
a.cc: In function 'int main()': a.cc:14:11: error: 'min' was not declared in this scope; did you mean 'std::min'? 14 | a[min(t/400,8)]++; | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:23:30: error: 'min' was not declared in this scope; did you mean 'std::min'? 23 | printf("%d %d\n",res,min(res+a[9],8)); | ^~~ | std::min /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~
s213584065
p03695
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] a = new int[N]; for(int i=0;i<N;i++) a[i]=sc.nextInt(); int[] rec = new int[9]; for(int i=0;i<N;i++){ if(a[i]>=3200) rec[8]++; else rec[a[i]/400]++; } int ans1 = 0; for(int i=0;i<=7;i++){ if(rec[i]>0) ans1++; } int ans2 = ans1+rec[8]; system.out.print(ans1); System.out.print(" "); System.out.print(ans2); } }
Main.java:19: error: package system does not exist system.out.print(ans1); ^ 1 error
s910678722
p03695
C++
#include <stdio.h> int main(void) { int n,a[101],i,b[10]={0,0,0,0,0,0,0,0,0},c=0; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d",&a[i]); if(a[i]<=399){ b[0]=b[0]+1; }else if(a[i]>=400 && a[i]<=799){ b[1]=b[1]+1; }else if(a[i]>=800 && a[i]<=1199){ b[2]=b[2]+1; }else if(a[i]>=1200 && a[i]<=1599){ b[3]=b[3]+1; }else if(a[i]>=1600 && a[i]<=1999){ b[4]=b[4]+1; }else if(a[i]>=2000 && a[i]<=2399){ b[5]=b[5]+1; }else if(a[i]>=2400 && a[i]<=2799){ b[6]=b[6]+1; }else if(a[i]>=2800 && a[i]<=3199){ b[7]=b[7]+1; else if(a[i]>=3200){ b[8]=b[8]+1; } } if(b[0]!=0){ c=c+1; }else if(b[1]!=0){ c=c+1; }else if(b[2]!=0){ c=c+1; }else if(b[3]!=0){ c=c+1; }else if(b[4]!=0){ c=c+1; }else if(b[5]!=0){ c=c+1; }else if(b[6]!=0){ c=c+1; }else if(b[7]!=0){ c=c+1; } printf("%d %d\n",c,c+b[8]); return 0; }
a.cc: In function 'int main()': a.cc:24:17: error: expected '}' before 'else' 24 | else if(a[i]>=3200){ | ^~~~ a.cc:22:51: note: to match this '{' 22 | }else if(a[i]>=2800 && a[i]<=3199){ | ^
s821033873
p03695
C++
#include <stdio.h> int main(void) { int n,a[101],i,b[10]={0,0,0,0,0,0,0,0,0},c=0; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d",&a[i]); if(a[i]<=399){ b[0]=b[0]+1; }else if(a[i]>=400 && a[i]<=799){ b[1]=b[1]+1; }elseif(a[i]>=800 && a[i]<=1199){ b[2]=b[2]+1; }else if(a[i]>=1200 && a[i]<=1599){ b[3]=b[3]+1; }else if(a[i]>=1600 && a[i]<=1999){ b[4]=b[4]+1; }else if(a[i]>=2000 && a[i]<=2399){ b[5]=b[5]+1; }else if(a[i]>=2400 && a[i]<=2799){ b[6]=b[6]+1; }else if(a[i]>=2800 && a[i]<=3199){ b[7]=b[7]+1; else if(a[i]>=3200){ b[8]=b[8]+1; } } if(b[0]!=0){ c=c+1; }else if(b[1]!=0){ c=c+1; }else if(b[2]!=0){ c=c+1; }else if(b[3]!=0){ c=c+1; }else if(b[4]!=0){ c=c+1; }else if(b[5]!=0){ c=c+1; }else if(b[6]!=0){ c=c+1; }else if(b[7]!=0){ c=c+1; } printf("%d %d\n",c,c+b[8]); return 0; }
a.cc: In function 'int main()': a.cc:12:18: error: 'elseif' was not declared in this scope 12 | }elseif(a[i]>=800 && a[i]<=1199){ | ^~~~~~ a.cc:14:18: error: 'else' without a previous 'if' 14 | }else if(a[i]>=1200 && a[i]<=1599){ | ^~~~ a.cc:24:17: error: expected '}' before 'else' 24 | else if(a[i]>=3200){ | ^~~~ a.cc:22:51: note: to match this '{' 22 | }else if(a[i]>=2800 && a[i]<=3199){ | ^
s242947404
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; set<int> s; int sp = 0; for(int i = 0; i < N; i++){ int a; cin >> a; a /= 400; if(a < 3200) s.insert(a); else sp++; } cout << max(s.size(), 1) << endl; cout << ' '; cout << min(s.size()+sp, 8) << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:16: error: no matching function for call to 'max(std::set<int>::size_type, int)' 14 | cout << max(s.size(), 1) << 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:14:16: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 14 | cout << max(s.size(), 1) << 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:14:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 14 | cout << max(s.size(), 1) << endl; | ~~~^~~~~~~~~~~~~ a.cc:16:16: error: no matching function for call to 'min(std::set<int>::size_type, int)' 16 | cout << min(s.size()+sp, 8) << endl; | ~~~^~~~~~~~~~~~~~~~ /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:16:16: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 16 | cout << min(s.size()+sp, 8) << 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 /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:16:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 16 | cout << min(s.size()+sp, 8) << endl; | ~~~^~~~~~~~~~~~~~~~
s016415661
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); } int k,b,c,d,e,f,g,h,j; k=0; b=0; c=0; d=0; e=0; f=0; g=0; h=0; j=0; for(int i=0;i<N;i++){ if(a.at(i)<=399){k++;} if(400<=a.at(i) && a.at(i)<=799){b++} if(800<=a.at(i) && a.at(i)<=1199){c++} if(1200<=a.at(i) && a.at(i)<=1599){d++} if(1600<=a.at(i) && a.at(i)<=1999){e++} if(2000<=a.at(i) && a.at(i)<=2399){f++} if(2400<=a.at(i) && a.at(i)<=2799){g++} if(2800<=a.at(i) && a.at(i)<=3199){h++} if(3200<=a.at(i)){j++} } int A=0; if(k!=0){A++;} if(b!=0){A++;} if(c!=0){A++;} if(d!=0){A++;} if(e!=0){A++;} if(f!=0){A++;} if(g!=0){A++;} if(h!=0){A++;} cout << A << " "; if(j+A<=8){cout << j+A << endl;} else{cout << 8 << endl;} }
a.cc: In function 'int main()': a.cc:15:41: error: expected ';' before '}' token 15 | if(400<=a.at(i) && a.at(i)<=799){b++} | ^ | ; a.cc:16:42: error: expected ';' before '}' token 16 | if(800<=a.at(i) && a.at(i)<=1199){c++} | ^ | ; a.cc:17:43: error: expected ';' before '}' token 17 | if(1200<=a.at(i) && a.at(i)<=1599){d++} | ^ | ; a.cc:18:43: error: expected ';' before '}' token 18 | if(1600<=a.at(i) && a.at(i)<=1999){e++} | ^ | ; a.cc:19:43: error: expected ';' before '}' token 19 | if(2000<=a.at(i) && a.at(i)<=2399){f++} | ^ | ; a.cc:20:43: error: expected ';' before '}' token 20 | if(2400<=a.at(i) && a.at(i)<=2799){g++} | ^ | ; a.cc:21:43: error: expected ';' before '}' token 21 | if(2800<=a.at(i) && a.at(i)<=3199){h++} | ^ | ; a.cc:22:26: error: expected ';' before '}' token 22 | if(3200<=a.at(i)){j++} | ^ | ;
s003732876
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); } int a,b,c,d,e,f,g,h,i; a=0; b=0; c=0; d=0; e=0; f=0; g=0; h=0; i=0; for(int i=0;i<N;i++){ if(a.at(i)<=399){a++;} if(400<=a.at(i) && a.at(i)<=799){b++} if(800<=a.at(i) && a.at(i)<=1199){c++} if(1200<=a.at(i) && a.at(i)<=1599){d++} if(1600<=a.at(i) && a.at(i)<=1999){e++} if(2000<=a.at(i) && a.at(i)<=2399){f++} if(2400<=a.at(i) && a.at(i)<=2799){g++} if(2800<=a.at(i) && a.at(i)<=3199){h++} if(3200<=a.at(i)){i++} } int A=0; if(a!=0){A++;} if(b!=0){A++;} if(c!=0){A++;} if(d!=0){A++;} if(e!=0){A++;} if(f!=0){A++;} if(g!=0){A++;} if(h!=0){A++;} cout << A << " "; if(i+A<=8){cout << i+A << endl;} else{cout << 8 << endl;} }
a.cc: In function 'int main()': a.cc:11:7: error: conflicting declaration 'int a' 11 | int a,b,c,d,e,f,g,h,i; | ^ a.cc:7:15: note: previous declaration as 'std::vector<int> a' 7 | vector<int> a(N); | ^ a.cc:12:5: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int') 12 | a=0; b=0; c=0; d=0; e=0; f=0; g=0; h=0; i=0; | ^ In file included from /usr/include/c++/14/vector:72, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' 210 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from 'int' to 'const std::vector<int>&' 211 | operator=(const vector<_Tp, _Alloc>& __x) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66: /usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:766:26: note: no known conversion for argument 1 from 'int' to 'std::vector<int>&&' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]' 788 | operator=(initializer_list<value_type> __l) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:788:46: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<int>' 788 | operator=(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ a.cc:14:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 14 | if(a.at(i)<=399){a++;} | ~^~ a.cc:15:41: error: expected ';' before '}' token 15 | if(400<=a.at(i) && a.at(i)<=799){b++} | ^ | ; a.cc:16:42: error: expected ';' before '}' token 16 | if(800<=a.at(i) && a.at(i)<=1199){c++} | ^ | ; a.cc:17:43: error: expected ';' before '}' token 17 | if(1200<=a.at(i) && a.at(i)<=1599){d++} | ^ | ; a.cc:18:43: error: expected ';' before '}' token 18 | if(1600<=a.at(i) && a.at(i)<=1999){e++} | ^ | ; a.cc:19:43: error: expected ';' before '}' token 19 | if(2000<=a.at(i) && a.at(i)<=2399){f++} | ^ | ; a.cc:20:43: error: expected ';' before '}' token 20 | if(2400<=a.at(i) && a.at(i)<=2799){g++} | ^ | ; a.cc:21:43: error: expected ';' before '}' token 21 | if(2800<=a.at(i) && a.at(i)<=3199){h++} | ^ | ; a.cc:22:26: error: expected ';' before '}' token 22 | if(3200<=a.at(i)){i++} | ^ | ; a.cc:25:7: error: no match for 'operator!=' (operand types are 'std::vector<int>' and 'int') 25 | if(a!=0){A++;} | ~^~~ | | | | | int | std::vector<int> In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181: /usr/include/c++/14/bits/regex.h:1132:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1132 | operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1132:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/regex.h:1212:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1212 | operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1212:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/regex.h:1305:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1305 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1305:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/regex.h:1379:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1379 | operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1379:5: note: template argument deduction/substitution failed: a.cc:25:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/regex.h:1473:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1473 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1473:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/regex.h:1547:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1547 | operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1547:5: note: template argument deduction/substitution failed: a.cc:25:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/regex.h:1647:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1647 | operator!=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1647:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/regex.h:2213:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator!=(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2213 | operator!=(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2213:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 25 | if(a!=0){A++;} | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'const std::pair<_T1, _T2>' 25 | if(a!=0){A++;} | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:25:9: note: 'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>' 25 | if(a!=0){A++;} | ^ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include
s637381420
p03695
C++
#include<iostream> using namespace std; int main(){ int N,a[10000],SUNADA=0,HIGASHINO=0,q=0,w=0,e=0,r=0,t=0,y=0,u=0,o=0,BaKA=0; cin>>N; for(int i=0;i<N;i++){ a[i]=0; cin>>a[i]; } for(int i=0;i<N;i++){ if(a[i]<=399&&q==0){ SUNADA+=1; HIGASHINO+=1; q+=1; } else if(a[i]/400==1&&w==0){ SUNADA+=1; HIGASHINO+=1; w+=1; } else if(a[i]/400==2&&e==0){ SUNADA+=1; HIGASHINO+=1; e+=1; } else if(a[i]/400==3&&r==0){ SUNADA+=1; HIGASHINO+=1; r+=1; } else if(a[i]/400==4&&t==0){ SUNADA+=1; HIGASHINO+=1; t+=1; } else if(a[i]/400==5&&y==0){ SUNADA+=1; HIGASHINO+=1; y+=1; } else if(a[i]/400==6&&u==0){ SUNADA+=1; HIGASHINO+=1; u+=1; } else if(a[i]/400==7&&o==0){ SUNADA+=1; HIGASHINO+=1; o+=1; } else if(a[i]>=3200&&BaKa==0){ HIGASHINO+=1; BaKa+=1; } else if(a[i]>=3200){ SUNADA+=1; } } cout<<HIGASHINO<<" "<<SUNADA<<endl; }
a.cc: In function 'int main()': a.cc:51:37: error: 'BaKa' was not declared in this scope; did you mean 'BaKA'? 51 | else if(a[i]>=3200&&BaKa==0){ | ^~~~ | BaKA
s084924499
p03695
C++
#include<iostream> using namespace std; int main(){ int N,a[10000],SUNADA=0,HIGASHINO=0,q=0,w=0,e=0,r=0,t=0,y=0,u=0,o=0,BaKA=0; cin>>N; for(int i=0;i<N;i++){ a[i]=0; cin>>a[i]; } for(int i=0;i<N;i++){ if(a[i]<=399&&q==0){ SUNADA+=1; HIGASHINO+=1; q+=1; } else if(a[i]/400==1&&w==0){ SUNADA+=1; HIGASHINO+=1; w+=1; } else if(a[i]/400==2&&e==0){ SUNADA+=1; HIGASHINO+=1; e+=1; } else if(a[i]/400==3&&r==0){ SUNADA+=1; HIGASHINO+=1; r+=1; } else if(a[i]/400==4&&t==0){ SUNADA+=1; HIGASHINO+=1; t+=1; } else if(a[i]/400==5&&y==0){ SUNADA+=1; HIGASHINO+=1; y+=1; } else if(a[i]/400==6&&u==0){ SUNADA+=1; HIGASHINO+=1; u+=1; } else if(a[i]/400==7&&o==0){ SUNADA+=1; HIGASHINO+=1; o+=1; } else if(a[i]>=3200&&BaKa==0){ HIGASHINO+=1; BaKa+=1; } else if(a[i]>=3200){ SUNADA+=1; } } cout<<HIGASHINO<<" "<<SUNADA<<endl; }
a.cc: In function 'int main()': a.cc:51:37: error: 'BaKa' was not declared in this scope; did you mean 'BaKA'? 51 | else if(a[i]>=3200&&BaKa==0){ | ^~~~ | BaKA
s941244360
p03695
C++
#include <cstdio> #define min(a, b) (a < b ? a : b) #define max(a, b) (a > b ? a : b) int main() { int no_of_contestants; scanf("%d", &no_of_contestants); const int NO_OF_COLOURS = 8, SPECIAL = 8; int frequency[NO_OF_COLOURS + 1] = {0}, special_colours = 0; while(no_of_contestants--) { int rating; scanf("%d", &rating); if(rating < 3200) frequency[colour/400]++; else special_colours++; } int normal_colours = 0; for(int i = 0; i < SPECIAL; i++) normal_colours += (frequency[i] > 0); int min_colours = (normal_colours == 0 ? 1 : normal_colours); int max_colours = normal_colours + special_colours; printf("%d %d", min_colours, max_colours); return 0; }
a.cc: In function 'int main()': a.cc:20:23: error: 'colour' was not declared in this scope 20 | frequency[colour/400]++; | ^~~~~~
s278263977
p03695
C++
#include <cstdio> #define min(a, b) (a < b ? a : b) #define max(a, b) (a > b ? a : b) int main() { int no_of_contestants; scanf("%d", &no_of_contestants); const int NO_OF_COLOURS = 8, SPECIAL = 8; int frequency[NO_OF_COLOURS + 1] = {0}, special_colours = 0; while(no_of_contestants--) { int rating; scanf("%d", &rating); if(rating < 3200) frequency[colour/400]++; else special_colours++; } int normal_colours = 0; for(int i = 0; i < SPECIAL; i++) normal_colours += (frequency[i] > 0); int min_colours = (normal_colours == 0 ? 1 : normal_colours); int max_colours = normal_colours + special_colours; printf("%d %d", min_colours, max_colours); return 0; }
a.cc: In function 'int main()': a.cc:20:23: error: 'colour' was not declared in this scope 20 | frequency[colour/400]++; | ^~~~~~
s599802614
p03695
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int userCount = sc.nextInt(); int free = 0; Set<Integer> colors = new HashSet<>(); for (int i = 0; i < userCount; i++) { int rate = sc.nextInt() / 400; if (7 < rate) { free++; } else { colors.add(rate); } } int hold = colors.size(); int min = 0; int max = 0; if (hold == 0) { if (0 < free) { min = 1; max = free <= 8 ? free : 8; } } else { min = hold; max = hold + free <= 8 ? hold + free : 8; } System.out.println(min + " " + max); } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:8: error: cannot find symbol Set<Integer> colors = new HashSet<>(); ^ symbol: class Set location: class Main Main.java:8: error: cannot find symbol Set<Integer> colors = new HashSet<>(); ^ symbol: class HashSet location: class Main 4 errors
s824433026
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int rate[9] = {1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200}; int color[9] = {}; for (int i = 0; i < N; i++) { int buf; cin >> buf; for (int j = 0; j < 8; j++) { if (rate[j] <= buf && buf < rate[j+1]) { color[j]++; } } if (rate[8] <= buf) { color[8]++; } } int min = 0; int max; for (int i = 0 ; i < 8; i++) { if (color[i] != 0) min++; } if (min == 0) { min = 1; if (color[8] <= 8) max = color[8]; else max = 8; } if (min + color[8] > 8 && min !=0) { max = 8; } else if { max = min + color[8]; } cout << min << " " << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:14: error: expected '(' before '{' token 37 | } else if { | ^ | (
s118125691
p03695
C++
#include <iostream> using namespace std; int main(void) { int N; cin >> N; int R[10] = { }; int high = 0; for(int i = 0; i < N; i++) { int r; cin >> r; if(r >= 3200) high++; else R[r / 400]++; } int cln = 0; for(int i = 0; i < 8; i++) { cln += (R[i] > 0); } if(cln == 0) cout << 1 << ' '; else cout << cln << ' '; cout << (high + cln) << endl return 0; }
a.cc: In function 'int main()': a.cc:26:31: error: expected ';' before 'return' 26 | cout << (high + cln) << endl | ^ | ; 27 | 28 | return 0; | ~~~~~~
s789643602
p03695
C++
#include<iostream> int main(){ int n,a[9],s; std::cin>>n; for(int i=0;i<n;i++){ int x; std::cin>>x; if(x>=3600){ x=3201; } if(a[(x-x%400)/400]==0){ s+=1; } a[x(x-x%400)/400]+=1; } std::cout<<s<<std::endl; if(s+a[8]<=8){ std::cout<<s+a[8]<<std::endl; } else{ std::cout<<8<<std::endl; } }
a.cc: In function 'int main()': a.cc:14:8: error: 'x' cannot be used as a function 14 | a[x(x-x%400)/400]+=1; | ~^~~~~~~~~
s179127812
p03695
C++
#include<iostream> int main(){ int n,a[9],s; std::cin>>n; for(int i=0;i<n;i+){ int x; std::cin>>x; if(x>=3600){ x=3200; } if(a[x/400]==0){ s+=1 } a[x/400]+=1; } std:cout<<s<<std::endl; if(s+a[8]<=8){ std::cout<<s+a[8]<<std::endl; } else{ std::cout<<8<<std::endl; } }
a.cc: In function 'int main()': a.cc:5:21: error: expected primary-expression before ')' token 5 | for(int i=0;i<n;i+){ | ^ a.cc:12:11: error: expected ';' before '}' token 12 | s+=1 | ^ | ; 13 | } | ~ a.cc:16:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 16 | std:cout<<s<<std::endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s248014285
p03695
C++
#include <iostream> using namespace std; int main() { int hist[9] = {0}; int N; cin >> N; for(int i = 0; i < N; i++) { int a; cin >> a; if(1 <= a && a < 400) hist[0]++; if(400 <= a && a < 800) hist[1]++; if(800 <= a && a < 1200) hist[2]++; if(1200 <= a && a <1600) hist[3]++; if(1600 <= a && a < 2000) hist[4]++; if(2000 <= a && a < 2400) hist[5]++; if(2400 <= a && a < 2800) hist[6]++; if(2800 <= a && a < 3200) hist[7]++; if(3200 <= a) hist[8]++; } int sum = 0; for(int i = 0; i < 8; i++) { sum += (hist[i] > 0); } int sum2; int tmp = 8 - sum; if(tmp > hist[8]) { if(sum == 0) sum = hist[8]; sum2 = sum + hist[8]; else { if(sum == 0) sum = tmp; sum2 = sum + 8; } cout << sum << ' ' << sum2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:34:9: error: expected '}' before 'else' 34 | else { | ^~~~ a.cc:31:27: note: to match this '{' 31 | if(tmp > hist[8]) { | ^
s340898880
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, a[100], c[8] = {}, p = 0, ans; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &n); if (a >= 3200) p++; else c[a / 400] = 1; } ans = count(c, c + 8, 1); printf("%d %d\n", max(1, ans), ans + p); return 0; }
a.cc: In function 'int main()': a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if (a >= 3200) | ~~^~~~~~~ a.cc:13:11: error: invalid operands of types 'int [100]' and 'int' to binary 'operator/' 13 | c[a / 400] = 1; | ~ ^ ~~~ | | | | | int | int [100]
s887150216
p03695
C++
#include<iostream> #include<string> #include<algorithm> #include<utility> #include<cmath> #include<vector> #include<climits> #define ll long long int using namespace std; int main(void) { int n; cin>>n; int c[8]={0}; int o=0; int a=0; for(int i=0; i<n; i++) { int x; cin>>x; if(x>=3200) o++; if(c[x/400]==0) { a++; c[x/400]=1; } } if(a==0) cout<<1<<<" "<<o<<endl; else cout<<a<<" "<<a+o<<endl; return 0; }
a.cc: In function 'int main()': a.cc:25:21: error: expected primary-expression before '<' token 25 | if(a==0) cout<<1<<<" "<<o<<endl; | ^ a.cc:25:25: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<' 25 | if(a==0) cout<<1<<<" "<<o<<endl; | ~~~^~~ | | | | | int | const char [2]
s271053715
p03695
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<climits> #include<map> #include<set> #include<queue> #include<stack> #include<bitset> #include<iomanip> #include<deque> using namespace std; #define rep(i,j,n) for(int i=(j);i<(n);i++) #define rep2(i,j,n) for(int i=(j);i<=(n);i++) #define all(i) i.begin(),i.end() typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<string> vs; typedef vector<vector<string>> vvs; typedef pair<int, int> pi; typedef long long i64; int main() { int n; cin >> n; vi a(n); int x = 0; set<int> st; rep(i, 0, n) { cin >> a[i]; if (1 <= a[i] && a[i] < 400) { st.insert(1); } else if (400 <= a[i] && a[i] < 800) { st.insert(2); } else if (800 <= a[i] && a[i] < 1200) { st.insert(3); } else if (1200 <= a[i] && a[i] < 1600) { st.insert(4); } else if (1600 <= a[i] && a[i] < 2000) { st.insert(5); } else if (2000 <= a[i] && a[i] < 2400) { st.insert(6); } else if (2400 <= a[i] && a[i] < 2800) { st.insert(7); } else if (2800 <= a[i] && a[i] < 3200) { st.insert(8); } else { x++; } } int min = st.size(); if (min == 0) { min++; } int max = st.size() + x; cout << min << " " << max << endl; return 0: }
a.cc: In function 'int main()': a.cc:69:17: error: expected ';' before ':' token 69 | return 0: | ^ | ; a.cc:69:17: error: expected primary-expression before ':' token
s394445565
p03695
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) int main(void){ ll n,a; cin>>n; vector<ll> v; rep(i,0,n){ cin>>a; if(a<3200)v.at(a/400)=1; else v.at(8)++; } rep(i,1,8)v.at(0)+=v.at(i); cout<<max(v.at(0),(ll)1)<<' '<<min(v.at(0)+v.at(8))<<endl; }
a.cc: In function 'int main()': a.cc:15:39: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 15 | cout<<max(v.at(0),(ll)1)<<' '<<min(v.at(0)+v.at(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: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:15:39: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 15 | cout<<max(v.at(0),(ll)1)<<' '<<min(v.at(0)+v.at(8))<<endl; | ~~~^~~~~~~~~~~~~~~~~ /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
s208843932
p03695
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) int main(void){ ll n,a; cin>>n; vector<ll> v; rep(i,0,n){ cin>>a; if(a<3200)v.at(a/400)=1; else v.at(8)++; } rep(i,1,9)v.at(0)+=v.at(i); cout<<min(v.at(0),9) }
a.cc: In function 'int main()': a.cc:15:14: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, int)' 15 | cout<<min(v.at(0),9) | ~~~^~~~~~~~~~~ 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:15:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 15 | cout<<min(v.at(0),9) | ~~~^~~~~~~~~~~ /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:15:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 15 | cout<<min(v.at(0),9) | ~~~^~~~~~~~~~~
s039834736
p03695
C++
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main(){ int n; cin >> n; vector<int> a(n); vector<int> b(9); for(int i = 0; i < n; i++){ cin >> a.at(i); if(a.at(i) < 400){ b.at(0)++; }else if(a.at(i) >= 400 && a.at(i) < 800){ b.at(1)++; }else if(a.at(i) >= 800 && a.at(i) < 1200){ b.at(2)++; }else if(a.at(i) >= 1200 && a.at(i) < 1600){ b.at(3)++; }else if(a.at(i) >= 1600 && a.at(i) < 2000){ b.at(4)++; }else if(a.at(i) >= 2000 && a.at(i) < 2400){ b.at(5)++; }else if(a.at(i) >= 2400 && a.at(i) < 2800){ b.at(6)++; }else if(a.at(i) >= 2800 && a.at(i) < 3200){ b.at(7)++; }else if(a.at(i) >= 3200){ b.at(8)++; } } int c = 0; for(int i = 0; i < 9; i++){ if(b.at(i) >= 1){ c++; } } int comin, comax; if(b.at(8) == 0){ comin = c; comax = c; }else(b.at(8) >= 1){ if(c == 0){ comin = 1; comax = min(8, b.at(8)); }else{ comin = c; comax = min(8, c+b.at(8)); } } cout << comin << " " << comax << endl; }
a.cc: In function 'int main()': a.cc:42:22: error: expected ';' before '{' token 42 | }else(b.at(8) >= 1){ | ^ | ;
s644977314
p03695
C++
#include <iostream> #include <stdlib.h> using namespace std; int main(){ int n; int c; int k; bool ra[8]; cin >> n; for(int i=0;i<n;i++){ int s; s << cin; int r = (s-1)/400; if(r >= 8){ k+=1; }else{ if(!ra[r]){ ra[r] = true; c++; } } } cout << k << max(8,c + k); return 0; }
a.cc: In function 'int main()': a.cc:12:19: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::basic_istream<char>'}) 12 | s << cin; | ~ ^~ ~~~ | | | | int std::istream {aka std::basic_istream<char>} a.cc:12:19: note: candidate: 'operator<<(int, int)' (built-in) 12 | s << cin; | ~~^~~~~~ a.cc:12:19: note: no known conversion for argument 2 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, 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/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 12 | s << cin; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:12:17: note: cannot convert 's' (type 'int') to type 'std::byte' 12 | s << cin; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 12 | s << cin; | ^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:12:22: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = int&; _Tp = std::basic_istream<char>]': a.cc:12:8: required from here 12 | s << cin; | ^~~ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s292527486
p03695
C++
N = int(input()) a = list(map(lambda x : int(x) // 400, input().split())) over3200 = sum(list(map(lambda x: 1 if x >= 8 else 0, a))) count = 0 for i in range(8): if i in a: count += 1 print(max(1, count), count+over3200)
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s068512780
p03695
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); Set<String> s = new HashSet<String>(); int counter = 0; for(int i = 0;i < N;i++){ int a = sc.nextInt(); if(a < 400)s.add("a"); else if(a < 800)s.add("b"); else if(a < 1200)s.add("c"); else if(a < 1600)s.add("d"); else if(a < 2000)s.add("e"); else if(a < 2400)s.add("f"); else if(a < 2800)s.add("g"); else if(a < 3200)s.add("h"); else if(a >= 3200)counter++; } if(s.size == 0){ System.out.println("1"); } else{ System.out.print(s.size() > 8 ? "8" : s.size()); } System.out.print(" "); System.out.println(s.size() + counter > 8 ? "8" : s.size() + counter); }}
Main.java:20: error: cannot find symbol if(s.size == 0){ ^ symbol: variable size location: variable s of type Set<String> 1 error
s624640716
p03695
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int n; int min, max; int a[122]; int res[122]; bool flg[122]; int main() { while(~scanf("%d",&n)) { memset(flg,0,sizeof(flg)); int cnt = 0; for(int i=1; i<=n;i++) scanf("%d", &a[i]); for(int i=1;i<=n;i++) { if(a[i]>=1 && a[i] <= 399) res[i]=1; else if(a[i] >=400 && a[i] <= 799) res[i]=2; else if(a[i] >=800 && a[i] <=1199) res[i]=3; else if(a[i] >= 1200 && a[i] <= 1599) res[i]=4; else if(a[i] >= 1600 && a[i] <= 1999) res[i]=5; else if(a[i] >= 2000 && a[i] <= 2399) res[i]=6; else if(a[i] >= 2400 && a[i] <= 2799) res[i]=7; else if(a[i] >= 2800 && a[i] <= 3199) res[i]=8; } for(int i=1; i <=n; i++){ if(flg[res[i]] == 0) { flg[res[i]] =1; cnt++; } } min=cnt; int t=0; for(int i=1; i <= n; i++){ if(a[i] >= 3200) t++; } max=cnt + t; printf("%d %d\n",min, max); } }
a.cc: In function 'int main()': a.cc:33:1: error: reference to 'min' is ambiguous 33 | min=cnt; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from a.cc:4: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:38:1: error: reference to 'max' is ambiguous 38 | max=cnt + t; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~ a.cc:39:18: error: reference to 'min' is ambiguous 39 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:39:23: error: reference to 'max' is ambiguous 39 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~
s537873509
p03695
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int n; int min, max; int a[122]; int res[122]; bool flg[122]; int main() { while(~scanf("%d",&n)) { int cnt = 0; for(int i=1; i<=n;i++) scanf("%d", &a[i]); for(int i=1;i<=n;i++) { if(a[i]>=1 && a[i] <= 399) res[i]=1; else if(a[i] >=400 && a[i] <= 799) res[i]=2; else if(a[i] >=800 && a[i] <=1199) res[i]=3; else if(a[i] >= 1200 && a[i] <= 1599) res[i]=4; else if(a[i] >= 1600 && a[i] <= 1999) res[i]=5; else if(a[i] >= 2000 && a[i] <= 2399) res[i]=6; else if(a[i] >= 2400 && a[i] <= 2799) res[i]=7; else if(a[i] >= 2800 && a[i] <= 3199) res[i]=8; } for(int i=1; i <=n; i++){ if(!flg[res[i]]) { flg[res[i]] =1; cnt++; } } min=cnt; int t=0; for(int i=1; i <= n; i++){ if(a[i] >= 3200) t++; } max=min + t; printf("%d %d\n",min, max); } }
a.cc: In function 'int main()': a.cc:32:1: error: reference to 'min' is ambiguous 32 | min=cnt; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from a.cc:4: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:37:1: error: reference to 'max' is ambiguous 37 | max=min + t; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~ a.cc:37:5: error: reference to 'min' is ambiguous 37 | max=min + t; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:38:18: error: reference to 'min' is ambiguous 38 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:38:23: error: reference to 'max' is ambiguous 38 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~
s380157475
p03695
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int n; int min, max; int a[122]; int res[122]; bool flg[20]; int main() { while(~scanf("%d",&n)) { int cnt = 0; for(int i=1; i<=n;i++) scanf("%d", &a[i]); for(int i=1;i<=n;i++) { if(a[i]>=1 && a[i] <= 399) res[a[i]]=1; else if(a[i] >=400 && a[i] <= 799) res[a[i]]=2; else if(a[i] >=800 && a[i] <=1199) res[a[i]]=3; else if(a[i] >= 1200 && a[i] <= 1599) res[a[i]]=4; else if(a[i] >= 1600 && a[i] <= 1999) res[a[i]]=5; else if(a[i] >= 2000 && a[i] <= 2399) res[a[i]]=6; else if(a[i] >= 2400 && a[i] <= 2799) res[a[i]]=7; else if(a[i] >= 2800 && a[i] <= 3199) res[a[i]]=8; } for(int i=1; i <=n; i++){ if(!flg[res[a[i]]]) { flg[res[a[i]]] =1; cnt++; } } min=cnt; int t=0; for(int i=1; i <= n; i++){ if(a[i] >= 3200) t++; } max=min + t; printf("%d %d\n",min, max); } }
a.cc: In function 'int main()': a.cc:32:1: error: reference to 'min' is ambiguous 32 | min=cnt; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from a.cc:4: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:37:1: error: reference to 'max' is ambiguous 37 | max=min + t; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~ a.cc:37:5: error: reference to 'min' is ambiguous 37 | max=min + t; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:38:18: error: reference to 'min' is ambiguous 38 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:38:23: error: reference to 'max' is ambiguous 38 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~
s678865675
p03695
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int n; int min, max; int a[122]; int res[122]; bool flg[20]; int main() { while(~scanf("%d",&n)) { int cnt = 0; for(int i=1; i<=n;i++) scanf("%d", &a[i]); for(int i=1;i<=n;i++) { if(a[i]>=1 && a[i] <= 399) res[a[i]]=1; else if(a[i] >=400 && a[i] <= 799) res[a[i]]=2; else if(a[i] >=800 && a[i] <=1199) res[a[i]]=3; else if(a[i] >= 1200 && a[i] <= 1599) res[a[i]]=4; else if(a[i] >= 1600 && a[i] <= 1999) res[a[i]]=5; else if(a[i] >= 2000 && a[i] <= 2399) res[a[i]]=6; else if(a[i] >= 2400 && a[i] <= 2799) res[a[i]]=7; else if(a[i] >= 2800 && a[i] <= 3199) res[a[i]]=8; } for(int i=1; i <=n; i++){ if(!flag[res[a[i]]]) { flag[res[a[i]]] =1; cnt++; } } min=cnt; int t=0; for(int i=1; i <= n; i++){ if(a[i] >= 3200) t++; } max=min + t; printf("%d %d\n",min, max); } }
a.cc: In function 'int main()': a.cc:27:5: error: 'flag' was not declared in this scope; did you mean 'flg'? 27 | if(!flag[res[a[i]]]) { | ^~~~ | flg a.cc:32:1: error: reference to 'min' is ambiguous 32 | min=cnt; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from a.cc:4: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:37:1: error: reference to 'max' is ambiguous 37 | max=min + t; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~ a.cc:37:5: error: reference to 'min' is ambiguous 37 | max=min + t; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:38:18: error: reference to 'min' is ambiguous 38 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:5: note: 'int min' 8 | int min, max; | ^~~ a.cc:38:23: error: reference to 'max' is ambiguous 38 | printf("%d %d\n",min, max); | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:8:10: note: 'int max' 8 | int min, max; | ^~~
s645983484
p03695
C++
n=int(input()) a=[int(i) for i in input().split()] num=[0 for i in range(14)] for rate in a: num[int(rate/400)]+=1 ans=0 for i in range(8): if num[i]>0: ans+=1 over=0 for i in range(8,14): over+=num[i] print(max(ans,1),end="") print(" ",end="") print(min(ans+over,8))
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^
s378812407
p03695
C++
#include<iostream> #include<vector> #include<algorithm> #define REP(n) for(int i = 0;i < n;i++) using namespace std; int main(){ int n; cin >> n; vector<bool> a(12,0); int tmp = 0; int count = 0; REP(n){ cin >> tmp; if(tmp >=3200){ count++; } a[tmp/400] = true;z } int color_count = 0; REP(8){ if(a[i] == true){ color_count++; } } int mini = (color_count != 0) ? color_count : 1; int maxi = color_count+count; cout << mini << " " << maxi << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:27: error: 'z' was not declared in this scope 20 | a[tmp/400] = true;z | ^
s351629589
p03695
C++
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair<int, int> P; typedef pair<ll, P> E; #define cost first #define from second.first #define to second.second #define MOD (1000000007ll) #define l_ength size void mul_mod(ll& a, ll b){ a *= b; a %= MOD; } int main(void){ int n,a,his[9],i,ans=0; fill(h,h+9,0); for(i=0; i<n; ++i){ cin >> a; his[min(3200,a)/400]++; } for(i=0; i<8; i++){ if(his[i]){ ans++; } } cout << ans << " " << (ans+his[8]) << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:14: error: 'h' was not declared in this scope 21 | fill(h,h+9,0); | ^
s158233056
p03695
C++
// finish date: 2018/01/22 #include <iostream> #include <cmath> #include <vector> #include <bitset> #include <algorithm> #include <stack> #include <map> #include <climits> using namespace std; #define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++) #define rep(i, n) FOR(i,0,n) #define ll long long #define bigmod 1000000007 #define INF 500000000 int main() { int N; cin >> N; map<int, int> mp; int a; rep(i, N) { cin >> a; mp[min(8, a / 400)]++; } int mi, ma; mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); ma = min(mi + mp[8], 8); cout << mi << " " << ma << endl; return 0; }
a.cc: In function 'int main()': a.cc:30:13: error: no matching function for call to 'max(int, std::map<int, int>::size_type)' 30 | mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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: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:30:13: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'}) 30 | mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /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:30:13: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 30 | mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s630116629
p03695
C++
// finish date: 2018/01/22 #include <iostream> #include <cmath> #include <vector> #include <bitset> #include <algorithm> #include <stack> #include <map> #include <climits> using namespace std; #define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++) #define rep(i, n) FOR(i,0,n) #define ll long long #define bigmod 1000000007 #define INF 500000000 int main() { int N; cin >> N; map<int, int> mp; int a; rep(i, N) { cin >> a; mp[min(8, a / 400)]++; } int mi, ma; mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); ma = min(mi + mp[8], 8); cout << mi << " " << ma << endl; return 0; }
a.cc: In function 'int main()': a.cc:30:13: error: no matching function for call to 'max(int, std::map<int, int>::size_type)' 30 | mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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: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:30:13: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'}) 30 | mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /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:30:13: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 30 | mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s429670535
p03695
C++
// g++ macro.cpp -std=c++14 #include <bits/stdc++.h> //STL include typedef long long ll;// long long int const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; using namespace std;//namespace #define dump(x) cout << #x << " = " << (x) << endl;// debug cout #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl; #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl; #define SANKOU(n,a,b) cout << ((n) ? (a) : (b) ) << endl; #define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro #define REP(i,n) for(int i=0;i<(n);++i) #define REPR(i,n) for(int i=n;i>=0;i--) #define FOREACH(x,a) for(auto& (x) : (a) ) #define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);// warshall-floyd #define CIN(x) int x;cin>>x; #define CIN2(x,y) int x,y;cin>>x>>y; #define CIN3(x,y,z) int x,y,z;cin>>x>>y>>z; #define SCIN(x) string x;cin>>x; #define SCIN2(x,y) string x,y;cin>>x>>y; #define COUT(x) cout<<(x)<<endl; #define SCOUT(x) cout<<(x)<<" "; #define ENDL cout<<endl; #define VECCIN(x) for(auto&youso_: (x) )cin>>youso_; #define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]; #define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl; #define ALL(obj) (obj).begin(),(obj).end()// iterator #define EXIST(n,x) (find(ALL(n),x)!=n.end()) #define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end()) #define P pair<int,int> #define V vector<int> #define M map<int,int> #define S set<int> #define L list<int> #define pb(a) push_back(a)//push_back #define mp make_pair// make_pair int main(){ CIN(n);V a(n);VECCIN(a); set<int> s; int flag=0; FOREACH(x,a){ if(x<400)s.insert(0); else if(x<800)s.insert(1); else if(x<1200)s.insert(2); else if(x<1600)s.insert(3); else if(x<2000)s.insert(4); else if(x<2400)s.insert(5); else if(x<2800)s.insert(6); else if(x<3200)s.insert(7); else flag++; } SCOUT(max(1,(int)s.size())); COUT(min((int)s.size()+flag)); return 0; }
a.cc: In function 'int main()': a.cc:70:13: error: no matching function for call to 'min(int)' 70 | COUT(min((int)s.size()+flag)); | ~~~^~~~~~~~~~~~~~~~~~~~ a.cc:28:24: note: in definition of macro 'COUT' 28 | #define COUT(x) cout<<(x)<<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: 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:70:13: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 70 | COUT(min((int)s.size()+flag)); | ~~~^~~~~~~~~~~~~~~~~~~~ a.cc:28:24: note: in definition of macro 'COUT' 28 | #define COUT(x) cout<<(x)<<endl; | ^ /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
s240049424
p03695
C++
#include<bits/stdc++.h> using namespace std; bool f[10]; int main(){ int n,cnt=0,ans=0; int a; cin>>n; for(int i=0;i<n;i++){ cin>>a; if(1<=a&&a<=399)f[0]=1; else if(a<800)f[1]=1; else if(a<1200)f[2]=1; else if(a<1600)f[3]=1; else if(a<2000)f[4]=1; else if(a<2400)f[5]=1; else if(a<2800)f[6]=1; else if(a<3200)f[7]=1; else cnt++; } for(int i=0;i<8;i++)ans+=f[i]; if(ans==0)cout<<1<<' '; else cout<<ans<<' '; else cout<<ans+cnt<<endl; return(0); }
a.cc: In function 'int main()': a.cc:23:3: error: 'else' without a previous 'if' 23 | else cout<<ans+cnt<<endl; | ^~~~
s982404498
p03695
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define YES(i) cout<<(i?"YES":"NO")<<endl #define Yes(i) cout<<(i?"Yes":"No")<<endl #define MOD 1000000007 #define INF 1000000007 using namespace std; // int main(){ int N; int cnt=0; set<int> S; cin>>N; FOR(i,0,N){ int A; cin>>A; if(A>=3200){ cnt++; continue; } int B=A/400; S.insert(B); } cout<<max(S.size(),1)<<" "<<S.size()+cnt<<endl; return 0; }
a.cc: In function 'int main()': a.cc:40:12: error: no matching function for call to 'max(std::set<int>::size_type, int)' 40 | cout<<max(S.size(),1)<<" "<<S.size()+cnt<<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:40:12: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 40 | cout<<max(S.size(),1)<<" "<<S.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, from a.cc:3: /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:40:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 40 | cout<<max(S.size(),1)<<" "<<S.size()+cnt<<endl; | ~~~^~~~~~~~~~~~
s655573509
p03695
C++
#include<cstdio> #include<algorithm> #include<vector> using namespace std; int main(){ int n; scanf("%d", &n); int f[8] = {}, c = 0; for(int i = 0; i < n; i++){ int a; scanf("%d", &a); if(a >= 3200) c++; else f[a / 400] = 1; } printf("%d %d\n", max(1, count(f, f + 8, 1)), min(8, count(f, f + 8, 1) + c)); return 0; }
a.cc: In function 'int main()': a.cc:15:30: error: no matching function for call to 'max(int, std::iterator_traits<int*>::difference_type)' 15 | printf("%d %d\n", max(1, count(f, f + 8, 1)), min(8, count(f, f + 8, 1) + c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, 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:15:30: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::iterator_traits<int*>::difference_type' {aka 'long int'}) 15 | printf("%d %d\n", max(1, count(f, f + 8, 1)), min(8, count(f, f + 8, 1) + c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ /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:15:30: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 15 | printf("%d %d\n", max(1, count(f, f + 8, 1)), min(8, count(f, f + 8, 1) + c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ a.cc:15:58: error: no matching function for call to 'min(int, std::iterator_traits<int*>::difference_type)' 15 | printf("%d %d\n", max(1, count(f, f + 8, 1)), min(8, count(f, f + 8, 1) + c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /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:15:58: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::iterator_traits<int*>::difference_type' {aka 'long int'}) 15 | printf("%d %d\n", max(1, count(f, f + 8, 1)), min(8, count(f, f + 8, 1) + c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /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:15:58: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 15 | printf("%d %d\n", max(1, count(f, f + 8, 1)), min(8, count(f, f + 8, 1) + c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
s106186877
p03695
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> #include<set> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<<endl; #define p(p) cout<<(p)<<" "; #define pb push_back #define mp make_pair #define INF 1<<25 typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pi; typedef long long ll; //int dy[8]={1,1,1,0,0,-1,-1,-1}; //int dx[8]={-1,0,1,-1,1,-1,0,1}; int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; struct S{ int a,b,c; }; bool asc(const S& left,const S& right){ return left.c > right.c; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin>>N; vi a(N),color(8,0); int r=0; rep(i,N){ cin>>a[i]; 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 r++; } int cnt=0; rep(i,8){ if(color[i]>0)cnt++; } if(cnt!=0) p(cnt)P(cnt+r); else p("1")P(cnt+r); return 0; }
a.cc: In function 'int main()': a.cc:75:9: error: 'else' without a previous 'if' 75 | else | ^~~~
s197497163
p03695
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> #include<set> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<<endl; #define p(p) cout<<(p)<<" "; #define pb push_back #define mp make_pair #define INF 1<<25 typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pi; typedef long long ll; //int dy[8]={1,1,1,0,0,-1,-1,-1}; //int dx[8]={-1,0,1,-1,1,-1,0,1}; int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; struct S{ int a,b,c; }; bool asc(const S& left,const S& right){ return left.c > right.c; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin>>N; vi a(N),color(8,0); int r=0; rep(i,N){ cin>>a[i]; 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 r++; } int cnt=0; rep(i,8){ if(color[i]>0)cnt++; } if(cnt!=0) p(cnt)P(cnt+r); else p(1)P(cnt+r); return 0; }
a.cc: In function 'int main()': a.cc:75:9: error: 'else' without a previous 'if' 75 | else | ^~~~
s803441818
p03695
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void) { int n; cin >> n; vector<bool> a(8, 0); int count = 0; for (int i = 0; i < n; i++) { int b; cin >> b; if (b <= 399) { a[0] = 1; } else if (b <= 799) { a[1] = 1; } else if (b <= 1199) { a[2] = 1; } else if (b <= 1599) { a[3] = 1; } else if (b <= 1999) { a[4] = 1; } else if (b <= 2399) { a[5] = 1; } else if (b <= 2799) { a[6] = 1; } else if (b <= 3199) { a[7] = 1; } else { count++; } } int c = a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7]; cout << max(c, count > 0) << " "; cout << c + count << endl; return 0; }
a.cc: In function 'int main()': a.cc:34:14: error: no matching function for call to 'max(int&, bool)' 34 | cout << max(c, count > 0) << " "; | ~~~^~~~~~~~~~~~~~ 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:34:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'bool') 34 | cout << max(c, count > 0) << " "; | ~~~^~~~~~~~~~~~~~ /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:3: /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(c, count > 0) << " "; | ~~~^~~~~~~~~~~~~~
s068303436
p03695
C++
#include <iostream> #include <vector> using namespace std; int main(void) { int n; cin >> n; vector<bool> a(8, 0); int count = 0; for (int i = 0; i < n; i++) { int b; cin >> b; if (b <= 399) { a[0] = 1; } else if (b <= 799) { a[1] = 1; } else if (b <= 1199) { a[2] = 1; } else if (b <= 1599) { a[3] = 1; } else if (b <= 1999) { a[4] = 1; } else if (b <= 2399) { a[5] = 1; } else if (b <= 2799) { a[6] = 1; } else if (b <= 3199) { a[7] = 1; } else { count++; } } int c = a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7]; cout << max(c, count > 0) << " "; cout << c + count << endl; return 0; }
a.cc: In function 'int main()': a.cc:33:14: error: no matching function for call to 'max(int&, bool)' 33 | cout << max(c, count > 0) << " "; | ~~~^~~~~~~~~~~~~~ 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:33:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'bool') 33 | cout << max(c, count > 0) << " "; | ~~~^~~~~~~~~~~~~~ /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
s898642468
p03695
C++
#include<iostream> using namespace std; int n, buf, emp = 0, p = 0; int color[9] = {0,0,0,0,0,0,0,0,0}; int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> buf; if(buf < 400){ color[0]++; }else if(buf < 800){ color[1]++; }else if(buf < 1200){ color[2]++; }else if(buf < 1600){ color[3]++; }else if(buf < 2000){ color[4]++; }else if(buf < 2400){ color[5]++; }else if(buf < 2800){ color[6]++; }else if(buf < 3200){ color[7]++; }else{ color[8]++; } } for(int j = 0; j < 8; j++){ if(color[j] == 0){ emp++; } } if(emp == 8) p = 1; if(color[8] == 0){ cout << 8 - emp << " " << 8 - emp << endl; }else(color[8] < emp){ cout << 8 - emp + p << " " << 8 - emp + color[8] << endl; } }
a.cc: In function 'int main()': a.cc:39:26: error: expected ';' before '{' token 39 | }else(color[8] < emp){ | ^ | ;
s190826535
p03695
Java
import static java.lang.System.out; import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String[]aa){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] numarray = new int[N]; for(int i=0;i<N;i++){ numarray[i] =sc.nextInt(); } int[] countarray = new int[8]; int over = 0; for(int i=0;i<N;i++){ int target = numarray[i]; int j = target<400 ? 0: target< 800 ? 1: target<1200 ? 2: target<1600 ? 3: target<2000 ? 4: target<2400 ? 5: target<2800 ? 6: target<3200 ? 7: 10; if(j ==10){ over++; }else{ countarray[j] =1; } } int count=0; for(int i:countarray){ count+= i; } if(count!=0){ out.print(count +" "); }else{ out.print(over + " "); } out.print(Math.min(8,count+over)); }
Main.java:42: error: reached end of file while parsing } ^ 1 error
s582434886
p03695
C++
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define rep(i,n) for(int i=0;i<=(n);++i) #define ALL(v) (v).begin(),(v).end() typedef long long ll; typedef pair<ll, int> P; int n; bool c[8]; int cnt; int main(){ cin.tie(0); ios::sync_with_stdio(false); REP(i,8) c[i]=false; cin>>n; REP(i,n) { int a; cin>>a; if(a<400) c[0]=true; else if(a<800) c[1]=true; else if(a<1200) c[2]=true; else if(a<1600) c[3]=true; else if(a<2000) c[4]=true; else if(a<2400) c[5]=true; else if(a<2800) c[6]=true; else if(a<3200) c[7]=true; else cnt++; } int sum=0; REP(i,8) { sum+=(c[i]?1:0); } cout<<(sum?sum:"1")<<' '<<sum+cnt<<endl; return 0; }
a.cc: In function 'int main()': a.cc:42:19: error: operands to '?:' have different types 'int' and 'const char*' 42 | cout<<(sum?sum:"1")<<' '<<sum+cnt<<endl; | ~~~^~~~~~~~
s122171731
p03695
C++
g#include <bits/stdc++.h> #define REP(i, n) for(int i = 0; i < (int)(n); ++i) #define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i) #define ALL(x) (x).begin(), (x).end() #define INF 2000000000 #ifdef LOCAL #define eprintf(...) fprintf(stdout, __VA_ARGS__) #else #define eprintf(...) 0 #endif using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef unsigned int uint; int main() { int n; cin >> n; vector<int> v(9, 0); int a; REP(i, n) { cin >> a; if(a <= 399) v[0]++; else if(a <= 799) v[1]++; else if(a <= 1199) v[2]++; else if(a <= 1599) v[3]++; else if(a <= 1999) v[4]++; else if(a <= 2399) v[5]++; else if(a <= 2799) v[6]++; else if(a <= 3199) v[7]++; else v[8]++; } int colors = 0; int zero = 0; REP(i, v.size()-1) { if(v[i] > 0) colors++; else zero++; } int free = v[8]; int maxc = colors + min(zero, free); int minc = colors == 0 ? 1 : colors; eprintf("col,zero,free:%d,%d,%d\n", colors,zero,free); printf("%d %d\n", minc, maxc); return 0; }
a.cc:1:2: error: stray '#' in program 1 | g#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'g' does not name a type 1 | g#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:22:3: error: 'cin' was not declared in this scope 22 | cin >> n; | ^~~ a.cc:23:3: error: 'vector' was not declared in this scope 23 | vector<int> v(9, 0); | ^~~~~~ a.cc:23:10: error: expected primary-expression before 'int' 23 | vector<int> v(9, 0); | ^~~ a.cc:27:18: error: 'v' was not declared in this scope 27 | if(a <= 399) v[0]++; | ^ a.cc:28:23: error: 'v' was not declared in this scope 28 | else if(a <= 799) v[1]++; | ^ a.cc:29:24: error: 'v' was not declared in this scope 29 | else if(a <= 1199) v[2]++; | ^ a.cc:30:24: error: 'v' was not declared in this scope 30 | else if(a <= 1599) v[3]++; | ^ a.cc:31:24: error: 'v' was not declared in this scope 31 | else if(a <= 1999) v[4]++; | ^ a.cc:32:24: error: 'v' was not declared in this scope 32 | else if(a <= 2399) v[5]++; | ^ a.cc:33:24: error: 'v' was not declared in this scope 33 | else if(a <= 2799) v[6]++; | ^ a.cc:34:24: error: 'v' was not declared in this scope 34 | else if(a <= 3199) v[7]++; | ^ a.cc:35:10: error: 'v' was not declared in this scope 35 | else v[8]++; | ^ a.cc:40:10: error: 'v' was not declared in this scope 40 | REP(i, v.size()-1) { | ^ a.cc:3:44: note: in definition of macro 'REP' 3 | #define REP(i, n) for(int i = 0; i < (int)(n); ++i) | ^ a.cc:44:14: error: 'v' was not declared in this scope 44 | int free = v[8]; | ^ a.cc:45:23: error: 'min' was not declared in this scope; did you mean 'main'? 45 | int maxc = colors + min(zero, free); | ^~~ | main a.cc:49:3: error: 'printf' was not declared in this scope 49 | printf("%d %d\n", minc, maxc); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | g#include <bits/stdc++.h>
s761082291
p03695
C++
int his[9]={}; int main(int argc , char **argv) { (void)argc; (void)argv; int N; cin >> N; for(int i=1;i<=N;i++){ int a; cin >> a; int c = a/400; if (3200 <= a){c = 8;} his[c]++; } int cc=0; for(int i=0;i<=7;i++){ if( 0<his[i] ){cc++;} } printf("%d %d\n",max(1,cc),cc+his[8]); return 0; }
a.cc: In function 'int main(int, char**)': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin >> N; | ^~~ a.cc:22:26: error: 'max' was not declared in this scope 22 | printf("%d %d\n",max(1,cc),cc+his[8]); | ^~~ a.cc:22:9: error: 'printf' was not declared in this scope 22 | printf("%d %d\n",max(1,cc),cc+his[8]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int his[9]={};
s482787963
p03695
C++
if(color[i]) x++; cout<<x<<" "; int m = min(8,x+over); cout<<m<<endl; return 0; }
a.cc:1:9: error: expected unqualified-id before 'if' 1 | if(color[i]) | ^~ a.cc:4:5: error: 'cout' does not name a type 4 | cout<<x<<" "; | ^~~~ a.cc:5:19: error: 'x' was not declared in this scope 5 | int m = min(8,x+over); | ^ a.cc:5:21: error: 'over' was not declared in this scope 5 | int m = min(8,x+over); | ^~~~ a.cc:5:13: error: 'min' was not declared in this scope 5 | int m = min(8,x+over); | ^~~ a.cc:6:5: error: 'cout' does not name a type 6 | cout<<m<<endl; | ^~~~ a.cc:8:5: error: expected unqualified-id before 'return' 8 | return 0; | ^~~~~~ a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s422911353
p03695
C++
#include<bits/stdc++.h> using namespace std; int rate[]={1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4900}; int main(){ int flag[9]; for(int i=0;i<9;i++){ flag[i]=0; } int N; cin>>N; for(int i=0;i<N;i++){ int rr; cin>>rr; for(int j=0;j<9;j++){ if(rr>=rate[j]&&rr<rate[j+1]){ flag[j]++; break; } } /*for(int j=0;j<9;j++){ cout<<j+1<<":"<<flag[j]<<endl; }*/ } int res=0; for(int i=0;i<8;i++){ if(flag[i]>0) res++; } if(res==0){ cout<<1<<" "<<flag[8]<<endl; else{ cout<<res<<" "<<res+flag[8]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:35:9: error: expected '}' before 'else' 35 | else{ | ^~~~ a.cc:32:19: note: to match this '{' 32 | if(res==0){ | ^
s486724940
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for(int i = 0; i < (n); i++) #define MEM(a, x) memset(a, x, sizeof(a)) #define ALL(a) a.begin(), a.end() #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) typedef long long ll; int n, c[10]; int main(int argc, char const *argv[]) { ios_base::sync_with_stdio(false); cin >> n; FOR(i, n) { int a; cin >> a; a = min(a/400, 8); c[a]++; } int cnt = 0; FOR(i, 8) { if (c[i]) cnt++; } int mi = (cnt : cnt ? 1), ma = cnt + c[8]; cout << mi << " " << ma << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:24:23: error: found ':' in nested-name-specifier, expected '::' 24 | int mi = (cnt : cnt ? 1), ma = cnt + c[8]; | ^ | :: a.cc:24:19: error: 'cnt' is not a class, namespace, or enumeration 24 | int mi = (cnt : cnt ? 1), ma = cnt + c[8]; | ^~~ a.cc:24:32: error: expected ':' before ')' token 24 | int mi = (cnt : cnt ? 1), ma = cnt + c[8]; | ^ | : a.cc:24:32: error: expected primary-expression before ')' token a.cc:25:30: error: 'ma' was not declared in this scope; did you mean 'mi'? 25 | cout << mi << " " << ma << endl; | ^~ | mi
s018230312
p03695
C++
#include<stdio.h> int main(void) { int n,a[8],i,j,x,h,h2,l; scanf("%d",&n); for(i=0;i<8;i++) a[i]=0; l=0; for(i=0;i<n;i++){ scanf("%d",&x); if(x>3199){ l++; } else{ h=400; h2=1; for(j=0;j<8;j++){ if(h2<=x && x<h){ a[j]=1; break; } h2=h; h=h+400; } } } x=0; for(i=0;i<8;i++){ if(a[i]==1) x++; } if(l>8) l=8 l=x+l; printf("%d %d\n",x,l); return 0; }
a.cc: In function 'int main()': a.cc:29:20: error: expected ';' before 'l' 29 | if(l>8) l=8 | ^ | ; 30 | l=x+l; | ~
s312036522
p03695
C++
#include<stdio.h> int main(void) { int n,a[8],i,j,x,h,h2,l; scanf("%d",&n); for(i=0;i<8;i++) a[i]=0; l=0; for(i=0;i<n;i++){ scanf("%d",&x); if(x>3199){ l++; } else{ h=400; h2=1; for(j=0;j<8;j++){ if(h2<=x && x<h){ a[j]=1; break; } h2=h; h=h+400; } } } x=0; for(i=0;i<8;i++){ if(a[i]==1) x++; } if(l>8) l=8 l=x+l; printf("%d %d\n",x,l); return 0; }
a.cc: In function 'int main()': a.cc:29:20: error: expected ';' before 'l' 29 | if(l>8) l=8 | ^ | ; 30 | l=x+l; | ~
s881210408
p03695
C++
#include<stdio.h> int main(void) { int n,a,x[]={0,399,799,1199,1599,1999,2399,2799,3199},flg[10],cnt,cnt1,i,j; scanf("%d",&n); cnt=0; for(i=0;i<8;i++) flg[i]=0; for(i=0;i<n;i++){ scanf("%d",&a); for(j=0;j<9;j++){ if(j==8){ cnt++; break; } else if(x[j]<a&&x[j+1]>=a){ // printf("a=%d i=%d\n",a,i); flg[j]=1; break; } } } // for(i=0;i<9;i++) printf("%d\n",x[i]); // for(i=0;i<8;i++) printf("%d\n",flg[i]); cnt1=0; for(i=0;i<8;i++){ if(flg[i]==1) cnt1++; } //if(cnt1==0) printf("1 "); else printf("%d ",cnt1); cnt1+=cnt; printf("%d\n",cnt1); //else printf("8\n"); return 0; }
a.cc: In function 'int main()': a.cc:29:9: error: 'else' without a previous 'if' 29 | else printf("%d ",cnt1); | ^~~~
s052377498
p03695
C++
#include<cstdio> #include<iostream> using namespace std; int main(void){ int n,min,max,i,a[100],flg[8],cn; for(i=0;i<8;i++) flg[i]=0; cin>>n; for(i=0;i<n;i++) cin>>a[i]; min=0; max=0; cn=0 for(i=0;i<n;i++){ if(a[i]<=399&&flg[0]!=1){ flg[0]=1; min++; max++; } if(a[i]>=400&&a[i]<=799&&flg[1]!=1){ flg[1]=1; min++; max++; } if(a[i]>=800&&a[i]<=1199&&flg[2]!=1){ flg[2]=1; min++; max++; } if(a[i]>=1200&&a[i]<=1599&&flg[3]!=1){ flg[3]=1; min++; max++; } if(a[i]>=1600&&a[i]<=1999&&flg[4]!=1){ flg[4]=1; min++; max++; } if(a[i]>=2000&&a[i]<=2399&&flg[5]!=1){ flg[5]=1; min++; max++; } if(a[i]>=2400&&a[i]<=2799&&flg[6]!=1){ flg[6]=1; min++; max++; } if(a[i]>=2800&&a[i]<=3199&&flg[7]!=1){ flg[7]=1; min++; max++; } if(a[i]>=3200){ cn++; max++; } } if(cn>min) min+=cn-min; cout<<min<<' '<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:27: error: expected ';' before 'for' 9 | min=0; max=0; cn=0 | ^ | ; 10 | for(i=0;i<n;i++){ | ~~~ a.cc:10:24: error: expected ';' before ')' token 10 | for(i=0;i<n;i++){ | ^ | ;
s912964656
p03695
C++
#include<cstdio> #include<iostream> using namespace std; int main(void){ double n,min,max,i,a[100],flg[8]; for(i=0;i<8;i++) flg[i]=0; cin>>n; for(i=0;i<n;i++) cin>>a[i]; min=0; max=0; for(i=0;i<n;i++){ if(a[i]<=399&&flg[0]!=1){ flg[0]=1; min++; } if(a[i]>=400&&a[i]<=799&&flg[1]!=1){ flg[1]=1; min++; } if(a[i]>=800&&a[i]<=1199&&flg[2]!=1){ flg[2]=1; min++; } if(a[i]>=1200&&a[i]<=1599&&flg[3]!=1){ flg[3]=1; min++; } if(a[i]>=1600&&a[i]<=1999&&flg[4]!=1){ flg[4]=1; min++; } if(a[i]>=2000&&a[i]<=2399&&flg[5]!=1){ flg[5]=1; min++; } if(a[i]>=2400&&a[i]<=2799&&flg[6]!=1){ flg[6]=1; min++; } if(a[i]>=2800&&a[i]<=3199&&flg[7]!=1){ flg[7]=1; min++; } if(a[i]>=3200) max++; } cout<<min<<' '<<min+max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:29: error: invalid types 'double [8][double]' for array subscript 6 | for(i=0;i<8;i++) flg[i]=0; | ^ a.cc:8:32: error: invalid types 'double [100][double]' for array subscript 8 | for(i=0;i<n;i++) cin>>a[i]; | ^ a.cc:11:21: error: invalid types 'double [100][double]' for array subscript 11 | if(a[i]<=399&&flg[0]!=1){ | ^ a.cc:15:21: error: invalid types 'double [100][double]' for array subscript 15 | if(a[i]>=400&&a[i]<=799&&flg[1]!=1){ | ^ a.cc:15:32: error: invalid types 'double [100][double]' for array subscript 15 | if(a[i]>=400&&a[i]<=799&&flg[1]!=1){ | ^ a.cc:19:21: error: invalid types 'double [100][double]' for array subscript 19 | if(a[i]>=800&&a[i]<=1199&&flg[2]!=1){ | ^ a.cc:19:32: error: invalid types 'double [100][double]' for array subscript 19 | if(a[i]>=800&&a[i]<=1199&&flg[2]!=1){ | ^ a.cc:23:21: error: invalid types 'double [100][double]' for array subscript 23 | if(a[i]>=1200&&a[i]<=1599&&flg[3]!=1){ | ^ a.cc:23:33: error: invalid types 'double [100][double]' for array subscript 23 | if(a[i]>=1200&&a[i]<=1599&&flg[3]!=1){ | ^ a.cc:27:21: error: invalid types 'double [100][double]' for array subscript 27 | if(a[i]>=1600&&a[i]<=1999&&flg[4]!=1){ | ^ a.cc:27:33: error: invalid types 'double [100][double]' for array subscript 27 | if(a[i]>=1600&&a[i]<=1999&&flg[4]!=1){ | ^ a.cc:31:21: error: invalid types 'double [100][double]' for array subscript 31 | if(a[i]>=2000&&a[i]<=2399&&flg[5]!=1){ | ^ a.cc:31:33: error: invalid types 'double [100][double]' for array subscript 31 | if(a[i]>=2000&&a[i]<=2399&&flg[5]!=1){ | ^ a.cc:35:21: error: invalid types 'double [100][double]' for array subscript 35 | if(a[i]>=2400&&a[i]<=2799&&flg[6]!=1){ | ^ a.cc:35:33: error: invalid types 'double [100][double]' for array subscript 35 | if(a[i]>=2400&&a[i]<=2799&&flg[6]!=1){ | ^ a.cc:39:21: error: invalid types 'double [100][double]' for array subscript 39 | if(a[i]>=2800&&a[i]<=3199&&flg[7]!=1){ | ^ a.cc:39:33: error: invalid types 'double [100][double]' for array subscript 39 | if(a[i]>=2800&&a[i]<=3199&&flg[7]!=1){ | ^ a.cc:43:21: error: invalid types 'double [100][double]' for array subscript 43 | if(a[i]>=3200) max++; | ^
s524108571
p03695
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> using namespace std; int main(void){ int n,min,max,i,j,a[100],flg[9],temp; cin>>n; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n-1;i++){ for(j=i+1;j<n;j++){ if(a[i]>a[j]){ temp=a[i]; a[i]=a[j]; a[j]=temp; } } } flg=0; min=0; max=0; for(i=0;i<n;i++){ if(a[i]>=1&&a[i]<=399&&flg!=0){ flg=1; min++; max++; } if(a[i]>=400&&a[i]<=799&&flg!=2){ flg=2; min++; max++; } if(a[i]>=800&&a[i]<=1199&&flg!=3){ flg=3; min++; max++; } if(a[i]>=1200&&a[i]<=1599&&flg!=4){ flg=4; min++; max++; } if(a[i]>=1600&&a[i]<=1999&&flg!=5){ flg=5; min++; max++; } if(a[i]>=2000&&a[i]<=2399&&flg!=6){ flg=6; min++; max++; } if(a[i]>=2400&&a[i]<=2799&&flg!=7){ flg=7; min++; max++; } if(a[i]>=2800&&a[i]<=3199&&flg!=8){ flg=8; min++; max++; } if(a[i]>=3200){ if(max<8) max++; } } if(min<0) min=0; cout<<min<<' '<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:19:12: error: incompatible types in assignment of 'int' to 'int [9]' 19 | flg=0; min=0; max=0; | ~~~^~ a.cc:22:28: error: incompatible types in assignment of 'int' to 'int [9]' 22 | flg=1; | ~~~^~ a.cc:25:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 25 | if(a[i]>=400&&a[i]<=799&&flg!=2){ | ~~~^~~ a.cc:26:28: error: incompatible types in assignment of 'int' to 'int [9]' 26 | flg=2; | ~~~^~ a.cc:29:46: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 29 | if(a[i]>=800&&a[i]<=1199&&flg!=3){ | ~~~^~~ a.cc:30:28: error: incompatible types in assignment of 'int' to 'int [9]' 30 | flg=3; | ~~~^~ a.cc:33:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 33 | if(a[i]>=1200&&a[i]<=1599&&flg!=4){ | ~~~^~~ a.cc:34:28: error: incompatible types in assignment of 'int' to 'int [9]' 34 | flg=4; | ~~~^~ a.cc:37:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 37 | if(a[i]>=1600&&a[i]<=1999&&flg!=5){ | ~~~^~~ a.cc:38:28: error: incompatible types in assignment of 'int' to 'int [9]' 38 | flg=5; | ~~~^~ a.cc:41:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 41 | if(a[i]>=2000&&a[i]<=2399&&flg!=6){ | ~~~^~~ a.cc:42:28: error: incompatible types in assignment of 'int' to 'int [9]' 42 | flg=6; | ~~~^~ a.cc:45:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 45 | if(a[i]>=2400&&a[i]<=2799&&flg!=7){ | ~~~^~~ a.cc:46:28: error: incompatible types in assignment of 'int' to 'int [9]' 46 | flg=7; | ~~~^~ a.cc:49:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 49 | if(a[i]>=2800&&a[i]<=3199&&flg!=8){ | ~~~^~~ a.cc:50:28: error: incompatible types in assignment of 'int' to 'int [9]' 50 | flg=8; | ~~~^~
s222563449
p03695
C++
#aiinclude <iostream> #define MAX_N 200 using namespace std; int main(void){ int n; int cn[MAX_N] = {0}; int fc = 0; cin >> n; for(int i = 0; i < n; i++){ int a; cin >> a; if(a >= 3200) fc++; else cn[a/400] = 1; } int mi = 0; for(int i = 0; i < 8; i++) mi += cn[i]; if(mi == 0) mi = 1; int max; if(mi+fc >= 8) max = 8; else max = mi+fc; cout << mi << " " << max << endl; return 0; }
a.cc:1:2: error: invalid preprocessing directive #aiinclude; did you mean #include? 1 | #aiinclude <iostream> | ^~~~~~~~~ | include a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope 8 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #aiinclude <iostream> a.cc:21:3: error: 'cout' was not declared in this scope 21 | cout << mi << " " << max << endl; | ^~~~ a.cc:21:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:21:31: error: 'endl' was not declared in this scope 21 | cout << mi << " " << max << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #aiinclude <iostream>
s735247305
p03695
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <stack> #include <iomanip> #include <queue> #include <deque> #include <sstream> #include <stdio.h> #include <string> #include <cmath> #include <map> #include <utility> using namespace std; #define s(n) scanf("%d",&n) #define sc(n) scanf("%c",&n) #define ss(n) scanf("%s",&n) #define MOD 1000000007 #define ll long long int #define vi vector<int> #define vii vector< vector<int> > #define PI 3.1415926535897932384626433832795 int color(int x) { if(x >= 1 && x<= 399) { return 0; } if(x >= 400 && x<= 799) { return 1; } if(x >= 800 && x<= 1199) { return 2; } if(x >= 1200 && x<= 1599) { return 3; } if(x >= 1600 && x<= 1999) { return 4; } if(x >= 2000 && x<= 2399) { return 5; } if(x >= 2400 && x<= 2799) { return 6; } if(x >= 2800 && x<= 3199) { return 7; } return 8; } int main() { int n; cin >> n; vector<bool> was (8,false); int count3200 = 0; int max = 0; for(int i = 0; i < n; i++) { int x; cin >> x; int col = color(x); if(col == 8) { count3200++; } else { was[col] = true; } } int count = 0; for(int i = 0; i < 8; i++) { if(was[i]) { count++; } } cout << max(1,count) << " " << (count+count3200); return 0; }
a.cc: In function 'int main()': a.cc:76:20: error: 'max' cannot be used as a function 76 | cout << max(1,count) << " " << (count+count3200); | ~~~^~~~~~~~~
s646511951
p03695
C++
#include <cstdio> #include <cmath> #include <cstring> #include <cstdlib> #include <algorithm> #include <iostream> using namespace std; int s[105]; int main() { int n,a,cnt = 0,ma = 0,ans = 0; while(~scanf("%d",&n)){ int cnt = 0, ma = 0, ans = 0; for(int i = 1; i <= n; i++) { scanf("%d",&a); if(a<400 && a>= 1) s[1] = 1; else if(a <= 799 && a >= 400) s[2] = 1; else if(a <= 1199 && a >= 800) s[3] = 1; else if(a <= 1599 && a >= 1200) s[4] = 1; else if(a <= 1999 && a >= 1600) s[5] = 1; else if(a <= 2399 && a >= 2000) s[6] = 1; else if(a <= 2799 && a >= 2400) s[7] = 1; else if(a <= 3199 && a >= 2800) s[8] = 1; else cnt++; } for(int i = 1; i <= 8; i++) ans += s[i]; ma = max(ans,1); printf("%d %d\n",ma,ma + cnt); memset(s,0,sizeof(s)); } return0; }
a.cc: In function 'int main()': a.cc:35:1: error: 'return0' was not declared in this scope 35 | return0; | ^~~~~~~
s398423946
p03695
C++
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <queue> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstring> #include <ctime> using namespace std; typedef long long ll; typedef unsigned long long ull; static const double EPS = 1e-8; static const double PI = 4.0 * atan(1.0); static const double PI2 = 8.0 * atan(1.0); #define REP(i,n) for(int i=0;i<(int)n;++i) #define ALL(c) (c).begin(),(c).end() #define CLEAR(v) memset(v,0,sizeof(v)) #define MP(a,b) make_pair((a),(b)) #define ABS(a) ((a)>0?(a):-(a)) #define FOR(i,s,n) for(int i=s;i<(int)n;++i) int n, a; int cnt[9]; int main(int argc, char **argv) { cin >> n; clear(cnt); REP(i, n) { cin >> a; ++cnt[min(3200, a) / 400]; } int res = 0; REP(i, 8) if (cnt[i] != 0) ++res; if (res == 0) cout << (cnt[8] != 0 ? 1 : 0) << ' ' << min(8, cnt[8]) << endl; else cout << res << ' ' << min(8, res + cnt[8]) << endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:45:9: error: 'clear' was not declared in this scope 45 | clear(cnt); | ^~~~~
s674592779
p03695
C++
#include <iostream> #include<sstream> #include<vector> #include<iterator> #include<count> using namespace std; int main(void) { int N; cin >> N; vector<int> cnt(9, 0); for(int i=0; i<N; i++) { int a; cin >> a; cnt[min((int)cnt.size()-1, a/400)]++; } int ret_min, ret_max; ret_min = cnt.size()-1 - count(cnt.begin(), cnt.end()-1, 0); ret_max = min((int)cnt.size(), ret_min + cnt[cnt.size()-1]); if(ret_min == 0) ret_min = 1; cout << ret_min << " " << ret_max << endl; return 0; }
a.cc:5:9: fatal error: count: No such file or directory 5 | #include<count> | ^~~~~~~ compilation terminated.
s014447923
p03695
C++
#include <iostream> #include<sstream> #include<vector> #include<iterator> using namespace std; int main(void) { int N; cin >> N; vector<int> cnt(9, 0); for(int i=0; i<N; i++) { int a; cin >> a; cnt[min((int)cnt.size()-1, a/400)]++; } int ret_min, ret_max; ret_min = cnt.size()-1 - count(cnt.begin(), cnt.end()-1, 0); ret_max = min((int)cnt.size(), ret_min + cnt[cnt.size()-1]); if(ret_min == 0) ret_min = 1; cout << ret_min << " " << ret_max << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:34: error: 'count' was not declared in this scope; did you mean 'cnt'? 22 | ret_min = cnt.size()-1 - count(cnt.begin(), cnt.end()-1, 0); | ^~~~~ | cnt
s591119907
p03695
C
#include <stdio.h> int main() { int N,a[100],i,j,gle=0,bro=0,gr=0,miz=0,blue=0,yel=0,dai=0,red=0,min=0,max=0,cnt=0; scanf("%d",&N); for(i=0;i<N;i++) { scanf("%d",&a[i]); } for(i=0;i<N;i++) { if(a[i]<399) { if(gle==0) { cnt++; gle++; max++; min++; } } else if(a[i]<799) { if(bro==0) { cnt++; bro++; max++; min++; } } else if(a[i]<1199) { if(gr==0) { cnt++; gr++; max++; min++; } } else if(a[i]<1599) { if(miz==0) { cnt++; miz++; max++; min++; } } else if(a[i]<1999) { if(blue==0) { cnt++; blue++; max++; min++; } } else if(a[i]<2399) { if(yel==0) { cnt++; yel++; max++; min++; } } else if(a[i]<2799) { if(dai==0) { cnt++; dai++; max++; min++; } } else if(a[i]<3199) { if(red==0) { cnt++; red++; max++; min++; } } } for(i=0;i<N;i++) { if(a[i]>=3200) { if(cnt<7) { cnt++; max++; } if(cnt<2) { cnt++; min++; max++; } } printf("%d %d\n",min,max); return 0; }
main.c: In function 'main': main.c:112:1: error: expected declaration or statement at end of input 112 | } | ^
s203913064
p03695
C++
#include <iostream> #include <algorithm> using namespace std; int main() { vector<int> num(9, 0); int N; cin >> N; for (int i = 0, a; i < N; i++) { cin >> a; num[min(a / 400, 8)]++; } int mini = 0, maxi; for (int i = 0; i < 8; i++) if (num[i]) mini++; if (mini == 0) { mini = 1; maxi = min(num[8], 8); } else maxi = min(mini + num[8], 8); cout << mini << " " << maxi << endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'vector' was not declared in this scope 7 | vector<int> num(9, 0); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 | using namespace std; a.cc:7:12: error: expected primary-expression before 'int' 7 | vector<int> num(9, 0); | ^~~ a.cc:13:9: error: 'num' was not declared in this scope; did you mean 'enum'? 13 | num[min(a / 400, 8)]++; | ^~~ | enum a.cc:18:13: error: 'num' was not declared in this scope; did you mean 'enum'? 18 | if (num[i]) | ^~~ | enum a.cc:22:20: error: 'num' was not declared in this scope; did you mean 'enum'? 22 | maxi = min(num[8], 8); | ^~~ | enum a.cc:24:27: error: 'num' was not declared in this scope; did you mean 'enum'? 24 | maxi = min(mini + num[8], 8); | ^~~ | enum
s632147317
p03695
C++
#include<stdio.h> int main() { int x = 0; int y = 0; int n,z; int a = 0; int b = 0; int c = 0; int d = 0; int e = 0; int f = 0; int g = 0; int h = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &z); if (400>z && a == 0) { x++; a++; } if (z>=400 &&z < 800 && b ==0) { x++; b++; } if ( z>=800 && z < 1200 && c == 0) { x++; c++; } if (z>=1200&& z < 1600 && d == 0) { x++; d++; } if (z>=1600 && z < 2000 && e == 0) { x++; e++; } if (z >= 2000 && z < 2400 && f == 0) { x++; f++; } if (z >= 2400 && z < 2800 && g == 0) { x++; g++; } if (z >= 2800 && z < 3200 && h == 0) { x++; h++; } if (z >= 3200) { y++; } } if(x==0){ printf("%d %d",1,y)}else{ printf("%d %d", x, x + y); } return 0; }
a.cc: In function 'int main()': a.cc:57:20: error: expected ';' before '}' token 57 | printf("%d %d",1,y)}else{ | ^ | ;
s003570535
p03695
C++
#define TEST_MODE false #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, a, b) for (int i = (a); i < (b); ++i) #define rrep(i, n) for (int i = (n)-1; i >= 0; --i) #define rrep2(i, a, b) for (int i = (a)-1; i >= b; --i) #define range(i, a, b, c) for (int i = a; \ c > 0 ? i < b : i > b; \ i += c) #define chmax(a, b) (a = (a) < (b) ? (b) : (a)) #define chmin(a, b) (a = (a) > (b) ? (b) : (a)) using ll = long long; using ull = unsigned long long; using ld = long double; #define all(a) begin(a), end(a) #define ifnot(a) if (not(a)) #define int long long #ifdef LOCAL_ENV #if TEST_MODE == true const bool test = true; #define dump(x) cerr << #x << " = " << (x) << endl #else const bool test = false; #define dump(x) #endif #else const bool test = false; #define dump(x) #endif int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; const int INF = (int)1 << 60; const ll INFL = (ll)1 << 60; ll mod_n = (int)1e9 + 7; const double eps = 1e-10; typedef long double Real; // return -1, 0, 1 int sgn(const Real &r) { return (r > eps) - (r < -eps); } int sgn(const Real &a, const Real &b) { return sgn(a - b); } //..................... const int MAX = (int)2e5 + 5; vector<string> split(const string &str, char sep) { vector<string> v; stringstream ss(str); string buffer; while (getline(ss, buffer, sep)) { v.push_back(buffer); } return v; } template <class InputIterator> int sum(InputIterator begin, InputIterator end) { return accumulate(begin, end, 0ll); } void solve(); class Solver { public: int n; int a[105]; int exists[20] = {}; void solve() { cin >> n; rep(i, n) cin >> a[i]; rep(i, n) { exists[a[i]/400]++; } int res = 0; rep(i, 3200 / 400) { res += (exists[i] > 0 ? 1 : 0); } int res1 = res; int res2 = res; rep2(i, 3200 / 400, 5600 / 400) { res2 += exists[i]; } cout << max(1, res1) << " " << res2 << endl; } }; signed main() { cout << fixed << setprecision(20); auto ptr = new Solver(); ptr->solve(); delete ptr; // while (true) { // auto ptr = new Solver(); // ptr->solve(); // delete ptr; // } return 0; } // class Mycin { // bool flag = true; // public: // Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;} // Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;} // Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;} // operator bool() {return flag;} // } mycin; // class Mycout { // public: // Mycout& operator << (const int& a) {printf("%lld", a); return *this;} // Mycout& operator << (const char c) {printf("%c", c); return *this;} // Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;} // } mycout; // #define cin mycin // #define cout mycout // #define endl '\n'
a.cc: In member function 'void Solver::solve()': a.cc:96:20: error: no matching function for call to 'max(int, long long int&)' 96 | cout << max(1, res1) << " " << res2 << 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:6: /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:96:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 96 | cout << max(1, res1) << " " << res2 << 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:96:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 96 | cout << max(1, res1) << " " << res2 << endl; | ~~~^~~~~~~~~
s441610628
p03695
Java
//C問題 public class Main { public static void main(String[] args) { //レートで区分をわける // int rate[] = new int[10]; //配列を0で初期化 for(int cnt = 0;cnt < 10; cnt++) { rate[cnt] = 0; } //スキャナーを宣言する Scanner sc = new Scanner(System.in); //入力を受け取る int N = Integer.parseInt(sc.next()); int a; for(int cnt = 0; cnt < N; cnt++) { a = Integer.parseInt(sc.next()); //レートで区分分け if((1 <= a)&&(a <= 399)){ rate[0] = 1; } else if((400 <= a)&&(a <= 799)){ rate[1] = 1; } else if((800 <= a)&&(a <= 1199)){ rate[2] = 1; } else if((1200 <= a)&&(a <= 1599)){ rate[3] = 1; } else if((1600 <= a)&&(a <= 1999)){ rate[4] = 1; } else if((2000 <= a)&&(a <= 2399)){ rate[5] = 1; } else if((2400 <= a)&&(a <= 2799)){ rate[6] = 1; } else if((2800 <= a)&&(a <= 3199)){ rate[7] = 1; } else if((3200 <= a)&&(a <= 4800)){ rate[8] = rate[8] + 1; } } //スキャナーを閉じる sc.close(); //色の合計 int sum = 0; for (int cnt = 0;cnt < 10; cnt++) { sum = sum + rate[cnt]; } //出力 //最小値 if((sum-rate[8]) == 0) { //sumが0の時 System.out.print((sum-rate[8] + 1)); } else { System.out.print((sum-rate[8])); } //最大値 System.out.print(" "+sum); } }
Main.java:15: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:15: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s772694265
p03695
C++
// 7/4 Tuesday #include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main() { int n,ans,x=0,kizon=0; int color[8] = {}; cin >> n; vector <int> rate(n); for (int i = 0; i < n; i++) { cin >> rate[i]; } for (int i = 0; i < n; i++) { if (rate[i] <= 399) { color[0] = 1; } else if (rate[i] <= 799) { color[1] = 1; } else if (rate[i] <= 1199) { color[2] = 1; } else if (rate[i] <= 1599) { color[3] = 1; } else if (rate[i] <= 1999) { color[4] = 1; } else if (rate[i] <= 2399) { color[5] = 1; } else if (rate[i] <= 2799) { color[6] = 1; } else if (rate[i] <= 3199) { color[7] = 1; } else x++; } for (int i = 0; i < 8; i++) { if (color[i] == 1) { kizon++; } } if (kizon == 0) kizon = x; ans = kizon; else ans = kizon + x; cout << kizon << " " << ans<< endl; return 0; }
a.cc: In function 'int main()': a.cc:35:9: error: 'else' without a previous 'if' 35 | else ans = kizon + x; | ^~~~
s506689872
p03695
C++
// 7/4 Tuesday #include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main() { int n,x=0,kizon=0; int color[8] = {}; cin >> n; vector <int> rate(n); for (int i = 0; i < n; i++) { cin >> rate[i]; } for (int i = 0; i < n; i++) { if (rate[i] <= 399) { color[0] = 1; } else if (rate[i] <= 799) { color[1] = 1; } else if (rate[i] <= 1199) { color[2] = 1; } else if (rate[i] <= 1599) { color[3] = 1; } else if (rate[i] <= 1999) { color[4] = 1; } else if (rate[i] <= 2399) { color[5] = 1; } else if (rate[i] <= 2799) { color[6] = 1; } else if (rate[i] <= 3199) { color[7] = 1; } else x++; } for (int i = 0; i < 8; i++) { if (color[i] == 1) { kizon++; } } if (kizon == 0) kizon = x; ans = kizon; else ans = kizon + x; cout << kizon << " " << ans<< endl; return 0; }
a.cc: In function 'int main()': a.cc:34:36: error: 'ans' was not declared in this scope; did you mean 'abs'? 34 | if (kizon == 0) kizon = x; ans = kizon; | ^~~ | abs a.cc:35:9: error: 'else' without a previous 'if' 35 | else ans = kizon + x; | ^~~~
s369960299
p03695
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List<Integer> points = new ArrayList<>(); for(int i=0; i<n; i++) { points.add(sc.nextInt()); } int range[] = {0,0,0,0,0,0,0,0,0}; for(int p: points) { if (p < 400) range[0]++; else if (p < 800) range[1]++; else if (p < 1200) range[2]++; else if (p < 1600) range[3]++; else if (p < 2000) range[4]++; else if (p < 2400) range[5]++; else if (p < 2800) range[6]++; else if (p < 3200) range[7]++; else range[8]++; } int count = 0; for(int i=0; i<8; i++) { if (range[i] > 0) count++; } // int max = count + range[8] < 9 ? count + range[8] : 8; int max = count + range[8]; System.out.println(count + " " + max); }
Main.java:39: error: reached end of file while parsing } ^ 1 error