submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s878093117
p03695
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n=sc.nextInt(),min=0,max=0,f=0; int[] a=new int[n],color=new int[8]; for(int i=0;i<n;i++){ a[i]=sc.nextInt(); if(a[i]<400&&color[0]==0){ color[0]++; min++; max++; f++; }else if(a[i]>=400&&a[i]<800&&color[1]==0){ color[1]++; min++; max++; f++; }else if(a[i]>=800&&a[i]<1200&&color[2]==0){ color[2]++; min++; max++; f++; }else if(a[i]>=1200&&a[i]<1600&&color[3]==0){ color[3]++; min++; max++; f++; }else if(a[i]>=1600&&a[i]<2000&&color[4]==0){ color[4]++; min++; max++; f++; }else if(a[i]>=2000&&a[i]<2400&&color[5]==0){ color[5]++; min++; max++; f++; }else if(a[i]>=2400&&a[i]<2800&&color[6]==0){ color[6]++; min++; max++; f++; }else if(a[i]>=2800&&a[i]<3200&&color[7]==0){ color[7]++; min++; max++; f++; }else if(a[i]>=3200){ if(i==0){ min++; max++; }else{ max++; } } } if(n>=2){ if(a[0]>=3200&&f>0){ c--; } } System.out.println(min+" "+max); } }
Main.java:62: error: cannot find symbol c--; ^ symbol: variable c location: class Main 1 error
s484785962
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> field(9, 0); for (int i = 0; i<n; i++){ int a; cin >> a; if (a < 3200){ field.at(a/400)++; }else{ field.at(8)++; } } int counter = 0; for (int i = 0; i<8; i++){ if (field.at(i) != 0){ counter++; } } if (field.at(8) != 0){ if (counter != 0){ if (field.at(8) <= 8-counter){ cout << counter << " " << counter+field.at(8) << endl; }else{ cout << counter << " " << 8 << endl; } }else{ if (field.at(8) <= 8){ cout << 1 << " " << field.at(8) << else; }else{ cout << 1 << " " << 8; } } }else{ cout << counter << " " << counter << endl; } }
a.cc: In function 'int main()': a.cc:36:52: error: expected primary-expression before 'else' 36 | cout << 1 << " " << field.at(8) << else; | ^~~~
s263161184
p03695
C
#include<stdio.h> int main(){ int color[9] = {0}; int n; int min = 0; int max = 0; scanf("%d",&n); int a; for(int i = 0; i < n ; ++i){ scanf("%d",&a); if(a <= 399) color[0] = 1; else if(a <= 799) color[1] = 1; else if(a <= 1199) color[2] = 1; else if(a <= 1599) color[3] = 1; else if(a <= 1999) color[4] = 1; else if(a <= 2399) color[5] = 1; else if(a <= 2799) color[6] = 1; else if(a <= 3199) color[7] = 1; else color[8] += 1; } for(int i = 0; i < 8 ; ++i){ min += color[i]; } if(min == 0){ min = color[8]; max = min }else{ max = min + color[8]; } printf("%d %d", min, max); return 0; }
main.c: In function 'main': main.c:30:14: error: expected ';' before '}' token 30 | max = min | ^ | ; 31 | }else{ | ~
s301518788
p03695
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; using namespace std; int main() { int N; cin >> N; vector<int> a(N); int ra[9] = {0}; rep(i, N) { int tmp; cin >> tmp; a[i] = tmp; if (tmp / 400 < 8) { ra[tmp / 400]++; } else { ra[8]++; } } int mini = 0; rep(i, 8) { if (ra[i] > 0) { mini++; } } mini = min(mini, (ra[8])?1:200000)); int maxi = max(mini + ra[8], mini); cout << mini << " " << maxi << endl; return 0; }
a.cc: In function 'int main()': a.cc:33:37: error: expected ';' before ')' token 33 | mini = min(mini, (ra[8])?1:200000)); | ^ | ;
s085777655
p03695
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ ) #define all(x) (x).begin(),(x).end() using namespace std; using ll = long long; using vin=vector<int>; const int inf=1e9+7; const ll INF=1e18; int main() { int n; cin>>n; vin a(n); rep(i,n) cin>>a[i]; ///////// vector<bool> b(8,false); int ans=0; int cnt=0; rep(i,n){ //a[i]について rep(j,8){ //何色か if(a[i]>=3200){ cnt++; break; } else if(a[i]/400==j){ b[j]=true; } }//repj }//repi rep(i,8){ if(b[i]) {ans++; } if(ans==0) { ans++; cnt--; } cout<<ans<<" "<<ans+cnt<<endl; }
a.cc: In function 'int main()': a.cc:42:2: error: expected '}' at end of input 42 | } | ^ a.cc:12:12: note: to match this '{' 12 | int main() { | ^
s501715850
p03695
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ ) #define all(x) (x).begin(),(x).end() using namespace std; using ll = long long; using vin=vector<int>; const int inf=1e9+7; const ll INF=1e18; int main() { int n; cin>>n; vin a(n); rep(i,n) cin>>a[i]; ///////// vector<bool> b(8,false); int ans=0; int cnt=0; rep(i,n){ //a[i]について rep(j,8){ //何色か if(a[i]>=3200){ cnt++; break; } else if(a[i]/400==j){ b[j]=true; } }//repj }//repi rep(i,8){ if(b[i]) {ans=++ } if(ans==0) { ans++; cnt--; } cout<<ans<<" "<<ans+cnt<<endl; }
a.cc: In function 'int main()': a.cc:36:3: error: expected primary-expression before '}' token 36 | } | ^ a.cc:42:2: error: expected '}' at end of input 42 | } | ^ a.cc:12:12: note: to match this '{' 12 | int main() { | ^
s434365285
p03695
Java
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class CheckAll { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int count3200 = 0; Set<Integer> set = new HashSet<>(); for (int i = 0; i < n; i++) { int a = scanner.nextInt(); if (a < 3200) { set.add(a/400); } else { count3200++; } } int min = set.size(); int max = Math.min(8, set.size() + count3200); System.out.println(min + " "+ max); } }
Main.java:5: error: class CheckAll is public, should be declared in a file named CheckAll.java public class CheckAll { ^ 1 error
s678229334
p03695
Java
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class CheckAll { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int count3200 = 0; Set<Integer> set = new HashSet<>(); for (int i = 0; i < n; i++) { int a = scanner.nextInt(); if (a < 3200) { set.add(a/400); } else { count3200++; } } int min = set.size(); int max = Math.min(8, set.size() + count3200); System.out.print(min + " "+ max); } }
Main.java:5: error: class CheckAll is public, should be declared in a file named CheckAll.java public class CheckAll { ^ 1 error
s583028091
p03695
C++
#include <iostream> #include <string> #include <algorithm> #include <ctime> #include <functional> #include <vector> #include <stack> #include <queue> #include <map> #include <set> #include <cassert> #include <bitset> #include <list> #include <cstdio> #include <stdio.h> #include <string.h> #include <limits.h> #include <math.h> #include <cmath> #include <tuple> #include <cassert> #include <array> #include <iomanip> using namespace std; using pii = pair<int, int>; using ti = tuple<int, int, int>; const double eps=1e-14; const int mod = 1e9 + 7; const int inf = ((1<<30)); const long long linf = (1LL<<60); int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; map<int, int> mp; for(int i=0; i<n; i++) { int rate; cin >> rate; if(rate<400) mp[0]++; else if(rate<800) mp[1]++; else if(rate<1200) mp[2]++; else if(rate<1600) mp[3]++; else if(rate<2000) mp[4]++; else if(rate<2400) mp[5]++; else if(rate<2800) mp[6]++; else if(rate<3200) mp[7]++; else mp[8]++; } int ans = 0: for(int i=0; i<8; i++) if(mp[i] > 0) ans++; ans = min(8, ans+mp[8]); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:55:16: error: expected ',' or ';' before ':' token 55 | int ans = 0: | ^ a.cc:56:18: error: 'i' was not declared in this scope 56 | for(int i=0; i<8; i++) if(mp[i] > 0) ans++; | ^
s615777210
p03695
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using vvl = vector<vector<ll>>; using vl = vector<ll>; #define _GLIBCXX_DEBUG #define acc_io cin.tie(0);ios::sync_with_stdio(false) #define all(x) x.begin(),x.end() #define rep(i,sta,end) for(ll i=sta;i<end;i++) #define lcm(a,b) (a)/__gcd((a),(b))*(b) #define pb push_back const ll MOD = 1000000007; const double PI = acos(-1); //name[i] -> vl name(i) //name[i][j]-> vvl name(i,vl(j)) //or-> || //map<int,int>mp ll n; ll ans; //string s; signed main(){ acc_io; ans=0; cin>>n; int a; int col[10]={0}; rep(i,0,n){ cin>>a; if(a<400) col[0]++; else if(a<800) col[1]++; else if(a<1200) col[2]++; else if(a<1600) col[3]++; else if(a<2000) col[4]++; else if(a<2400) col[5]++; else if(a<2800) col[6]++; else if(a<3200) col[7]++; else col[8]++; } int min=0; rep(i,0,8){ if(col[i]) min++; } int max; max=min+col[8]; max=min(8,max); cout<<min<<" "<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:46:16: error: 'min' cannot be used as a function 46 | max=min(8,max); | ~~~^~~~~~~
s280368459
p03695
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; bool colors[8] = {false}; int free = 0; for (int i = 0; i < N; i++) { int a; cin >> a; if (a <= 399) colors[0] = true; else if (a <= 799) colors[1] = true; else if (a <= 1199) colors[2] = true; else if (a <= 1599) colors[3] = true; else if (a <= 1999) colors[4] = true; else if (a <= 2399) colors[5] = true; else if (a <= 2799) colors[6] = true; else if (a <= 3199) colors[7] = true; else free++; } int ans_min = 0; for (int i = 0; i < 8 i++) { if (colors[i]) ans_min++; } if (ans_min==0) ans_min = 1; int ans_max = ans_min + free; if (ans_max > 8) ans_max = 8; cout << ans_min << " " << ans_max << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:24: error: expected ';' before 'i' 26 | for (int i = 0; i < 8 i++) { | ^~ | ;
s833080545
p03695
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; bool colors[8] = {false}; int free = 0; for (int i = 0: i < N; i++) { int a; cin >> a; if (a <= 399) colors[0] = true; else if (a <= 799) colors[1] = true; else if (a <= 1199) colors[2] = true; else if (a <= 1599) colors[3] = true; else if (a <= 1999) colors[4] = true; else if (a <= 2399) colors[5] = true; else if (a <= 2799) colors[6] = true; else if (a <= 3199) colors[7] = true; else free++; } int ans_min = 0; for (int i = 0; i < 8 i++) { if (colors[i]) ans_min++; } if (ans_min==0) ans_min = 1; int ans_max = ans_min + free; if (ans_max > 8) ans_max = 8; cout << ans_min << " " << ans_max << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: initializer in range-based 'for' loop 11 | for (int i = 0: i < N; i++) { | ^ a.cc:11:24: error: expected ')' before ';' token 11 | for (int i = 0: i < N; i++) { | ~ ^ | ) a.cc:11:26: error: 'i' was not declared in this scope 11 | for (int i = 0: i < N; i++) { | ^ a.cc:26:24: error: expected ';' before 'i' 26 | for (int i = 0; i < 8 i++) { | ^~ | ;
s040696429
p03695
C++
#include <iostream> using namespace std; int main() { itn N; cin >> N; bool colors[8] = {false}; int free = 0; for (int i = 0: i < N; i++) { int a; cin >> a; if (a <= 399) colors[0] = true; else if (a <= 799) colors[1] = true; else if (a <= 1199) colors[2] = true; else if (a <= 1599) colors[3] = true; else if (a <= 1999) colors[4] = true; else if (a <= 2399) colors[5] = true; else if (a <= 2799) colors[6] = true; else if (a <= 3199) colors[7] = true; else free++; } int ans_min = 0; for (int i = 0; i < 8 i++) { if (colors[i]) ans_min++; } if (ans_min==0) ans_min = 1; int ans_max = ans_min + free; if (ans_max > 8) ans_max = 8; cout << ans_min << " " << ans_max << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'itn' was not declared in this scope; did you mean 'int'? 5 | itn N; | ^~~ | int a.cc:6:10: error: 'N' was not declared in this scope 6 | cin >> N; | ^ a.cc:11:14: error: initializer in range-based 'for' loop 11 | for (int i = 0: i < N; i++) { | ^ a.cc:11:24: error: expected ')' before ';' token 11 | for (int i = 0: i < N; i++) { | ~ ^ | ) a.cc:11:26: error: 'i' was not declared in this scope 11 | for (int i = 0: i < N; i++) { | ^ a.cc:26:24: error: expected ';' before 'i' 26 | for (int i = 0; i < 8 i++) { | ^~ | ;
s977519913
p03695
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define repo(i,n) for(int i = 1; i < (int)(n); i++) #define pb push_back #define np next_permutation #define fi first #define se second #define all(x) (x).begin(),(x).end() #define mod 1000000007 #define pi acos(-1.0) ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //cout << fixed << setprecision (20); 小数点以下20桁まで //intの最大値2147483647 ≒ 2×10^9 //long longの最大値9223372036854775807 ≒ 9×10^18 //'0'+=16; で大文字に //'大文字'+=32; で小文字に //s[i]-'0'でchar文字→int数に; //string s = to_string(int数); //int n = stoi(string文字列) //実行時間制約2秒では2×10^8回くらいまで計算できる int main() { int n; cin >> n; int pro=0; vector<int> q(8,0); vector<int> p(n); rep(i,n){ cin>>p[i]; if(p[i]<=399)q[0]++; else if(p[i]<=799)q[1]++; else if(p[i]<=1199)q[2]++; else if(p[i]<=1599)q[3]++; else if(p[i]<=1999)q[4]++; else if(p[i]<=2399)q[5]++; else if(p[i]<=2799)q[6]++; else if(p[i]<=3199)q[7]++; else pro++; } int ans=0; rep(i,8){ if(q[i]!=0)ans++; } if(ans==0){ ans++; pro==; } cout << ans << " " << ans+pro << endl; }
a.cc: In function 'int main()': a.cc:55:8: error: expected primary-expression before ';' token 55 | pro==; | ^
s256285456
p03695
C++
#include <bits/stdc++.h> using namespace std; #define all(a)a.begin(),a.end() using ll=long long; const int INF = 1<<30; const ll INFll =1LL<<62; const int mod = int(1e9)+7; using V = vector<ll>; using P = pair<ll,ll>; int main(){ ll n;cin >>n; vector<ll>cnt(9,0); for (int i = 0; i < n; ++i) { ll a;cin >>a; cnt[a/400]++; } ll mint=0,mx=0; for (int j = 0; j < 9; ++j) { if(j<8){ if(cnt[j]>0)mint++; } else { if(cnt[j]>0)mx+=cnt[j]; } } cout <<max(mint,1)<<" "<<mint+mx<<endl; return 0; }
a.cc: In function 'int main()': a.cc:28:15: error: no matching function for call to 'max(ll&, int)' 28 | cout <<max(mint,1)<<" "<<mint+mx<<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:28:15: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 28 | cout <<max(mint,1)<<" "<<mint+mx<<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:28:15: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 28 | cout <<max(mint,1)<<" "<<mint+mx<<endl; | ~~~^~~~~~~~
s236205991
p03695
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pb push_back #define f(i,n) for(i=0;i<n;i++) #define F(i,a,b) for(i=a;a<=b;i++) #define arr(a,n) for( i=0;i<n;i++)cin>>a[i]; #define fi first #define se second #define mp make_pair #define mod 1000000007 #define YES cout<<"YES"<<endl; #define Yes cout<<"Yes"<<endl; #define NO cout<<"NO"<<endl; #define No cout<<"No"<<endl; #define yes cout<<"yes"<<endl; #define no cout<<"no"<<endl; #define vi vector<ll> #define ed end() #define bg begin() #define sz size() #define ln length() #define s() sort(a,a+n); #define sr() sort(a,a+n,greater<ll>()); #define v() sort(v.begin(),v.end()); #define vr() sort(v.begin(),v.end(),greater<ll>()); #define mod 1000000007 #define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);} ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;} int main() { /*#ifndef ONLINE_JUDGE // for getting input from input.txt freopen("input.txt", "r", stdin); // for writing output to output.txt freopen("output.txt", "w", stdout); #endif*/ /* Ofcourse it's Hard. It's supposed to be Hard. If it's easy everyone would do it. HARD IS WHAT MAKES IT GREAT YESTERDAY U SAID TOMORROW SLOWLY BECOMING THE PERSON I SHOULD HAVE BEEN A LONG TIME AGO SAME TASK CAN'T BE FOUND DIFFICULT TWICE BTBHWSITW SPRH TU KAB P CP IS ALL ABOUT THINKING YOU HAVE MUCH MORE POTENTIAL THAN U THINK AJIT SHIDDAT 10 UR DAILY ROUTINE */ fast(); //ll t;cin>>t;while(t--) { ll n,mn=0,mx=0; cin>>n; ll a[n]; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { if(a[i]>=1&&a[i]<=399) { mn++;mx++; } else if(a[i]>=400&&a[i]<=799) { mn++;mx++; } else if(a[i]>=800&&a[i]<=1199) { mn++;mx++; } else if(a[i]>=1200&&a[i]<=1599) { mn++;mx++; } else if(a[i]>=1600&&a[i]<=1999) { mn++;mx++; } else if(a[i]>=2000&&a[i]<=2399) {mn++;mx++; } else if(a[i]>=2400&&a[i]<=2799) {mn++;mx++; } else if(a[i]>=2800&&a[i]<=3199) { mn++;mx++; } else { mx++; } } cout<<mn<<" "<<mx<endl; } return 0; }
a.cc: In function 'int main()': a.cc:115:22: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'const char [2]') 115 | cout<<mn<<" "<<mx<endl; | ~~~~~~~~~~~~~~~~~^ | | | std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1224: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>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1317: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>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:4:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:4:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ 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:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ 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/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:4:14: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 4 | #define endl "\n" | ^~~~ a.cc:115:23: note: in expansion of macro 'endl' 115 | cout<<mn<<" "<<mx<endl; | ^~~~ /usr/include/c++/14/st
s968389776
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> V(N); for(int i=0;i<N;i++){ cin >> V.at(i); V.at(i)/=400; } vector<int> Clr(9,0); for(int i=0;i<N;i++){ int x=V.at(i); Clr.at(x)++; } int min=0; for(int j=0;j<8;j++){ int y=Clr.at(j); if(y>0){ min++; } } cout << min; int Max=0; if(min==0){ Max=1; } int Max = min + Clr.at(8); cout << " " << Max << endl; }
a.cc: In function 'int main()': a.cc:29:9: error: redeclaration of 'int Max' 29 | int Max = min + Clr.at(8); | ^~~ a.cc:25:9: note: 'int Max' previously declared here 25 | int Max=0; | ^~~
s683049911
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,a,o=0; cin >> n; set<int> b; for(int i = 0;i < n;i++) { cin >> a; if(a / 400 > 7) { o++; } else { b.insert(a / 400); } } int mn = max(1,b.size()); cout << mn << ' ' << b.size() + o << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:21: error: no matching function for call to 'max(int, std::set<int>::size_type)' 20 | int mn = max(1,b.size()); | ~~~^~~~~~~~~~~~ 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:20:21: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<int>::size_type' {aka 'long unsigned int'}) 20 | int mn = max(1,b.size()); | ~~~^~~~~~~~~~~~ /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:20:21: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | int mn = max(1,b.size()); | ~~~^~~~~~~~~~~~
s827060614
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,a,o=0; cin >> n; set<int> b; for(int i = 0;i < n;i++) { cin >> a; if(a / 400 > 7) { o++; } else { s.insert(a / 400); } } int mn = max(1,s.size()); cout << mn << ' ' << s.size() + o << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:25: error: 's' was not declared in this scope 17 | s.insert(a / 400); | ^ a.cc:20:24: error: 's' was not declared in this scope 20 | int mn = max(1,s.size()); | ^
s938338234
p03695
C++
using namespace std; #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n; cin >> n; map<int, int> m; for(int i = 0; i < n; i++){ int a; cin >> a; if(a <= 399) m[1]++; else if(a <= 799) m[2]++; else if(a <= 1199) m[3]++; else if(a <= 1599) m[4]++; else if(a <= 1999) m[5]++; else if(a <= 2399) m[6]++; else if(a <= 2799) m[7]++; else if(a <= 3199) m[8]++; else m[9]++; } int min = m.size(); int max = m.size(); if(m[9]){ min -= 1; max += m[9] - 1; } cout << min << " " << max << endl; }
a.cc: In function 'int main()': a.cc:8:12: error: 'cin' was not declared in this scope 8 | int n; 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 | using namespace std; a.cc:9:5: error: 'map' was not declared in this scope 9 | map<int, int> m; | ^~~ a.cc:1:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' +++ |+#include <map> 1 | using namespace std; a.cc:9:9: error: expected primary-expression before 'int' 9 | map<int, int> m; | ^~~ a.cc:12:22: error: 'm' was not declared in this scope 12 | if(a <= 399) m[1]++; | ^ a.cc:13:27: error: 'm' was not declared in this scope 13 | else if(a <= 799) m[2]++; | ^ a.cc:14:28: error: 'm' was not declared in this scope 14 | else if(a <= 1199) m[3]++; | ^ a.cc:15:28: error: 'm' was not declared in this scope 15 | else if(a <= 1599) m[4]++; | ^ a.cc:16:28: error: 'm' was not declared in this scope 16 | else if(a <= 1999) m[5]++; | ^ a.cc:17:28: error: 'm' was not declared in this scope 17 | else if(a <= 2399) m[6]++; | ^ a.cc:18:28: error: 'm' was not declared in this scope 18 | else if(a <= 2799) m[7]++; | ^ a.cc:19:28: error: 'm' was not declared in this scope 19 | else if(a <= 3199) m[8]++; | ^ a.cc:20:14: error: 'm' was not declared in this scope 20 | else m[9]++; | ^ a.cc:22:15: error: 'm' was not declared in this scope 22 | int min = m.size(); | ^ a.cc:28:5: error: 'cout' was not declared in this scope 28 | cout << min << " " << max << endl; | ^~~~ a.cc:28:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:34: error: 'endl' was not declared in this scope 28 | cout << min << " " << 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 | using namespace std;
s032715370
p03695
C++
#include<bits/stdc++.h> using namespace sdt; int main(){ int N; cin>>N; vector<int>a(N); vector<int>mark(9); for(int i=0;i<N;i++){ cin>>a.at(i); int A=a.at(i); if(A/400<8){ if(mark.at(A/400)==0){ mark.at(A/400)=1; } } else{ mark.at(8)=mark.at(8)+1; } } int sum=0; for(int i=0;i<9;i++){ sum=sum+mark.at(i); } cout<<min(sum,8)<<endl; }
a.cc:2:17: error: 'sdt' is not a namespace-name 2 | using namespace sdt; | ^~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>N; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int>a(N); | ^~~~~~ a.cc:6:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:6:10: error: expected primary-expression before 'int' 6 | vector<int>a(N); | ^~~ a.cc:7:10: error: expected primary-expression before 'int' 7 | vector<int>mark(9); | ^~~ a.cc:9:10: error: 'a' was not declared in this scope 9 | cin>>a.at(i); | ^ a.cc:12:10: error: 'mark' was not declared in this scope 12 | if(mark.at(A/400)==0){ | ^~~~ a.cc:17:7: error: 'mark' was not declared in this scope 17 | mark.at(8)=mark.at(8)+1; | ^~~~ a.cc:22:13: error: 'mark' was not declared in this scope 22 | sum=sum+mark.at(i); | ^~~~ a.cc:24:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 24 | cout<<min(sum,8)<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:24:9: error: 'min' was not declared in this scope; did you mean 'std::min'? 24 | cout<<min(sum,8)<<endl; | ^~~ | 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: /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:24:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 24 | cout<<min(sum,8)<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s572187189
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int> data(n); for (int i=0;i<n;i++){ cin>>data.at(i); } int c,r; c=0; r=0; for (int k=0;k<=7;k++){ for (int i=0;i<n;i++){ if (400*k<=data.at(i) and data.at(i)<400*(k+1)){ c++; break; } } } for (int i=0;i<n;i++){ if (data.at(i)>=3200){ r++; } } int big,small; big=c+r; small=max(1,c); cout<<min<<" "<<max<<endl; }
a.cc: In function 'int main()': a.cc:42:7: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 42 | cout<<min<<" "<<max<<endl; | ~~~~^~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]
s995516081
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int> data(n); for (int i=0;i<n;i++){ cin>>data.at(i); } int c,r; c=0; r=0; for (int k=0;k<=7;k++){ for (int i=0;i<n;i++){ if (400*k<=data.at(i) and data.at(i)<400*(k+1)){ c++; break; } } } for (int i=0;i<n;i++){ if (data.at(i)>=3200){ r++; } } int max,min; max=c+r; min=max(1,c); cout<<min<<" "<<max<<endl; }
a.cc: In function 'int main()': a.cc:40:10: error: 'max' cannot be used as a function 40 | min=max(1,c); | ~~~^~~~~
s781455958
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair<int,int> P; int main(){ int n; cin >> n; map<int,int> mp; int free = 0; rep(i,n) { int a; cin >> a; if (a < 400) mp[0] = 1; else if (a < 800) mp[1] = 1; else if (a < 1200) mp[2] = 1; else if (a < 1600) mp[3] = 1; else if (a < 2000) mp[4] = 1; else if (a < 2400) mp[5] = 1; else if (a < 2800) mp[6] = 1; else if (a < 3200) mp[7] = 1; else free++; } cout << (!mp.empty() ? mp.size() : 1) << " " << mp.size() + free << endl; return 0;
a.cc: In function 'int main()': a.cc:27:12: error: expected '}' at end of input 27 | return 0; | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s932034827
p03695
C++
#include<iostream> #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <iomanip>//setprecision #include<math.h> #include <functional> #include<climits> using namespace std; #define rep(i, n) for(int i=0; i<(int)(n); ++i) int main(){ int a,b,e,d=0;cin>>a; vector<int>c(9); rep(i,9)c[i]=0; rep(i,a){ cin>>b; e=b/400; if(e!<10)c[8]++; else c[e]++; } rep(i,8){ if(c[i]!=0)d++; } if(d==0)d++; cout<<d<<" "<<d+c[8]; }
a.cc: In function 'int main()': a.cc:31:5: error: expected ')' before '!' token 31 | if(e!<10)c[8]++; | ~ ^ | )
s494399752
p03695
C++
#include<iostream> #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <iomanip>//setprecision #include<math.h> #include <functional> #include<climits> using namespace std; #define rep(i, n) for(int i=0; i<(int)(n); ++i) int main(){ int a,b,e,d=0;cin>>a; vector<int>c(9); rep(i,9)c[i]=0; rep(i,a){ cin>>b; e=b/400; if(e!<10)c[9]++; else c[e]++; } rep(i,8){ if(c[i]!=0)d++; } if(d==0)d++; cout<<d<<" "<<d+c[8]; }
a.cc: In function 'int main()': a.cc:31:5: error: expected ')' before '!' token 31 | if(e!<10)c[9]++; | ~ ^ | )
s185260627
p03695
C++
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() #define allr(v) v.rbegin(), v.rend() int main() { int n; cin >> n; vector<int> a(n); rep(i, n) cin >> a[i]; vector<int> color(8, 0); int m = 0; rep(i, n) { if (a[i] >= 3200) { m++; continue; } else { color[a[i]/400]++; } } int mn = 0; for (int i = 0; i < 8; i++) { if (color[i] > 0) { mn++; } } cout << max(min, 1) << endl << mn+m << endl; return 0; }
a.cc: In function 'int main()': a.cc:33:14: error: no matching function for call to 'max(<unresolved overloaded function type>, int)' 33 | cout << max(min, 1) << endl << mn+m << endl; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:2: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const int&' 257 | max(const _Tp& __a, const _Tp& __b) | ~~~~~~~~~~~^~~ /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:33:14: note: couldn't deduce template parameter '_Tp' 33 | cout << max(min, 1) << endl << mn+m << endl; | ~~~^~~~~~~~
s997191058
p03695
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() #define rep(i,n) for(ll i=0;i<(ll)(n);i++) using namespace std; typedef long long ll; ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a*b/gcd(a,b);} int main(){ ll n; cin>>n; ll rate[9]={},a; rep(i,n){ cin>>a; rate[min(a/400,8)]++; } ll cnt=0; rep(i,8){ if(rate[i]!=0) cnt++; } cout<<cnt<<' '<<min(8,cnt+rate[8])<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: no matching function for call to 'min(ll, int)' 15 | rate[min(a/400,8)]++; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:15:17: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 15 | rate[min(a/400,8)]++; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 15 | rate[min(a/400,8)]++; | ~~~^~~~~~~~~ a.cc:21:24: error: no matching function for call to 'min(int, ll)' 21 | cout<<cnt<<' '<<min(8,cnt+rate[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:21:24: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 21 | cout<<cnt<<' '<<min(8,cnt+rate[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:21:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 21 | cout<<cnt<<' '<<min(8,cnt+rate[8])<<endl; | ~~~^~~~~~~~~~~~~~~
s084778923
p03695
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; #define rep(i,m,n) for(int i=(int)(m);i<(int)(n);++i) #define rREP(i,m,n) for(int (i)=(n)-1; (i)>=(m);--(i)) #define all(x) (x).begin(),(x).end() #define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w) constexpr int INF = 1000000001; constexpr ll mod = 1000000007; constexpr double PI = 3.1415926535897932; template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } int main() { init(); int N; cin >> N; vector<int>a(N); rep(i, 0, N)cin >> a[i]; vector<int>vec(8, 0); int cnt = 0; rep(i, 0, N) { int x = a[i] / 400; if (x >= 8)++cnt; else vec[x]++; } int mn = 0, mx = 0; rep(i, 0, 8) { if (vec[i] == 0)mx++; else mn++; } cout << max(mn, 1) << " " << mn + cnt << "\n"; return 0; }#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; #define rep(i,m,n) for(int i=(int)(m);i<(int)(n);++i) #define rREP(i,m,n) for(int (i)=(n)-1; (i)>=(m);--(i)) #define all(x) (x).begin(),(x).end() #define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w) constexpr int INF = 1000000001; constexpr ll mod = 1000000007; constexpr double PI = 3.1415926535897932; template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } int main() { init(); int N; cin >> N; vector<int>a(N); rep(i, 0, N)cin >> a[i]; vector<int>vec(8, 0); int cnt = 0; rep(i, 0, N) { int x = a[i] / 400; if (x >= 8)++cnt; else vec[x]++; } int mn = 0, mx = 0; rep(i, 0, 8) { if (vec[i] == 0)mx++; else mn++; } cout << max(mn, 1) << " " << mn + cnt << "\n"; return 0; }
a.cc:54:2: error: stray '#' in program 54 | }#include<bits/stdc++.h> | ^ a.cc:54:3: error: 'include' does not name a type 54 | }#include<bits/stdc++.h> | ^~~~~~~ a.cc:62:15: error: redefinition of 'constexpr const int INF' 62 | constexpr int INF = 1000000001; | ^~~ a.cc:9:15: note: 'constexpr const int INF' previously defined here 9 | constexpr int INF = 1000000001; | ^~~ a.cc:63:14: error: redefinition of 'constexpr const ll mod' 63 | constexpr ll mod = 1000000007; | ^~~ a.cc:10:14: note: 'constexpr const ll mod' previously defined here 10 | constexpr ll mod = 1000000007; | ^~~ a.cc:64:18: error: redefinition of 'constexpr const double PI' 64 | constexpr double PI = 3.1415926535897932; | ^~ a.cc:11:18: note: 'constexpr const double PI' previously defined here 11 | constexpr double PI = 3.1415926535897932; | ^~ a.cc:66:30: error: redefinition of 'template<class T> bool chmin(T&, T)' 66 | template<class T>inline bool chmin(T& a, T b) { | ^~~~~ a.cc:13:30: note: 'template<class T> bool chmin(T&, T)' previously declared here 13 | template<class T>inline bool chmin(T& a, T b) { | ^~~~~ a.cc:73:30: error: redefinition of 'template<class T> bool chmax(T&, T)' 73 | template<class T>inline bool chmax(T& a, T b) { | ^~~~~ a.cc:20:30: note: 'template<class T> bool chmax(T&, T)' previously declared here 20 | template<class T>inline bool chmax(T& a, T b) { | ^~~~~ a.cc:80:13: error: redefinition of 'void init()' 80 | inline void init() { | ^~~~ a.cc:27:13: note: 'void init()' previously defined here 27 | inline void init() { | ^~~~ a.cc:86:5: error: redefinition of 'int main()' 86 | int main() { | ^~~~ a.cc:33:5: note: 'int main()' previously defined here 33 | int main() { | ^~~~
s420161410
p03695
C++
#include<iostream> #include<string> #include<vector> #include<utility> #include<algorithm> #include<map> #include<cstdlib> #include<cmath> #include<numeric> #include<iomanip> using namespace std; using ll =long long; const int MOD = 1000000007; int main() { ll N; vector<ll>a; cin >> N; ll c; map<ll,ll > value; ll joker = 0; ll color = 0; for (ll i = 0; i < N; i++) { cin >> c; a.push_back(c); } for (ll i =0; i<N;i++) { if (a[i] / 400 >= 8) { joker++; } else { value[a[i]/400]++; } } for (ll i = 0; i <= 7; i++) { if (value[i] != 0) { color++; } } if (color == 0) { cout << 1<<" "; } else { cout << color<<" "; } color += joker; if (color >= 9) { color = 8; } cout << color;
a.cc: In function 'int main()': a.cc:60:23: error: expected '}' at end of input 60 | cout << color; | ^ a.cc:15:12: note: to match this '{' 15 | int main() { | ^
s230163308
p03695
C++
#include<bits/stdc++.h> #define _GLIBCXX_DEBUG #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #define bg begin() #define ed end() #define all(x) x.bg,x.ed #define pb push_back #define pf push_front #define eb emplace_back using namespace std; typedef long long ll; template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;} template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;} template<class t> using vc=vector<t>; template<class t> using vvc=vc<vc<t>>; using pi=pair<int,int>; using vi=vc<int>; void yes(){ cout << "Yes" << endl; } void no(){ cout << "No" << endl; } int SIZE(string s){return (int)s.size();} const long long INF = 1LL << 60; int main(){ cout << fixed << setprecision(20); int n; cin >> n; vc<bool> ch(8,false); int cnt = 0; rep(i,n){ int x; cin >> x; if(x >= 3200) cnt++; else ch[x/400] = true; } int ans = accumulate(all(ch), 0); cout << max(ans, 1) << " " << min(ans+cnt) << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:38: error: no matching function for call to 'min(int)' 37 | cout << max(ans, 1) << " " << min(ans+cnt) << endl; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: 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:37:38: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | cout << max(ans, 1) << " " << min(ans+cnt) << 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
s704848059
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; set<int>S; int a=0; for(int i=0;i<N;i++){ int x; cin>>x; if(1<=x && x<=399) S.insert(1); else if(x<=799) S.insert(2); else if(x<=1199) S.insert(3); else if(x<=1599) S.insert(4); else if(x<=1999) S.insert(5); else if(x<=2399) S.insert(6); else if(x<=2799) S.insert(7); else if(x<=3199) S.insert(8); else a++; } int Min=min(S.size(),1); int n=S.size(); int Max=min(n+a,8); cout<<Min<<" "<<Max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:31:16: error: no matching function for call to 'min(std::set<int>::size_type, int)' 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:31:16: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ /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:31:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~
s840430836
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; set<int>S; int a=0; for(int i=0;i<N;i++){ int x; cin>>x; if(1<=x && x<=399) S.insert(1); else if(x<=799) S.insert(2); else if(x<=1199) S.insert(3); else if(x<=1599) S.insert(4); else if(x<=1999) S.insert(5); else if(x<=2399) S.insert(6); else if(x<=2799) S.insert(7); else if(x<=3199) S.insert(8); else a++; } int Min=min(S.size(),1); int Max=min(S.size()+a,8); cout<<Min<<" "<<Max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:31:16: error: no matching function for call to 'min(std::set<int>::size_type, int)' 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:31:16: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ /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:31:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ a.cc:32:14: error: no matching function for call to 'min(std::set<int>::size_type, int)' 32 | int Max=min(S.size()+a,8); | ~~~^~~~~~~~~~~~~~ /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:32:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 32 | int Max=min(S.size()+a,8); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /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:32:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 32 | int Max=min(S.size()+a,8); | ~~~^~~~~~~~~~~~~~
s337745324
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; set<int>S; int a=0; for(int i=0;i<N;i++){ int x; cin>>x; if(1<=x && x<=399) S.insert(1); else if(x<=799) S.insert(2); else if(x<=1199) S.insert(3); else if(x<=1599) S.insert(4); else if(x<=1999) S.insert(5); else i(x<=2399) S.insert(6); else if(x<=2799) S.insert(7); else if(x<=3199) S.insert(8); else a++; } int Min=min(S.size(),1); int Max=min(S.size()+a,8); cout<<Min<<" "<<Max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:21:11: error: 'i' cannot be used as a function 21 | else i(x<=2399) | ~^~~~~~~~~ a.cc:23:5: error: 'else' without a previous 'if' 23 | else if(x<=2799) | ^~~~ a.cc:31:16: error: no matching function for call to 'min(std::set<int>::size_type, int)' 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:31:16: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ /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:31:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 31 | } int Min=min(S.size(),1); | ~~~^~~~~~~~~~~~ a.cc:32:14: error: no matching function for call to 'min(std::set<int>::size_type, int)' 32 | int Max=min(S.size()+a,8); | ~~~^~~~~~~~~~~~~~ /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:32:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 32 | int Max=min(S.size()+a,8); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /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:32:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 32 | int Max=min(S.size()+a,8); | ~~~^~~~~~~~~~~~~~
s737284548
p03695
C++
#include <bits/stdc++.h> // #define fi first // #define se second #define rep(i, n) for (ll i=0;i<(n); i++) #define ALL(v) (v).begin(), (v).end() #define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i) 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 (a>b) { a=b; return 1; } return 0; } using namespace std; typedef long long ll; typedef pair<ll, ll> pi; const ll M=1000000007ll; const ll MOD=1000000007ll; const ll MAX=100000001ll; //const ll M = 1000000000+7; const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x=0):x((x%mod+mod)%mod){} mint operator-() const { return mint(-x);} mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod-a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res+=a; } mint operator-(const mint a) const { mint res(*this); return res-=a; } mint operator*(const mint a) const { mint res(*this); return res*=a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t>>1); a *= a; if (t&1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod-2); } mint& operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res/=a; } }; mint f(ll n){ if(n==0) return 1; mint ans = f(n/2); ans *= ans; if(n%2==1) ans*= 2; return ans; } mint choose(ll n, ll k){ mint x=1, y=1; rep(i,k){ x *= (n-i); y *= (i+1); } return x / y; } struct BIT { private: vector<ll> bit; ll N; public: BIT(ll size) { N = size; bit.resize(N + 1); } // 一点更新です void add(ll a, ll w) { for (ll x = a; x <= N; x += x & -x) bit[x] += w; } // 1~Nまでの和を求める。 int sum(ll a) { ll ret = 0; for (ll x = a; x > 0; x -= x & -x) ret += bit[x]; return ret; } }; ll fff(ll n, vector<ll>& v, ll i, ll j, ll rl){ ll can = 0; ll can_i = 0; cout << v[0]<<endl; // right if(rl == 0){ rep(k, n){ if(v[k]*(j-k)>can){ can = v[k]*(j-k); can_i = k; } //cout << can<<endl; } v[can_i] = 0; return can; } // left else{ rep(k, n){ if(v[k]*(k-i)>can){ can = v[k]*(k-i); can_i = k; } //cout << can<<endl; } v[can_i] = 0; return can; } } int main(){ ll n; cin>>n; vector<ll> v(n); set<ll> s = {-1}; ll tmp, cnt=0; rep(i, n){ cin>>tmp; if(tmp>=3200) { cnt++; } else { s.insert(tmp / 400); } } ll maxi = s.size() - 1 + cnt; cout << s.size() - 1 << " " << max(1, min(1LL*8, maxi)) <<endl; }
a.cc: In function 'int main()': a.cc:168:37: error: no matching function for call to 'max(int, const long long int&)' 168 | cout << s.size() - 1 << " " << max(1, min(1LL*8, maxi)) <<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:168:37: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 168 | cout << s.size() - 1 << " " << max(1, min(1LL*8, maxi)) <<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:168:37: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 168 | cout << s.size() - 1 << " " << max(1, min(1LL*8, maxi)) <<endl; | ~~~^~~~~~~~~~~~~~~~~~~~~
s578831020
p03695
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n; cin >> n; int a[110]; int b[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; for (int i=0; i<n; i++){ cin >> a[i]; b[a[i]/400]++; } int max = 0, min = 0; for (int i=0; i<13; i++){ if (b[i]>0 && i<8){ max++; min++; } if (b[i]>0 && i>=8){ max += b[i]; } } if (c==0){ c = 1; } cout << min << " " << max << endl; }
a.cc: In function 'int main()': a.cc:27:7: error: 'c' was not declared in this scope 27 | if (c==0){ | ^
s381808791
p03695
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n; cin >> n; int a[110]; int b[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; for (int i=0; i<n; i++){ cin >> a[i]; b[a[i]/400]++; } int max = 0, min = 0; for (int i=0; i<13; i++){ if (b[i]>0 && i<8){ max++; min++; } if (b[i]>0 && i>=8){ max += b[i]; } } if (max>8){ max = 8; } cout << min << " " << max << endl; }
a.cc: In function 'int main()': a.cc:10:43: error: too many initializers for 'int [13]' 10 | int b[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ^
s960715959
p03695
C++
#include<bits/stdc++.h> using namespace std; #define f(i,a,b) for(int i=(int)(a);i<=(int)(b);i++) #define char_f(i,a) for(int i=(int)(a);(char)s[i]!='\0';i++) #define rf(i,a,b) for(int i=(int)(a);i>=(int)(b);i--) #define llf(i,a,b) for(long long int i=(long long int)(a);i<=(long long int)(b);i++) #define llrf(i,a,b) for(long long int i=(long long int)(a);i>=(long long int)(b);i--) #define ll long long #define fi first #define se second #define pb push_back #define pop pop_back #define mem(ara) memset((ara),0,sizeof(ara)) #define memn(ara) memset((ara),-1,sizeof(ara)) #define bb begin() #define ee end() #define em emplace #define eb emplace_back #define si set<int> #define sd set<double> #define sll set<long long int> #define ss set<string> #define sc set<char> #define pii pair<int,int> #define pli pair<long long int,int> #define pil pair<int,long long int> #define pll pair<long long int,long long int> #define pci pair<char,int> #define pic pair<int,char> #define pcl pair<char,long long int> #define plc pair<long long int,char> #define pss pair<string,string> #define pcc pair<char,char> #define pis pair<int,string> #define psi pair<string,int> #define pls pair<long long int,string> #define psl pair<string,long long int> #define pdd pair<double,double> #define pcs pair<char,string> #define psc pair<string,char> #define vi vector<int> #define vll vector<long long int> #define vd vector<double> #define vs vector<string> #define vc vector<char> #define vii vector<pii> #define mod 1000000007 #define mx (1<<30)-1 #define llmx (1ll<<62) #define n_size 100005 #define g_size 10000005 double PI=acos(-1); ///unsigned int uMAX=4294967295; ///unsigned ll int ullMAX=18446744073709551615; int arr[g_size]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n,m,T,res; int maxi=-mx,mini=mx,count=0,x=0; int i,j,k; bool flag; string s1,s2; char s[100000]; int ara[n_size],ara2[n_size]; cin>>n; f(i,0,n-1) { cin>>m; if(m>=1 && m<=399) arr[0]++; else if(m>=400 && m<=799) arr[1]++; else if(m>=800 && m<=1199) arr[2]++;; else if(m>=1200 && m<=1599) arr[3]++;; else if(m>=1600 && m<=1999) arr[4]++;; else if(m>=2000 && m<=2399) arr[5]++;; else if(m>=2400 && m<=2799) arr[6]++;; else if(m>=2800 && m<=3199) arr[7]++;; else if(m>=3200) x++; } f(i,0,7) { count+=(arr[i]!=0); } cout<<count<<" "<<count+x<<endl; }
a.cc: In function 'int main()': a.cc:115:9: error: 'else' without a previous 'if' 115 | else if(m>=1200 && m<=1599) arr[3]++;; | ^~~~ a.cc:116:9: error: 'else' without a previous 'if' 116 | else if(m>=1600 && m<=1999) arr[4]++;; | ^~~~ a.cc:117:9: error: 'else' without a previous 'if' 117 | else if(m>=2000 && m<=2399) arr[5]++;; | ^~~~ a.cc:118:9: error: 'else' without a previous 'if' 118 | else if(m>=2400 && m<=2799) arr[6]++;; | ^~~~ a.cc:119:9: error: 'else' without a previous 'if' 119 | else if(m>=2800 && m<=3199) arr[7]++;; | ^~~~ a.cc:120:9: error: 'else' without a previous 'if' 120 | else if(m>=3200) x++; | ^~~~
s125323949
p03695
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0; i < n; i++) #define REPR(i, n) for(int i = n; i >= 0; i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define INF 1e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main(){ ll n; cin >> n; vector<int>a(n, 0); vector<int>ct(8, 0); REP(i, n) cin >> a[i]; int redct = 0; REP(i, n){ if (a[i] >= 3200){ redct++; continue; } ct[a[i] / 400]++; } int minct = 0; REP(i, 8){ if (ct[i] > 0) minct++; } cout << max(minct, 1) << " " << min(minct + redct, n) << endl; }
a.cc: In function 'int main()': a.cc:33:40: error: no matching function for call to 'min(int, ll&)' 33 | cout << max(minct, 1) << " " << min(minct + redct, n) << endl; | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:33:40: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 33 | cout << max(minct, 1) << " " << min(minct + redct, n) << endl; | ~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:33:40: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 33 | cout << max(minct, 1) << " " << min(minct + redct, n) << endl; | ~~~^~~~~~~~~~~~~~~~~~
s768626262
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(int i=0; i<(n); i++) template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int main(){ vector<ll> color(9); ll n; cin>>n; rep(i,n){ ll a; cin>>a; chmin(a, 3599); color[a/400]++; } ll res=0; rep(i,8){ if(color[i]>0) res++; } cout<<res<<' '<<res+color[8]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:14: error: no matching function for call to 'chmin(ll&, int)' 12 | chmin(a, 3599); | ~~~~~^~~~~~~~~ a.cc:5:31: note: candidate: 'template<class T> bool chmin(T&, T)' 5 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } | ^~~~~ a.cc:5:31: note: template argument deduction/substitution failed: a.cc:12:14: note: deduced conflicting types for parameter 'T' ('long long int' and 'int') 12 | chmin(a, 3599); | ~~~~~^~~~~~~~~
s872690001
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0;i<n;i++) using ll = long long; using P = pair<ll,ll>; int main(){ int n;cin>>n; vector<int> v(n); rep(i,n){ cin>>v.at(i); } vector<int> color(8,0); int other=0; rep(i,n){ if (0<=v.at(i) && v.at(i) <= 399){ color.at(0)++; } else if (400<=v.at(i) && v.at(i)<=799){ color.at(1)++; } else if (800<=v.at(i) && v.at(i)<=1199){ color.at(2)++; } else if (1200<=v.at(i) && v.at(i)<=1599){ color.at(3)++; } else if (1600<=v.at(i) && v.at(i)<=1999){ color.at(4)++; } else if (2000<=v.at(i) && v.at(i)<=2399){ color.at(5)++; } else if (2400<=v.at(i) && v.at(i)<=2799){ color.at(6)++; } else if (2800<=v.at(i) && v.at(i)<=3199){ color.at(7)++; } else if (3200<=v.at(i)){ other++; } } int sum=0; rep(i,8){ if (color.at(i) > 0){ sum++; } } if (sum<=other){ if (sum==0 || sum == 1){ cout << 1 << " " << sum + other << endl; } else{ cout << sum << " " << sum + other << endl; } else { cout << sum << " " << sum + other << endl; } }
a.cc: In function 'int main()': a.cc:57:3: error: expected '}' before 'else' 57 | else { | ^~~~ a.cc:50:18: note: to match this '{' 50 | if (sum<=other){ | ^
s283117925
p03695
C++
#include<iostream> #include<string> #include<vector> #include<iomanip> #include<algorithm> #include<queue> #include<stack> #include<list> #include<map> #include<deque> #include<cctype> #include<math.h> using namespace std; #define ll long long int main(){ ll N; cin >> N; ll i,a; ll color[8],t1=0,t2=0; for(i=0;i<8;i++){ color[i]=0; } for(i=0;i<N;i++){ cin >>a; if(a<3200)color[a/400]=1;else t2++; } for(i=0;i<8;i++){ t1+=color[i]; } cout << max(t1,1) <<" "<< t1+t2 <<endl; return 0; }
a.cc: In function 'int main()': a.cc:30:16: error: no matching function for call to 'max(long long int&, int)' 30 | cout << max(t1,1) <<" "<< t1+t2 <<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:30:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 30 | cout << max(t1,1) <<" "<< t1+t2 <<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:5: /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:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 30 | cout << max(t1,1) <<" "<< t1+t2 <<endl; | ~~~^~~~~~
s939942960
p03695
C++
n = int(input()) a = list(map(int,input().split())) color_n = [0 for i in range(9)] for i in a: if 1 <= i <= 399: color_n[0] += 1 elif 400 <= i <= 799: color_n[1] += 1 elif 800 <= i <= 1199: color_n[2] += 1 elif 1200 <= i <= 1599: color_n[3] += 1 elif 1600 <= i <= 1999: color_n[4] += 1 elif 2000 <= i <= 2399: color_n[5] += 1 elif 2400 <= i <= 2799: color_n[6] += 1 elif 2800 <= i <= 3199: color_n[7] += 1 else: color_n[8] += 1 print(max(8-color_n[:-1].count(0), 1),8-color_n[:-1].count(0)+color_n[-1]) n = int(input()) a = list(map(int,input().split())) color_n = [0 for i in range(9)] for i in a: if 1 <= i <= 399: color_n[0] += 1 elif 400 <= i <= 799: color_n[1] += 1 elif 800 <= i <= 1199: color_n[2] += 1 elif 1200 <= i <= 1599: color_n[3] += 1 elif 1600 <= i <= 1999: color_n[4] += 1 elif 2000 <= i <= 2399: color_n[5] += 1 elif 2400 <= i <= 2799: color_n[6] += 1 elif 2800 <= i <= 3199: color_n[7] += 1 else: color_n[8] += 1 print(max(8-color_n[:-1].count(0), 1),8-color_n[:-1].count(0)+color_n[-1])
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s336877655
p03695
C
#include<stdio.h> int main(){ int i,N; int a[4801]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&a[i]); } int r[100]={0}; int num=0; for(i=0;i<N;i++){ if(a[i]<400){ r[i]=1; } else if(a[i]>=400&&a[i]<800){ r[i]=2; } else if(a[i]>=800&&a[i]<1200){ r[i]=3; } else if(a[i]>=1200&&a[i]<1600){ r[i]=4; } else if(a[i]>=1600&&a[i]<2000){ r[i]=5; } else if(a[i]>=2000&&a[i]<2400){ r[i]=6; } else if(a[i]>=2400&&a[i]<2800){ r[i]=7; } else if(a[i]>=2800&&a[i]<3200){ r[i]=8; } else{ num++; } } int j,tmp; for(i=0;i<N;i++){ for(j=i+1;j<N;j++){ if(r[i]<r[j]){ tmp=r[i]; r[i]=r[j]; r[j]=tmp; } } } int count =1; for(i=1;i<=N;i++){ //printf("%d",r[i-1]); if(r[i]==0){ } else if(r[i]<r[i-1]){ count++; } } if(r[N]==0){ printf("\n%d %d",count,num); } else if{ printf("\n%d %d",count,count+num); } }
main.c: In function 'main': main.c:62:10: error: expected '(' before '{' token 62 | else if{ | ^ | (
s139746311
p03695
C++
#include<bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using ull = unsigned long long; int main(){ ll n; cin >> n; vector<ll> a(n); rep(i,n) cin >> a.at(i); vector<ll> f(8); ll x = 0; for(int i=0;i<n;i++){ if(a.at(i) < 400 ) f.at(0) = 1; else if( a.at(i) < 800 ) f.at(1) = 1; else if( a.at(i) < 1200 ) f.at(2) = 1; else if( a.at(i) < 1600 ) f.at(3) = 1; else if( a.at(i) < 2000 ) f.at(4) = 1; else if( a.at(i) < 2400 ) f.at(5) = 1; else if( a.at(i) < 2800 ) f.at(6) = 1; else if( a.at(i) < 3200 ) f.at(7) = 1; else x++; } ll ans = 0; rep(i,8) ans += f.at(i); cout << max(ans,1) << " " << ans+x << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:14: error: no matching function for call to 'max(ll&, int)' 27 | cout << max(ans,1) << " " << ans+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: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:27:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 27 | cout << max(ans,1) << " " << ans+x << 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:27:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 27 | cout << max(ans,1) << " " << ans+x << endl; | ~~~^~~~~~~
s022123320
p03695
C++
#include <iostream> #include <vector> int main(){ int n,ans,a,tmp; cin >> n; vector<int> col(9); for(int i=0;i < n;i++){ cin >> tmp; col[tmp / 400] += 1; } for(int i = 0;i < 9;i++){ if (i != 8) ans += col[i] cout << ans << " "; if (i == 8) ans += col[i] cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int> col(9); | ^~~~~~ a.cc:6:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:6:10: error: expected primary-expression before 'int' 6 | vector<int> col(9); | ^~~ a.cc:9:5: error: 'col' was not declared in this scope 9 | col[tmp / 400] += 1; | ^~~ a.cc:12:28: error: 'col' was not declared in this scope 12 | if (i != 8) ans += col[i] | ^~~ a.cc:14:24: error: 'col' was not declared in this scope 14 | if (i == 8) ans += col[i] | ^~~
s514900745
p03695
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(int argc, char **argv) { int n; cin >> n; set<int> s; int over_num{0}; for (int i = 0; i < n; ++i) { int a; cin >> a; if (a >= 3200) ++over_num; else { s.insert(a/400); } } int max{0}, min{0}; max = static_cast<int>(s.size()) + over_num; if (s.size() == 0) min = 1; else min = static_cast<int>s.size(); std::cout << min << " " << max << std::endl; }
a.cc: In function 'int main(int, char**)': a.cc:27:39: error: expected '(' before 's' 27 | min = static_cast<int>s.size(); | ^ | ( a.cc:27:47: error: expected ')' before ';' token 27 | min = static_cast<int>s.size(); | ^ | )
s090471955
p03695
C++
#include <bits/stdc++.h> using namespace std; //#define rep(i,n) for (int i=0;i<(n);++i) int main(){ //srandom((unsigned long)time(NULL)); int n; cin>>n; //vector<int> a; vector<int> cont; for(int i=0;i<9;i++){ cont.emplace_back(0); } for(int i=0;i<n;i++){ int x; cin>>x; if(x<400)cont[0]++; if(400<=x && x<800)cont[1]++; if(800<=x && x<1200)cont[2]++; if(1200<=x && x<1600)cont[3]++; if(1600<=x && x<2000)cont[4]++; if(2000<=x && x<2400)cont[5]++; if(2400<=x && x<2800)cont[6]++; if(2800<=x && x<3200)cont[7]++; if(3200<=x)cont[8]++; } int ans=0; for(int i=0;i<8;i++){ if(cont[i]!=0)ans++; } int mx=0; mx=ans+cnt[8]; if(ans==0)ans=1; cout<<ans<<" "<<mx<<endl; return 0; }
a.cc: In function 'int main()': a.cc:35:8: error: 'cnt' was not declared in this scope; did you mean 'cont'? 35 | mx=ans+cnt[8]; | ^~~ | cont
s092256569
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, b = 0; cin >> N; vector<int> a(8, 0); for (int i = 0; i < N; i++) { int c, check = 0; cin >> c; for (int j = 0; j < 8; j++) { if (c < 400*(j + 1) && check == 0) { a.at(j) = 1; check = 1; } } if (c >= 3200) { b++; } } int ans = 0; for (int i = 0; i < 8; i++) { ans += a.at(i); } cout << max(ans, 1) << " " << min(ans + b) << endl; }
a.cc: In function 'int main()': a.cc:25:36: error: no matching function for call to 'min(int)' 25 | cout << max(ans, 1) << " " << min(ans + b) << 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:25:36: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 25 | cout << max(ans, 1) << " " << min(ans + b) << 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
s523244527
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int rate[9]; for(int i = 0; i < 9; i++){ rate[i] = 0; } int n; cin >> n; for(int i = 0; i < n; i++){ int a; cin >> a; if(a/400 < 9){ rate[a/400]++; } else{ rare[8]++; } } int min_num = 0; for(int i = 0; i < 8; i++){ if(rate[i] != 0){ min_num++; } } int max_num = min_num + rate[8]; if(min_num == 0){ min_num = 1; } cout << min_num <<' ' << max_num; }
a.cc: In function 'int main()': a.cc:18:7: error: 'rare' was not declared in this scope; did you mean 'rate'? 18 | rare[8]++; | ^~~~ | rate
s866803655
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[i]; map<int, int> p; int m = 0; for (int i = 0; i < n; i++) { if (a[i] >= 1 && a[i] <= 399) p[0]++; if (a[i] >= 400 && a[i] <= 799) p[1]++; if (a[i] >= 800 && a[i] <= 1199) p[2]++; if (a[i] >= 1200 && a[i] <= 1599) p[3]++; if (a[i] >= 1600 && a[i] <= 1999) p[4]++; if (a[i] >= 2000 && a[i] <= 2399) p[5]++; if (a[i] >= 2400 && a[i] <= 2799) p[6]++; if (a[i] >= 2800 && a[i] <= 3199) p[7]++; if (a[i] >= 3200) m++; } cout << max(1, p.size()) << " " << p.size() + m << endl; }
a.cc: In function 'int main()': a.cc:26:14: error: no matching function for call to 'max(int, std::map<int, int>::size_type)' 26 | cout << max(1, p.size()) << " " << p.size() + m << 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:26:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'}) 26 | cout << max(1, p.size()) << " " << p.size() + m << 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:26:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 26 | cout << max(1, p.size()) << " " << p.size() + m << endl; | ~~~^~~~~~~~~~~~~
s584478601
p03695
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define dunk(n) cout << n << endl #define all(a) (a).begin(),(a).end() int main() { int n; cin >> n; vector<int> rate(n),color = {0,0,0,0,0,0,0,0}; rep(i,n) cin >> rate[i]; sort(all(rate)); int count = 0,free = 0; rep(i,n){ if(rate[i] < 400) color[0]++; else if(rate[i] < 800) color[1]++; else if(rate[i] < 1200) color[2]++; else if(rate[i] < 1600) color[3]++; else if(rate[i] < 2000) color[4]++; else if(rate[i] < 2400) color[5]++; else if(rate[i] < 2800) color[6]++; else if(rate[i] < 3200) color[7]++; else free++; } rep(i,8){ if(color[i] != 0) count++; } if(count != 0) cout << count << " " << min(8,count+free) << endl; else cout << 1 << " " << min(8,count+free) << endl; } }
a.cc:31:1: error: expected declaration before '}' token 31 | } | ^
s569993095
p03695
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define dunk(n) cout << n << endl #define all(a) (a).begin(),(a).end() int main() { int n; cin >> n; vector<int> rate(n),color(8) = {0,0,0,0,0,0,0,0}; rep(i,n) cin >> rate[i]; sort(all(rate)); int count = 0,free = 0; rep(i,n){ if(rate[i] < 400) color[0]++; else if(rate[i] < 800) color[1]++; else if(rate[i] < 1200) color[2]++; else if(rate[i] < 1600) color[3]++; else if(rate[i] < 2000) coler[4]++; else if(rate[i] < 2400) coler[5]++; else if(rate[i] < 2800) color[6]++; else if(rate[i] < 3200) color[7]++; else free++; } rep(i,8){ if(color[i] != 0) count++ } cout << max(count,free) << " " << min(8,count+free) << endl; }
a.cc: In function 'int main()': a.cc:10:34: error: expected ',' or ';' before '=' token 10 | vector<int> rate(n),color(8) = {0,0,0,0,0,0,0,0}; | ^ a.cc:19:33: error: 'coler' was not declared in this scope; did you mean 'color'? 19 | else if(rate[i] < 2000) coler[4]++; | ^~~~~ | color a.cc:20:33: error: 'coler' was not declared in this scope; did you mean 'color'? 20 | else if(rate[i] < 2400) coler[5]++; | ^~~~~ | color a.cc:26:34: error: expected ';' before '}' token 26 | if(color[i] != 0) count++ | ^ | ; 27 | } | ~
s806482651
p03695
C++
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const ( A = iota B C D E F G H I ) func operate(x int) int { if x < 400 { return A } else if x < 800 { return B } else if x < 1200 { return C } else if x < 1600 { return D } else if x < 2000 { return E } else if x < 2400 { return F } else if x < 2800 { return G } else if x < 3200 { return H } else { return I } } func main() { sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) sc.Scan() n, _ := strconv.Atoi(sc.Text()) a := make([]int, n) for i := range a { sc.Scan() a[i], _ = strconv.Atoi(sc.Text()) } sort.Ints(a) aggregate := make(map[int]int) for i := range a { aggregate[operate(a[i])] = aggregate[operate(a[i])] + 1 } min := len(aggregate) for k := range aggregate { if k == I { min = min - 1 break } } if min < 1 { min = 1 } max := len(aggregate) for k := range aggregate { if k == I { max = max + 1 } } if max > 8 { max = 8 } fmt.Printf("%d %d\n", min, max) }
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~ a.cc:45:1: error: 'func' does not name a type 45 | func main() { | ^~~~
s821771072
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define INF 1000000000000000000 int main(){ int N; cin >> N; vector<int> A(N); vector<int> B(9, 0); rep(i, N){ cin >> A[i]; if (A[i] <= 399) B[0] = 1; else if (A[i] <= 799) B[1] = 1; else if (A[i] <= 1199) B[2] = 1; else if (A[i] <= 1599) B[3] = 1; else if (A[i] <= 1999) B[4] = 1; else if (A[i] <= 2399) B[5] = 1; else if (A[i] <= 2799) B[6] = 1; else if (A[i] <= 3199) B[7] = 1; else B[8]++; } int sum = 0; rep(i, 8){ sum += B[i]; } int min_sum; if (sum >= 1) min_sum = sum; else min_sum = 1; sum += B[8]; cout << min_sum << " " << sum << endl;
a.cc: In function 'int main()': a.cc:33:41: error: expected '}' at end of input 33 | cout << min_sum << " " << sum << endl; | ^ a.cc:7:11: note: to match this '{' 7 | int main(){ | ^
s480661735
p03695
C++
#define _GLIBCXX_DEBUG #define rep(i,n) for(int i=0;i<n;i++) #include <bits/stdc++.h> #include <numeric> using namespace std; typedef long long ll; const int mod= 1e+9+7; int main() { int N; cin>>N; vector<int>a(N); bitset<8>b; int cnt=0; rep(i,N){ cin>>a[i]; if(a[i]>=3200){ cnt++; continue; } b.set(a[i]/400); } int bb =b.count(); cout<<bb<" "; if(bb+cnt>=8)cout<<8<<endl; else cout<<bb+cnt<<endl; }
a.cc: In function 'int main()': a.cc:23:13: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and 'const char [2]') 23 | cout<<bb<" "; | ~~~~~~~~^~~~ | | | | | const char [2] | std::basic_ostream<char> In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:3: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | cout<<bb<" "; | ^~~ /usr/include/c++/14/bits/regex.h:1224: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>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 23 | cout<<bb<" "; | ^~~ /usr/include/c++/14/bits/regex.h:1317: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>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | cout<<bb<" "; | ^~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:23:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]' 23 | cout<<bb<" "; | ^~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | cout<<bb<" "; | ^~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:23:14: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]' 23 | cout<<bb<" "; | ^~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/vector:76, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /usr/include/c++/14/debug/vector:892:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::__debug::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)' 892 | operator<(const vector<_Tp, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/debug/vector:892:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::vector<_Tp, _Alloc>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/deque:77, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:139: /usr/include/c++/14/debug/deque:690:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::__debug::operator<(const deque<_Tp, _Allocator>&, const deque<_Tp, _Allocator>&)' 690 | operator<(const deque<_Tp, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/debug/deque:690:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::deque<_Tp, _Allocator>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/list:69, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150: /usr/include/c++/14/debug/list:943:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::__debug::operator<(const list<_Tp, _Allocator>&, const list<_Tp, _Allocator>&)' 943 | operator<(const list<_Tp, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/debug/list:943:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::list<_Tp, _Allocator>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/debug/map:43, from /usr/include/c++/14/map:69, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152: /usr/include/c++/14/debug/map.h:769:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Allocator> bool std::__debug::operator<(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)' 769 | operator<(const map<_Key, _Tp, _Compare, _Allocator>& __lhs, | ^~~~~~~~ /usr/include/c++/14/debug/map.h:769:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::map<_Key, _Tp, _Compare, _Allocator>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/debug/map:44: /usr/include/c++/14/debug/multimap.h:651:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Allocator> bool std::__debug::operator<(const multimap<_Key, _Tp, _Compare, _Allocator>&, const multimap<_Key, _Tp, _Compare, _Allocator>&)' 651 | operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs, | ^~~~~~~~ /usr/include/c++/14/debug/multimap.h:651:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::multimap<_Key, _Tp, _Compare, _Allocator>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/debug/set:41, from /usr/include/c++/14/set:69, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158: /usr/include/c++/14/debug/set.h:630:5: note: candidate: 'template<class _Key, class _Compare, class _Allocator> bool std::__debug::operator<(const set<_Key, _Compare, _Allocator>&, const set<_Key, _Compare, _Allocator>&)' 630 | operator<(const set<_Key, _Compare, _Allocator>& __lhs, | ^~~~~~~~ /usr/include/c++/14/debug/set.h:630:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::set<_Key, _Compare, _Allocator>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/debug/set:42: /usr/include/c++/14/debug/multiset.h:620:5: note: candidate: 'template<class _Key, class _Compare, class _Allocator> bool std::__debug::operator<(const multiset<_Key, _Compare, _Allocator>&, const multiset<_Key, _Compare, _Allocator>&)' 620 | operator<(const multiset<_Key, _Compare, _Allocator>& __lhs, | ^~~~~~~~ /usr/include/c++/14/debug/multiset.h:620:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::multiset<_Key, _Compare, _Allocator>' 23 | cout<<bb<" "; | ^~~ In file included from /usr/include/c++/14/forward_list:45, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:175: /usr/include/c++/14/debug/forward_list:878:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::__debug::operator<(const forward_list<_Tp, _Allocator>&, const forward_list<_Tp, _Allocator>&)' 878 | operator<(const forward_list<_Tp, _Alloc>& __lx, | ^~~~~~~~ /usr/include/c++/14/debug/forward_list:878:5: note: template argument deduction/substitution failed: a.cc:23:14: note: 'std::basic_ostream<char>' is not derived from 'const std::__debug::forward_list<_Tp, _Allocator>' 23 | cout<<bb<" "; | ^~~ 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:1045:5: note: candidate: 'template<class _T1, class _T2> constexp
s516583772
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; map<string,int> mp; int others=0; for(int i=0;i<n;++i){ int a; cin >> a; if(1<= a && a<= 399) mp[gray]++; else if(400<= a && a <= 799) mp[brown]++; else if(800<= a && a <= 1199) mp[green]++; else if(1200<= a && a <= 1599) mp[skyblue]++; else if(1600<= a && a <= 1999) mp[blue]++; else if(2000<= a && a <= 2399) mp[yellow]++; else if(2400<= a && a <= 2799) mp[orange]++; else if(2800<= a && a <= 3199) mp[red]++; else others++; } int count=0; for(auto itr : mp){ count++; } int min,max = 0; min = count; if(others<=8) max = count + others; else max = count + 8; cout << min << ' ' << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:33: error: 'gray' was not declared in this scope 10 | if(1<= a && a<= 399) mp[gray]++; | ^~~~ a.cc:11:41: error: 'brown' was not declared in this scope 11 | else if(400<= a && a <= 799) mp[brown]++; | ^~~~~ a.cc:12:42: error: 'green' was not declared in this scope 12 | else if(800<= a && a <= 1199) mp[green]++; | ^~~~~ a.cc:13:43: error: 'skyblue' was not declared in this scope 13 | else if(1200<= a && a <= 1599) mp[skyblue]++; | ^~~~~~~ a.cc:14:43: error: 'blue' was not declared in this scope 14 | else if(1600<= a && a <= 1999) mp[blue]++; | ^~~~ a.cc:15:43: error: 'yellow' was not declared in this scope 15 | else if(2000<= a && a <= 2399) mp[yellow]++; | ^~~~~~ a.cc:16:43: error: 'orange' was not declared in this scope 16 | else if(2400<= a && a <= 2799) mp[orange]++; | ^~~~~~ a.cc:17:43: error: 'red' was not declared in this scope; did you mean 'read'? 17 | else if(2800<= a && a <= 3199) mp[red]++; | ^~~ | read
s145936047
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; bitset<8> C; int O = 0; for (int i = 0; i < N; i++) { int score; cin >> score; if (score < 400) C.set(0); else if (score < 800) C.set(1); else if (score < 1200) C.set(2); else if (score < 1600) C.set(3); else if (score < 2000) C.set(4); else if (score < 2400) C.set(5); else if (score < 2800) C.set(6); else if (score < 3200) C.set(7); else O++; } int mn = max(1, C.count()); printf("%d %d\n", mn, mn + O); }
a.cc: In function 'int main()': a.cc:37:21: error: no matching function for call to 'max(int, std::size_t)' 37 | int mn = max(1, C.count()); | ~~~^~~~~~~~~~~~~~ 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:37:21: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::size_t' {aka 'long unsigned int'}) 37 | int mn = max(1, C.count()); | ~~~^~~~~~~~~~~~~~ /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:37:21: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | int mn = max(1, C.count()); | ~~~^~~~~~~~~~~~~~
s198510932
p03695
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> int main(void){ int num_attendance; int *rate; int kinds_color=0; int class[9]={0}; scanf("%d",&num_attendance); rate=(int *)malloc(sizeof(int)*num_attendance); int i; for(i=0;i<num_attendance;i++){ scanf("%d",&rate[i]); if(rate[i]<=399){ class[0]++; } else if(rate[i]<=799){ class[1]++; } else if(rate[i]<=1199){ class[2]++; } else if(rate[i]<=1599){ class[3]++; } else if(rate[i]<=1999){ class[4]++; } else if(rate[i]<=2399){ class[5]++; } else if(rate[i]<=2799){ class[6]++; } else if(rate[i]<=3199){ class[7]++; } else if(3200<=rate[i]{ class[8]++; } } for(i=0;i<8;i++){ if(class[i]!=0){ kinds_color++; } } printf("%d ",kinds_color); kinds_color+=class[8]; printf("%d",kinds_color); return 0; }
main.c: In function 'main': main.c:40:30: error: expected ')' before '{' token 40 | else if(3200<=rate[i]{ | ~ ^ | ) main.c:43:5: error: expected expression before '}' token 43 | } | ^
s336575800
p03695
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main(){ int n; cin>>n; int free; vector<int> a(n),rate(8); rep(i,n){ int tmp = 0; cin >> tmp; if(tmp>=3200)free++; else if(tmp>=2800)rate.at(7)++; else if(tmp>=2400)rate.at(6)++; else if(tmp>=2000)rate.at(5)++; else if(tmp>=1600)rate.at(4)++; else if(tmp>=1200)rate.at(3)++; else if(tmp>=800)rate.at(2)++; else if(tmp>=400)rate.at(1)++; else rate.at(0)++; } int ans = 0; for(auto i : rate){ if(i!=0)ans++; } cout<<max(ans,1);<<" "<<ans+free<<endl; return 0; }
a.cc: In function 'int main()': a.cc:31:20: error: expected primary-expression before '<<' token 31 | cout<<max(ans,1);<<" "<<ans+free<<endl; | ^~
s420044739
p03695
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000000007LL; int main(){ ll n;cin>>n; vl a(n); rep(i,n)cin>>a[i]; set<ll>S; ll count=0; rep(i,n){ if(a[i]>=3200){ count++; continue; } S.insert(a[i]/400); } ll k=S.size(); cout<<S.size()<<" "<<min(8,k+count)<<endl; }
a.cc: In function 'int main()': a.cc:28:27: error: no matching function for call to 'min(int, ll)' 28 | cout<<S.size()<<" "<<min(8,k+count)<<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:3: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:28:27: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 28 | cout<<S.size()<<" "<<min(8,k+count)<<endl; | ~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:28:27: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 28 | cout<<S.size()<<" "<<min(8,k+count)<<endl; | ~~~^~~~~~~~~~~
s402039975
p03695
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000000007LL; int main(){ ll n;cin>>n; vl a(n); rep(i,n)cin>>a[i]; set<ll>S; ll count=0; rep(i,n){ if(a[i]>=3200){ count++; continue; } S.insert(a[i]/400); } cout<<S.size()<<" "<<min(8,S.size()+count)<<endl; }
a.cc: In function 'int main()': a.cc:27:27: error: no matching function for call to 'min(int, long long unsigned int)' 27 | cout<<S.size()<<" "<<min(8,S.size()+count)<<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:3: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:27:27: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long unsigned int') 27 | cout<<S.size()<<" "<<min(8,S.size()+count)<<endl; | ~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:27:27: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 27 | cout<<S.size()<<" "<<min(8,S.size()+count)<<endl; | ~~~^~~~~~~~~~~~~~~~~~
s147317373
p03695
Java
あimport java.util.Scanner; public class Main { static int n; static int[] dp; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); dp = new int[8]; //0:灰色~7:赤 int over = 0; int ans = 0; for (int i = 0; i < n; i++) { int num = sc.nextInt(); if (num >= 3200) { over++; } else { dp[num/400]++; } } for (int i = 0; i < 8; i++) { if (dp[i] != 0) { ans++; } } System.out.println(Math.max(1, ans)); System.out.println(Math.min(8, ans + over)); } }
Main.java:1: error: class, interface, enum, or record expected ?import java.util.Scanner; ^ 1 error
s253268675
p03695
C++
#include <math.h> #include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> r(n); for(int i = 0; i < n; i++){ cin >> r.at(i); } vector<int> c(9); for(int i = 0; i < n; i++){ if(r.at(i) <= 3199){ c.at(r.at(i)/400) = c.at(r.at(i)/400)+1; } else { c.at(8) = c.at(8)+1; } } int count = 0; for(int i = 0; i < 8; i++){ if(c.at(i) >= 1){ count++; } } cout << max(count,c.at(8)) << " " << count+c.at(8)); }
a.cc: In function 'int main()': a.cc:26:55: error: expected ';' before ')' token 26 | cout << max(count,c.at(8)) << " " << count+c.at(8)); | ^ | ;
s321305799
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll a, b, c, d, e, f, g, h, n, k, m; a = 0; b = 0; c = 0; d = 0; e = 0; f = 0; g = 0; h = 0; k = 0; in(n); rep(i, n){ in(m); if(m < 400) a = 1; else if(m < 800) b = 1; else if(m < 1200) c = 1; else if(m < 1600) d = 1; else if(m < 2000) e = 1; else if(m < 2400) f = 1; else if(m < 2800) g = 1; else if(m < 3200) h = 1; else k = 1; } if(k >= 1){ out(min(a + b + c + d + e + f + g + h + k)); hina; out(max(1ll, a + b + c + d + e + f + g + h)); memi; } else{ out(a + b + c + d + e + f + g + h); hina; out(a + b + c + d + e + f + g + h); memi; } }
a.cc: In function 'int main()': a.cc:51:12: error: no matching function for call to 'min(ll)' 51 | out(min(a + b + c + d + e + f + g + h + k)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:14:24: note: in definition of macro 'out' 14 | #define out(n) cout << n | ^ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc: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:51:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 51 | out(min(a + b + c + d + e + f + g + h + k)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:14:24: note: in definition of macro 'out' 14 | #define out(n) cout << n | ^ /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
s892242133
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll a = b = c = d = e = f = g = h = k = n = m = 0; in(n); rep(i, n){ in(m); if(m < 400) a = 1; else if(m < 800) b = 1; else if(m < 1200) c = 1; else if(m < 1600) d = 1; else if(m < 2000) e = 1; else if(m < 2400) f = 1; else if(m < 2800) g = 1; else if(m < 3200) h = 1; else k = 1; } if(k == 1) out(8); else out(a + b + c + d + e + f + g + h); memi; }
a.cc: In function 'int main()': a.cc:18:10: error: 'b' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:14: error: 'c' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:18: error: 'd' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:22: error: 'e' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:26: error: 'f' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:30: error: 'g' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:34: error: 'h' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:38: error: 'k' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:42: error: 'n' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^ a.cc:18:46: error: 'm' was not declared in this scope 18 | ll a = b = c = d = e = f = g = h = k = n = m = 0; | ^
s076939591
p03695
C++
#include <bits/stdc++.h> #define rep(i,m,n) for(int i=m;i<n;i++) #define fix(n) cout<<fixed<<setprecision(n) #define co(n) cout<<n<<endl #define all(n) (n).begin(),(n).end() using namespace std; typedef long long ll; const ll mod=1000000007; double pi=3.1415926535; int main(){ int n; cin>>n; int a,b,c=0,ans=0,x[8]={}; rep(i,0,n){ cin>>a; if(a<3200) x[a/400]++; else c++; } rep(i,0,8) if(x[i]>0) ans++; if(ams>0) cout<<ans<<" "; else cout<<1<<" "; if(ans+c>8) co(8); else co(ans+c); return 0; }
a.cc: In function 'int main()': a.cc:21:6: error: 'ams' was not declared in this scope; did you mean 'ans'? 21 | if(ams>0) cout<<ans<<" "; | ^~~ | ans
s233663031
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,P,G=0;cin>>N; vector<bool>C(8,false); for(int i=0;i<N;i++){ cin>>P; if(P<400)C.at(0)=true; else if(P<800)C.at(1)=true; else if(P<1200)C.at(2)=true; else if(P<1600)C.at(3)=true; else if(P<2000)C.at(4)=true; else if(P<2400)C.at(5)=true; else if(P<2800)C.at(6)=true; else if(P<3200)C.at(7)=true; else G++; } cout<<min(count(C.begin(),C.end(),true)+G,8)<<endl; }
a.cc: In function 'int main()': a.cc:18:12: error: no matching function for call to 'min(std::__iterator_traits<std::_Bit_iterator, void>::difference_type, int)' 18 | cout<<min(count(C.begin(),C.end(),true)+G,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: template argument deduction/substitution failed: a.cc:18:12: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 18 | cout<<min(count(C.begin(),C.end(),true)+G,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 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:18:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 18 | cout<<min(count(C.begin(),C.end(),true)+G,8)<<endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s350758278
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 typedef long long int ll; const ll INF=(ll)1e18; //const int INF=(1<<30); int main(){ int N; cin >> N; map<int,int> mp; int cnt=0; REP(i,N){ int a; cin >> a; if(a/400 < 8){ mp[a/400]++; }else{ cnt++; } } cout << min(1,mp.size()) << " " << min((int)mp.size()+cnt, 8) << endl; }
a.cc: In function 'int main()': a.cc:31:14: error: no matching function for call to 'min(int, std::map<int, int>::size_type)' 31 | cout << min(1,mp.size()) << " " << min((int)mp.size()+cnt, 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: template argument deduction/substitution failed: a.cc:31:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'}) 31 | cout << min(1,mp.size()) << " " << min((int)mp.size()+cnt, 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 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:31:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 31 | cout << min(1,mp.size()) << " " << min((int)mp.size()+cnt, 8) << endl; | ~~~^~~~~~~~~~~~~
s439116315
p03695
C++
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define mp make_pair #define EPS (int)1e-9 #define PI acos(-1) #define endl '\n' #define pb push_back #define fi first #define se second using namespace std; using ld = long double; using ll = long long; using vi = vector<int>; using pii = pair<int, int>; const int mod = 1000000007; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, x; cin >> n; vector<bool> color(8, false); int diff = 0, legends = 0; for(int i = 0; i < n; i++) { cin >> x; if(inRange(x, 1, 399) and !color[0]) { color[0] = true; diff++; } if(inRange(x, 400, 799) and !color[1]) { color[1] = true; diff++; } if(inRange(x, 800, 1199) and !color[2]) { color[2] = true; diff++; } if(inRange(x, 1200, 1599) and !color[3]) { color[3] = true; diff++; } if(inRange(x, 1600, 1999) and !color[4]) { color[4] = true; diff++; } if(inRange(x, 2000, 2399) and !color[5]) { color[5] = true; diff++; } if(inRange(x, 2400, 2799) and !color[6]) { color[6] = true; diff++; } if(inRange(x, 2800, 3199) and !color[7]) { color[7] = true; diff++; } if(x >= 3200) legends++; } if(diff == 8) { cout << 8 << " " << 8 << endl; return 0; } cout << diff << " " << diff+legends%(8-diff) << endl; return 0; }
a.cc: In function 'int main()': a.cc:34:20: error: 'inRange' was not declared in this scope 34 | if(inRange(x, 1, 399) and !color[0]) | ^~~~~~~ a.cc:40:20: error: 'inRange' was not declared in this scope 40 | if(inRange(x, 400, 799) and !color[1]) | ^~~~~~~ a.cc:46:20: error: 'inRange' was not declared in this scope 46 | if(inRange(x, 800, 1199) and !color[2]) | ^~~~~~~ a.cc:52:20: error: 'inRange' was not declared in this scope 52 | if(inRange(x, 1200, 1599) and !color[3]) | ^~~~~~~ a.cc:58:20: error: 'inRange' was not declared in this scope 58 | if(inRange(x, 1600, 1999) and !color[4]) | ^~~~~~~ a.cc:64:20: error: 'inRange' was not declared in this scope 64 | if(inRange(x, 2000, 2399) and !color[5]) | ^~~~~~~ a.cc:70:20: error: 'inRange' was not declared in this scope 70 | if(inRange(x, 2400, 2799) and !color[6]) | ^~~~~~~ a.cc:76:20: error: 'inRange' was not declared in this scope 76 | if(inRange(x, 2800, 3199) and !color[7]) | ^~~~~~~
s389396553
p03695
C++
package main import ( "bufio" "fmt" "os" "strconv" ) func out(x ...interface{}) { fmt.Println(x...) } var sc = bufio.NewScanner(os.Stdin) func getInt() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } return i } func getString() string { sc.Scan() return sc.Text() } func main() { sc.Split(bufio.ScanWords) N := getInt() rate := make([]int, 9) for i := 0; i < N; i++ { a := getInt() switch { case a >= 1 && a <= 399: rate[0]++ case a >= 400 && a <= 799: rate[1]++ case a >= 800 && a <= 1199: rate[2]++ case a >= 1200 && a <= 1599: rate[3]++ case a >= 1600 && a <= 1999: rate[4]++ case a >= 2000 && a <= 2399: rate[5]++ case a >= 2400 && a <= 2799: rate[6]++ case a >= 2800 && a <= 3199: rate[7]++ case a >= 3200: rate[8]++ } } ans := 0 for i := 0; i < 8; i++ { if rate[i] != 0 { ans++ } } min := ans if ans == 0 { min = 1 } max := ans + rate[8] out(min, max) }
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~ a.cc:10:26: error: expected unqualified-id before ')' token 10 | func out(x ...interface{}) { | ^ a.cc:14:1: error: 'var' does not name a type 14 | var sc = bufio.NewScanner(os.Stdin) | ^~~ a.cc:25:1: error: 'func' does not name a type 25 | func getString() string { | ^~~~ a.cc:30:1: error: 'func' does not name a type 30 | func main() { | ^~~~
s495833495
p03695
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define FOR(i,start,end) for(int i=start;i<=end;i++) const int INF = 1001001001; typedef long long ll; const ll MOD=1000000007; using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); } template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); } template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); } template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); } template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); } template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); } int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; } int main(void){ // Your code here! int n;cin >> n; vector<int> a(n); rep(i,n) cin >> a[i]; map<int,int>mp; int kanst = 0; int counter = 0; rep(i,n){ rep(j,8){ if (400*j<= a[i] && a[i] <= 400*(j+1)-1){ mp[j]=1; } else if (a[i]>=3200) { kanst++; break; } } } for (auto &x :mp){ if( x.second == 1) counter++; } if (counter >0)cout << counter << " "; else cout << 1 << endl; counter+=kanst; else cout << counter << " "; }
a.cc: In function 'int main()': a.cc:44:5: error: 'else' without a previous 'if' 44 | else cout << counter << " "; | ^~~~
s761587292
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,a; int free=0,color=0; map<int,bool> m; cin>>N; for(int i=0;i<N;i++){ cin>>a; a<3200?m[a/400]=true:m[3200]=true; if(a/400>=8){ free++; } } for(auto itr=m.begin();itr!=m.end();itr++)color++; if(free!=0)color--; color==0?cout<<"1"<<" ":cout<<color<<" "; ((color+free>8)?cout<<"8"<<endl;:cout<<color+free<<endl; }
a.cc: In function 'int main()': a.cc:19:34: error: expected ':' before ';' token 19 | ((color+free>8)?cout<<"8"<<endl;:cout<<color+free<<endl; | ^ | : a.cc:19:34: error: expected primary-expression before ';' token a.cc:19:34: error: expected ')' before ';' token 19 | ((color+free>8)?cout<<"8"<<endl;:cout<<color+free<<endl; | ~ ^ | ) a.cc:19:35: error: expected primary-expression before ':' token 19 | ((color+free>8)?cout<<"8"<<endl;:cout<<color+free<<endl; | ^
s380274643
p03695
C++
#include <iostream> #include <iomanip> #include <vector> #include <utility> #include <map> #include <algorithm> #include <queue> #include <cmath> #include <numeric> #include <set> using namespace std; struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa; template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;} #define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;} using int64 = long long; int main() { int n; cin >> n; map<int,int> mp; for (int i=0; i<n; i++) { int a; cin >> a; mp[a/400]++; } int mpn = mp.size(); int mina = mpn; if (mpn > 1 && mp[8] > 0) mina--; int maxa = mpn if (mp[8]) maxa = min(7, mpn + mp[8] - 1); // for (auto p : mp) { // cout << p.first << " " << p.second << endl; // } // cout << endl; cout << mina << " " << maxa << endl; }
a.cc: In function 'int main()': a.cc:34:5: error: expected ',' or ';' before 'if' 34 | if (mp[8]) maxa = min(7, mpn + mp[8] - 1); | ^~
s837171194
p03695
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; int main() { int N; cin >> N; vector<int> a(N); for (auto& x : a) { cin >> x; } set<int> s; int t = 0; for (auto x : a) { if (x < 3200) { s.insert(x / 400); } else { ++t; } } cout << max(1u, s.size()) << " " << s.size() + t << endl; }
a.cc: In function 'int main()': a.cc:28:20: error: no matching function for call to 'max(unsigned int, std::set<int>::size_type)' 28 | cout << max(1u, s.size()) << " " << s.size() + t << 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:28:20: note: deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::set<int>::size_type' {aka 'long unsigned int'}) 28 | cout << max(1u, s.size()) << " " << s.size() + t << 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:28:20: note: mismatched types 'std::initializer_list<_Tp>' and 'unsigned int' 28 | cout << max(1u, s.size()) << " " << s.size() + t << endl; | ~~~^~~~~~~~~~~~~~
s835966473
p03695
C++
#include <iostream> // cout, endl, cin #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <stdlib.h> #include <stdio.h> using namespace std; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int my_abs_A(int num) { if (num > 0) return num; else return -num; } int my_abs_B(long long num,long long numb) { if (num - numb >= 0) return num - numb; else return -1 * (num - numb); } long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a % b); } long long lcm(long long a, long long b) { return a * b / gcd(a, b); } int main() { int N; cin >> N; vector<int> rate(N); for (int i = 0; i < N; i++) { cin >> rate.at(i); } vector<int> color(9); for (int j = 0; j < N; j++) { if (color.at(rate.at(j) / 400) <= 8) { (color.at(rate.at(j) / 400)++; } else { color.at(8)++; } } int ansM = 0; int ansS = 0; for (int k = 0; k < 9; k++) { if (k == 8) { if (color.at(k) > ansM && color.at(8) > ansM) { ansS = ansS + (color.at(8) - ansM); } ansM = ansM + color.at(8); break; } if (color.at(k) > 0) { ansM++; ansS++; } } cout << ansS << " " << ansM << endl; }
a.cc: In function 'int main()': a.cc:59:42: error: expected ')' before ';' token 59 | (color.at(rate.at(j) / 400)++; | ~ ^ | )
s860867533
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> a(n); int i; int count,count_all=0,0; vector<int> b(8); for(i=0;i<8;i++){ b[i] = 0; } for(i=0;i<n;i++){ cin >> a[i]; } sort(a.begin(), a.end()); for(i=0;i<n;i++){ if(a[i]<=399&&b[0]==0){ count++; b[0]=1; if(a[i]<=799&&b[1]==0){ count++; b[1]=1; if(a[i]<=1199&&b[2]==0){ count++; b[2]=1; if(a[i]<=1599&&b[3]==0){ count++; b[3]=1; if(a[i]<=1999&&b[4]==0){ count++; b[4]=1; if(a[i]<=2399&&b[5]==0){ count++; b[5]=1; if(a[i]<=2799&&b[6]==0){ count++; b[6]=1; if(a[i]<=3199){ count++; b[7]=1; }else if(count_all<=8-count){ count_all++; } } } } } } } } } cout << count + count_all; }
a.cc: In function 'int main()': a.cc:9:25: error: expected unqualified-id before numeric constant 9 | int count,count_all=0,0; | ^
s861402952
p03695
C++
#include <iostream> #include <vector> int main(){ int n; std::cin >> n; std::vector<int> list(9, 0); for(int i = 0; i < n; ++i){ int val; std::cin >> val; if(val / 400 < 8){ ++list.at(val / 400); }else{ ++list.at(8; } } int min = std::count_if(list.begin(), list.begin() + 8, [](auto i){ return 0 < i; }); std::cout << min << " " << min + list.at(8) << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:15:24: error: expected ')' before ';' token 15 | ++list.at(8; | ~ ^ | ) a.cc:19:20: error: 'count_if' is not a member of 'std' 19 | int min = std::count_if(list.begin(), list.begin() + 8, [](auto i){ | ^~~~~~~~
s256844394
p03695
C++
#include <iostream> #include <set> #include <queue> #include <vector> #include <algorithm> #include <math.h> #include <cmath> #include <string> #include <climits> #include <sstream> #include <iomanip> #include <map> #include <stack> #include <tuple> #include <numeric> #include <functional> #include <unordered_map> using namespace std; /*-----------------------------------------------------------------------------  定義 -------------------------------------------------------------------------------*/ #define ALL(a) (a).begin(),(a).end() #define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i)) #define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i)) #define INF (1000 * 1000 * 1000 * 2) #define MOD (1000 * 1000 * 1000 + 7) #define Ceil(x, n) (((((x))+((n)-1))/n)) /* Nの倍数に切り上げ割り算 */ #define CeilN(x, n) (((((x))+((n)-1))/n)*n) /* Nの倍数に切り上げ */ #define FloorN(x, n) ((x)-(x)%(n)) /* Nの倍数に切り下げ */ #define IsOdd(x) (((x)&0x01UL) == 0x01UL) #define IsEven(x) (!IsOdd((x))) #define M_PI 3.14159265358979323846 typedef long long ll; typedef pair<int, int> P; /*-----------------------------------------------------------------------------  処理 -------------------------------------------------------------------------------*/ // メイン int main() { int N; cin >> N; vector<ll> A(N); REP(i, N) { cin >> A[i]; }; vector<int> col(9, 0); REP(i, N) { if (3200 <= A[i]) { col[8]++; } else { col[A[i] / 400]++; } } int ans = 0; REP(i, 8) { if (0 < col[i]) { ans++; } } int ansMax = ans + col[8]; int ansMax = min(ansMax, 8); cout << ans << " " << ansMax << endl; return 0; }
a.cc: In function 'int main()': a.cc:67:13: error: redeclaration of 'int ansMax' 67 | int ansMax = min(ansMax, 8); | ^~~~~~ a.cc:66:13: note: 'int ansMax' previously declared here 66 | int ansMax = ans + col[8]; | ^~~~~~
s155525553
p03695
C++
// Created by conan1024hao in 2019. // Copyright © 2019 conan1024hao. All rights reserved. // 専用ライブラリです、自由にコピーして構いません。 // 感谢看我的代码!Wechat:conan1024hao QQ:810396815 #pragma GCC optimize ("O3") #include <iostream> #include <iomanip> #include <istream> #include <ostream> #include <sstream> #include <iterator> #include <vector> #include <algorithm> #include <queue> #include <deque> #include <list> #include <stack> #include <map> #include <set> #include <utility> #include <cmath> #include <cstdio> #include <cstring> #include <string> #include <ctime> #include <cctype> #include <cstdlib> #define INF 10e16 #define MOD 1000000007 #define mod 1000000007 #define rep(i, a, n) for (ll i = a; i < (ll)(n); i++) #define fi first #define se second #define pb push_back #define mp make_pair #define eb emplace_back #define mmax(x,y)(x>y?x:y) #define mmin(x,y)(x<y?x:y) #define chmax(x,y) x=mmax(x,y) #define chmin(x,y) x=mmin(x,y) #define all(x) (x).begin(),(x).end() #define siz(x) (ll)(x).size() #define PI acos(-1.0) using namespace std; //using Int=int_fast64_t; typedef long long int ll; typedef pair<ll,ll>Pll; typedef pair<int,int>Pin; long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; } long long LCM(long long a, long long b) {return a/GCD(a,b)*b;} int dx[8]={-1,0,1,0,1,1,-1,-1}; int dy[8]={0,-1,0,1,1,-1,1,-1}; char dir[4]={'u','l','d','r'}; ll cmp1(pair<ll,string>a,pair<ll,string> b){ if(a.fi!=b.fi) return a.fi<b.fi; else return a.se<b.se; } //-------------------------------------------------------------------------- //--------------------------------------------------------------------------- int main(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!! llか?????????? memset()!!!!!!!!!!!! ペナを減らせ!!!!!!!!!!!!! cin.tie(0); ios::sync_with_stdio(false); //------------------------------- int n;cin>>n; vector<int>a(n); for(int i=0;i<n;i++)cin>>a[i]; map<int,int>m;int cc=0; for(int i=0;i<n;i++){ if(a[i]<=399&&m[1]==0) m[1]=1; else if(a[i]<=799&&a[i]>=400&&m[2]==0) m[2]=1; else if(a[i]<=1199&&a[i]>=800&&m[3]==0) m[3]=1; else if(a[i]<=1599&&a[i]>=1200&&m[4]==0) m[4]=1; else if(a[i]<=1999&&a[i]>=1600&&m[5]==0) m[5]=1; else if(a[i]<=2399&&a[i]>=2000&&m[6]==0) m[6]=1; else if(a[i]<=2799&&a[i]>=2400&&m[7]==0) m[7]=1; else if(a[i]<=3199&&a[i]>=2800&&m[8]==0) m[8]=1; else if(a[i]>=3200) cc++; } if(cc==n){ cout<<1<<" "<<c<<endl; return 0; } int cnt=0; for(int i=1;i<=8;i++) if(m[i]>0)cnt++; cout<<cnt<<" "<<cnt+cc<<endl; //------------------------------- return 0; } //---------------------------------------------------------------------------
a.cc: In function 'int main()': a.cc:93:23: error: 'c' was not declared in this scope; did you mean 'cc'? 93 | cout<<1<<" "<<c<<endl; | ^ | cc
s244425214
p03695
C++
#include <bits/stdc++.h> using namespace std; #define int long long int int32_t main(){ int n,m;cin>>n;m=n; int high=0; int gray=0; int brown=0; int green=0; int cyan=0; int blue=0; int yellow=0; int orange=0; int red=0; while(m--){ int tmp;cin>>tmp; if(tmp<400) gray++; else if(tmp<800) brown++; else if(tmp<1200) green++; else if(tmp<1600) cyan++; else if(tmp<2000) blue++; else if(tmp<2400) yellow++; else if(tmp<2800) orange++; else if(tmp<3200) red++; else high++; } int a1=!!gray+!!brown+!!green+!!cyan+!!blue+!!yellow+!!orange+!!red; cout<<max(a1,1)<<" "<<a1+high; }
a.cc: In function 'int32_t main()': a.cc:28:18: error: no matching function for call to 'max(long long int&, int)' 28 | cout<<max(a1,1)<<" "<<a1+high; | ~~~^~~~~~ 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:28:18: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 28 | cout<<max(a1,1)<<" "<<a1+high; | ~~~^~~~~~ /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:28:18: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 28 | cout<<max(a1,1)<<" "<<a1+high; | ~~~^~~~~~
s593333162
p03695
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); boolean glay = false; boolean blown = false; boolean green = false; boolean sky = false; boolean blue = false; boolean yellow = false; boolean orange = false; boolean red = false; int tmp = 0; int allcount=0; for(int i = 0;i<N;i++) { tmp = sc.nextInt(); if(!glay&&tmp<400) glay = true; else if(!blown&&tmp<800) blown = true; else if(!green&&tmp<1200) green = true; else if(!sky&&tmp<1600) sky = true; else if(!blue&&tmp<2000) blue = true; else if(!yellow&&tmp<2400) yellow = true; else if(!orange&&tmp<2800) orange = true; else if(!red&&tmp<3200) red = true; else allcount++; } int anslow =0; if(glay) anslow++; if(blown) anslow++; if(green) anslow++; if(sky) anslow++; if(blue) anslow++; if(yellow) anslow++; if(orange) anslow++; if(red) anslow++; int anshigh =0; if(anslow+allcount>=8) anshigh=8; else anshigh = anslow+allcount; System.println(anslow+" "+anshigh); } }
Main.java:44: error: cannot find symbol System.println(anslow+" "+anshigh); ^ symbol: method println(String) location: class System 1 error
s198666892
p03695
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); boolean glay = false; boolean blown = false; boolean green = false; boolean sky = false; boolean blue = false; boolean yellow = false; boolean orange = false; boolean red = false; int tmp = 0; int allcount=0; for(int i = 0;i<N;i++) { tmp = sc.nextInt(); if(!glay&&tmp<400) glay = true; else if(!blown&&tmp<800) blown = true; else if(!green&&tmp<1200) green = true; else if(!sky&&tmp<1600) sky = true; else if(!blue&&tmp<2000) blue = true; else if(!yellow&&tmp<2400) yellow = true; else if(!orange&&tmp<2800) orange = true; else if(!red&&tmp<3200) red = true; else allcount++; } int anslow =0; if(glay) anslow++; if(blown) anslow++; if(green) anslow++; if(sky) anslow++; if(blue) anslow++; if(yellow) anslow++; if(orange) anslow++; if(red) anslow++; int anshigh =0 if(anslow+allcount>=8) anshigh=8; else anshigh = anslow+allcount; System.println(anslow+" "+anshigh); } }
Main.java:41: error: ';' expected int anshigh =0 ^ 1 error
s977025566
p03695
C++
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int main(){ int n, i, c[9], k, ans=0; cin >> n; int a[n]; for(i=0; i<9; i++) c[i]=0; for(i=0; i<n; i++){ cin >> a[i]; k=a[i]/400; c[i]++; } sort(a, a+n); for(i=0; i<8; i++){ if(c[i]>0) ans++; } cout << max(ans, 1) << " " << max(ans+c[8], 8);
a.cc: In function 'int main()': a.cc:21:50: error: expected '}' at end of input 21 | cout << max(ans, 1) << " " << max(ans+c[8], 8); | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s213478224
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; int main() { int n; cin >> n; vector<int> a(n), cl(9, 0); for (int i = 0; i < n; i++) { cin >> a.at(i); if (0 < a.at(i) && a.at(i) < 400) cl.at(0) = 1; else if (400 <= a.at(i) && a.at(i) < 800) cl.at(1) = 1; else if (800 <= a.at(i) && a.at(i) < 1200) cl.at(2) = 1; else if (1200 <= a.at(i) && a.at(i) < 1600) cl.at(3) = 1; else if (1600 <= a.at(i) && a.at(i) < 2000) cl.at(4) = 1; else if (2000 <= a.at(i) && a.at(i) < 2400) cl.at(5) = 1; else if (2400 <= a.at(i) && a.at(i) < 2800) cl.at(6) = 1; else if (2800 <= a.at(i) && a.at(i) < 3200) cl.at(7) = 1; else cl.at(8)++; } int sum = 0; for (int i = 0; i < 9; i++) sum += cl.at(i); if (cl.at(8) > 0) max(1, cout << sum - cl.at(8)) << " "; else cout << sum << " "; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:32:24: error: no matching function for call to 'max(int, std::basic_ostream<char>&)' 32 | if (cl.at(8) > 0) max(1, cout << sum - cl.at(8)) << " "; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:32:24: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::basic_ostream<char>') 32 | if (cl.at(8) > 0) max(1, cout << sum - cl.at(8)) << " "; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /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:32:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 32 | if (cl.at(8) > 0) max(1, cout << sum - cl.at(8)) << " "; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
s307052454
p03695
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<queue> #include<map> #include<math.h> #include<iomanip> #include<set> #include<numeric> #include<cstring> #include<cstdio> #include<functional> #include<bitset> #include<limits.h> #include<cassert> #include<iterator> #include<complex> #include<stack> using namespace std; typedef long long int lint; typedef pair<int, int> P; typedef pair<lint, lint> LLP; typedef pair<char, char>CP; #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define sort(v) sort((v).begin(), (v).end()) #define reverse(v) reverse((v).begin(), (v).end()) #define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge) #define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge) /* vector<char>al(26); al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; vector<char>AL(26); AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; vector<char>NUM(10); NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' }; */ int main() { vector<int>cl(8); int N; cin >> N; vector<int>A(N); rep(i, N) { cin >> A[i]; } int R = 0; rep(i, N) { if (A[i] < 400) { cl[0]++; } else if (A[i] < 800) { cl[1]++; } else if (A[i] < 1200) { cl[2]++; } else if (A[i] < 1600) { cl[3]++; } else if (A[i] < 2000) { cl[4]++; } else if (A[i] < 2400) { cl[5]++; } else if (A[i] < 2800) { cl[6]++; } else if (A[i] < 3200) { cl[7]++; } else { R++; } } sort(cl); cout << endl; cout << 8 - (upper(cl, 0) - lower(cl, 0)) << ' '; cout << min(8 - (upper(cl, 0) - lower(cl, 0)) + R, 8) << endl; }
a.cc: In function 'int main()': a.cc:83:20: error: no matching function for call to 'min(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, int)' 83 | cout << min(8 - (upper(cl, 0) - lower(cl, 0)) + R, 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: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:83:20: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 83 | cout << min(8 - (upper(cl, 0) - lower(cl, 0)) + R, 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 In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /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:83:20: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 83 | cout << min(8 - (upper(cl, 0) - lower(cl, 0)) + R, 8) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s839132736
p03695
C
#include<stdio.h> int main(void){ int num=0; int a[num]; int result=0; int resultmin=0; int red=0; int blue=0; int yellow=0; int green=0; int grly=0; int softblue=0; int orange=0; int blown=0; scanf("%d",&num); for(int i=0;i<num;i++){ scanf("%d",&a[i]); if(a[i]<399){ if(grly==1){ } else{ grly=1; result++; resultmin++; } } else if(a[i]<799){ if(blown==1){ } else{ blown=1; result++;resultmin++; } } else if(a[i]<1199){ if(green==1){ } else{ green=1; result++;resultmin++; } } else if(a[i]<1599){ if(softblue==1){ } else{ softblue=1; result++;resultmin++; } } else if(a[i]<1999){ if(blue==1){ } else{ blue=1; result++;resultmin++; } } else if(a[i]<2399){ if(yellow==1){ } else{ yellow=1; result++;resultmin++; } } else if(a[i]<2799){ if(orange==1){ } else{ orange=1; result++;resultmin++; } } else if(a[i]<3199){ if(red==1){ } else{ red=1; result++;resultmin++; } } else{result++;} } printf("%d",resultmin,result) }
main.c: In function 'main': main.c:86:38: error: expected ';' before '}' token 86 | printf("%d",resultmin,result) | ^ | ; 87 | } | ~
s145627485
p03695
C
#include<stdio.h> int main(void){ int num=0; int a[num]; int result=0; int resultmin=0; int red=0; int blue=0; int yellow=0; int green=0; int grly=0; int softblue=0; int orange=0; int blown=0; scanf("%d",&num); for(int i=0;i<num;i++){ scanf("%d",a[i]); if(a[i]<399){ if(grly==1){ } else{ grly=1; result++; resultmin++; } } else if(a[i]<799){ if(blown==1){ } else{ blown=1; result++;resultmin++; } } else if(a[i]<1199){ if(green==1){ } else{ green=1; result++;resultmin++; } } else if(a[i]<1599){ if(softblue==1){ } else{ softblue=1; result++;resultmin++; } } else if(a[i]<1999){ if(blue==1){ } else{ blue=1; result++;resultmin++; } } else if(a[i]<2399){ if(yellow==1){ } else{ yellow=1; result++;resultmin++; } } else if(a[i]<2799){ if(orange==1){ } else{ orange=1; result++;resultmin++; } } else if(a[i]<3199){ if(red==1){ } else{ red=1; result++;resultmin++; } } else{result++;} } printf("%d",resultmin,result) }
main.c: In function 'main': main.c:86:38: error: expected ';' before '}' token 86 | printf("%d",resultmin,result) | ^ | ; 87 | } | ~
s897370980
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a[n]; int i; int color[9]={}; for(i=0;i<n;i++){ cin >> a[i]; if(a[i]<3200)color[a[i]/400]++; else color[8]++; } int cnt = 0; for(i=0;i<=7;i++){ if(color[i]>0) cnt++; } int max = min(8,cnt+color[8]); int min = max(1,cnt); cout << min << " " << max; }
a.cc: In function 'int main()': a.cc:19:16: error: 'max' cannot be used as a function 19 | int min = max(1,cnt); | ~~~^~~~~~~
s538343090
p03695
C++
#include <bits/stdc++.h> using namespace std; const int N=1e5+5; #define inf 0x3f3f3f3f #define ll long long int a[N],b[10]; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; if(a[i]<400) { b[1]++; } else if(a[i]<800) { b[2]++; } else if(a[i]<1200) { b[3]++; } else if(a[i]<1600) { b[4]++; } else if(a[i]<2000) b[5]++; else if(a[i]<2400) b[6]++; else if(a[i]<2800) b[7]++; else if(a[i]<3200) b[8]++; else if(a[i]>=3200) cnt++; } int t=0; for(int i=1;i<=8;i++) if(b[i]) t++; if(t==0) cout<<1<<" "<<cnt<<endl; else cout<<t<<" "<<t+cnt<<endl; return 0; }
a.cc: In function 'int main()': a.cc:39:25: error: 'cnt' was not declared in this scope; did you mean 'int'? 39 | cnt++; | ^~~ | int a.cc:46:31: error: 'cnt' was not declared in this scope; did you mean 'int'? 46 | cout<<1<<" "<<cnt<<endl; | ^~~ | int a.cc:48:33: error: 'cnt' was not declared in this scope; did you mean 'int'? 48 | cout<<t<<" "<<t+cnt<<endl; | ^~~ | int
s269573791
p03695
C++
//#define NDEBUG #include <algorithm> #include <cstddef> #include <cstdint> #include <iostream> #include <vector> namespace n91 { using i8 = std::int_fast8_t; using i32 = std::int_fast32_t; using i64 = std::int_fast64_t; using u8 = std::uint_fast8_t; using u32 = std::uint_fast32_t; using u64 = std::uint_fast64_t; using isize = std::ptrdiff_t; using usize = std::size_t; struct rep { struct itr { usize i; constexpr itr(const usize i) noexcept : i(i) {} void operator++() noexcept { ++i; } constexpr usize operator*() const noexcept { return i; } constexpr bool operator!=(const itr x) const noexcept { return i != x.i; } }; const itr f, l; constexpr rep(const usize f, const usize l) noexcept : f(std::min(f, l)), l(l) {} constexpr auto begin() const noexcept { return f; } constexpr auto end() const noexcept { return l; } }; struct revrep { struct itr { usize i; constexpr itr(const usize i) noexcept : i(i) {} void operator++() noexcept { --i; } constexpr usize operator*() const noexcept { return i; } constexpr bool operator!=(const itr x) const noexcept { return i != x.i; } }; const itr f, l; constexpr revrep(const usize f, const usize l) noexcept : f(l - 1), l(std::min(f, l) - 1) {} constexpr auto begin() const noexcept { return f; } constexpr auto end() const noexcept { return l; } }; template <class T> auto md_vec(const usize n, const T &value) { return std::vector<T>(n, value); } template <class... Args> auto md_vec(const usize n, Args... args) { return std::vector<decltype(md_vec(args...))>(n, md_vec(args...)); } template <class T> constexpr T difference(const T &a, const T &b) noexcept { return a < b ? b - a : a - b; } template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; } template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; } template <class T> T scan() { T ret; std::cin >> ret; return ret; } } // namespace n91 #include <algorithm> #include <array> #include <functional> #include <iomanip> #include <iostream> #include <utility> namespace n91 { void main_() { /* std::ios::sync_with_stdio(false); std::cin.tie(nullptr); //*/ const usize n = scan<usize>(); usize arbit = 0; std::array<usize, 8> count; std::fill(count.beign(), count.end(), static_cast<usize>(0)); for (const usize i : rep(0, n)) { const usize a = scan<usize>(); if (a < 3200) { count[a / 400] += 1; } else { arbit += 1; } } usize base = 0; for (const auto e : count) { if (e > 0) { base += 1; } } std::cout << std::max(base, static_cast<usize>(1)) << ' ' << base + arbit << std::endl; } } // namespace n91 int main() { n91::main_(); return 0; }
a.cc: In function 'void n91::main_()': a.cc:89:19: error: 'struct std::array<long unsigned int, 8>' has no member named 'beign'; did you mean 'begin'? 89 | std::fill(count.beign(), count.end(), static_cast<usize>(0)); | ^~~~~ | begin
s650709409
p03695
C++
//#define NDEBUG #include <algorithm> #include <cstddef> #include <cstdint> #include <iostream> #include <vector> namespace n91 { using i8 = std::int_fast8_t; using i32 = std::int_fast32_t; using i64 = std::int_fast64_t; using u8 = std::uint_fast8_t; using u32 = std::uint_fast32_t; using u64 = std::uint_fast64_t; using isize = std::ptrdiff_t; using usize = std::size_t; struct rep { struct itr { usize i; constexpr itr(const usize i) noexcept : i(i) {} void operator++() noexcept { ++i; } constexpr usize operator*() const noexcept { return i; } constexpr bool operator!=(const itr x) const noexcept { return i != x.i; } }; const itr f, l; constexpr rep(const usize f, const usize l) noexcept : f(std::min(f, l)), l(l) {} constexpr auto begin() const noexcept { return f; } constexpr auto end() const noexcept { return l; } }; struct revrep { struct itr { usize i; constexpr itr(const usize i) noexcept : i(i) {} void operator++() noexcept { --i; } constexpr usize operator*() const noexcept { return i; } constexpr bool operator!=(const itr x) const noexcept { return i != x.i; } }; const itr f, l; constexpr revrep(const usize f, const usize l) noexcept : f(l - 1), l(std::min(f, l) - 1) {} constexpr auto begin() const noexcept { return f; } constexpr auto end() const noexcept { return l; } }; template <class T> auto md_vec(const usize n, const T &value) { return std::vector<T>(n, value); } template <class... Args> auto md_vec(const usize n, Args... args) { return std::vector<decltype(md_vec(args...))>(n, md_vec(args...)); } template <class T> constexpr T difference(const T &a, const T &b) noexcept { return a < b ? b - a : a - b; } template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; } template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; } template <class T> T scan() { T ret; std::cin >> ret; return ret; } } // namespace n91 #include <algorithm> #include <array> #include <functional> #include <iomanip> #include <iostream> #include <utility> namespace n91 { void main_() { /* std::ios::sync_with_stdio(false); std::cin.tie(nullptr); //*/ const usize n = scan<usize>(); usize arbit = 0; std::array<usize, 8> count; std::fill(count.beign(), count.end(), static_cast<usize>(0)); for (const usize i : rep(0, n)) { const usize a = scan<usize>(); if (a < 3200) { count[a / 400] += 1; } else { arbit += 1; } } usize base = 0; for (const auto e : count) { if (e > 0) { base += 1; } } std::cout << std::max(base, 1) << ' ' << base + arbit << std::endl; } } // namespace n91 int main() { n91::main_(); return 0; }
a.cc: In function 'void n91::main_()': a.cc:89:19: error: 'struct std::array<long unsigned int, 8>' has no member named 'beign'; did you mean 'begin'? 89 | std::fill(count.beign(), count.end(), static_cast<usize>(0)); | ^~~~~ | begin a.cc:104:24: error: no matching function for call to 'max(n91::usize&, int)' 104 | std::cout << std::max(base, 1) << ' ' << base + arbit << std::endl; | ~~~~~~~~^~~~~~~~~ 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:104:24: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 104 | std::cout << std::max(base, 1) << ' ' << base + arbit << std::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:104:24: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 104 | std::cout << std::max(base, 1) << ' ' << base + arbit << std::endl; | ~~~~~~~~^~~~~~~~~
s399612119
p03695
C++
#include<iostream> #include<set> #include<vector> #include<string> #include<algorithm> int main(){ int n; std::cin >> n; std::vector<int> a(n); for(int i = 0; i < n; i++){ std::cin >> a.at(i); } std::set<std::string> S; int free = 0; for(int i = 0; i < n; i++){ if(1 <= a.at(i) && a.at(i) <= 399){ S.insert("gray"); } else if(400 <= a.at(i) && a.at(i) <= 799){ S.insert("brown"); } else if(800 <= a.at(i) && a.at(i) <= 1199){ S.insert("green"); } else if(1200 <= a.at(i) && a.at(i) <= 1599){ S.insert("light_blue"); } else if(1600 <= a.at(i) && a.at(i) <= 1999){ S.insert("blue"); } else if(2000 <= a.at(i) && a.at(i) <= 2399){ S.insert("yellow"); } else if(2400 <= a.at(i) && a.at(i) <= 2799){ S.insert("orange"); } else if(2800 <= a.at(i) && a.at(i) <= 3199){ S.insert("red"); } else if(3200 <= a.at(i)){ free++; } } int minN = S.size(); int maxN; if(minN == 0) { minN = 1; maxN = free; } int maxN = minN + free; std::cout << minN << " " << maxN << std::endl; }
a.cc: In function 'int main()': a.cc:55:9: error: redeclaration of 'int maxN' 55 | int maxN = minN + free; | ^~~~ a.cc:50:9: note: 'int maxN' previously declared here 50 | int maxN; | ^~~~
s751794795
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(a) (a).begin(),(a).end() #define SUM(a) accumulate((a).begin(),(a).end(),0) #define SORT(a) sort(ALL(a)) #define REV(a) reverse(ALL(a)) #define dump(x) cerr << #x << " = " << (x) << endl; typedef long long ll; const int INTINF = 1<<29; const ll LLINF = 1LL<<61; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; int a; int cnt[9] = {}; cin >> n; int wild = 0; REP(i,n){ cin >> a; cnt[min(a,3200)/400]++; } int sm = 0; REP(i,8){ if(cnt[i]){ sm++; } } cout << max(sm,1) << endl; cout << min(sm+cnt[8]) << endl; }
a.cc: In function 'int main()': a.cc:39:14: error: no matching function for call to 'min(int)' 39 | cout << min(sm+cnt[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:39:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 39 | cout << min(sm+cnt[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
s108736559
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(a) (a).begin(),(a).end() #define SUM(a) accumulate((a).begin(),(a).end(),0) #define SORT(a) sort(ALL(a)) #define REV(a) reverse(ALL(a)) #define dump(x) cerr << #x << " = " << (x) << endl; typedef long long ll; const int INTINF = 1<<29; const ll LLINF = 1LL<<61; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; int a; int cnt[9] = {}; cin >> n; int wild = 0; REP(i,n){ cin >> a; if (a>=3200){ cnt[8] }else{ cnt[a/400]=1; } } int sm = 0; REP(i,8){ sm+=cnt[i]; } cout << max(sm,1) << " " << min(sm+cnt[8],8) << endl; }
a.cc: In function 'int main()': a.cc:31:15: error: expected ';' before '}' token 31 | cnt[8] | ^ | ; 32 | }else{ | ~
s332833893
p03695
C
#include <stdio.h> int main() { int n,a[100],color[8] = 0; scanf("%d",&n); for (int i = 0; i < n; i++) { scanf("%d",&a[i]); color[a[i] / 400] ++; } int max = 0,min = 101; for (int i = 0; i < 8; i++) { if(max < color[i])max = color[i]; if(min > color[i])min = color[i]; } printf("%d %d\n",min,max); }
main.c: In function 'main': main.c:5:29: error: invalid initializer 5 | int n,a[100],color[8] = 0; | ^
s094498260
p03695
C++
#include <cstdio> #include <iostream> #include <vector> #include <algorithm> #include <unordered_set> #include <climits> using Set = std::unordered_set<uint32_t>; void FindAndUpdate(int key, Set* o) { auto find = o->find(key); if (find == o->end()) { o->insert(key); } } int main() { uint32_t n = 0; scanf("%d", &n); uint32_t a = 0; uint32_t i = 0; Set o; uint32_t free = 0; while (std::cin >> a) { if (a >= 1 && a <= 399) { FindAndUpdate(1, &o); } else if (a >= 400 && a <= 799) { FindAndUpdate(2, &o); } else if (a >= 800 && a <= 1199) { FindAndUpdate(3, &o); } else if (a >= 1200 && a <= 1599) { FindAndUpdate(4, &o); } else if (a >= 1600 && a <= 1999) { FindAndUpdate(5, &o); } else if (a >= 2000 && a <= 2399) { FindAndUpdate(6, &o); } else if (a >= 2400 && a <= 2799) { FindAndUpdate(7, &o); } else if (a >= 2800 && a <= 3199) { FindAndUpdate(8, &o); } else { free++; } i++; if (i >= n) { break; } } uint32_t max = std::min(uint32_t(o.size()) + free, uint32_t(8)); uint32_t min = std::max(uint32_t(o.size()), 1); std::cout << min << " " << max << std::endl; }
a.cc:9:32: error: 'uint32_t' was not declared in this scope 9 | using Set = std::unordered_set<uint32_t>; | ^~~~~~~~ a.cc:8:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 7 | #include <climits> +++ |+#include <cstdint> 8 | a.cc:9:40: error: template argument 1 is invalid 9 | using Set = std::unordered_set<uint32_t>; | ^ a.cc:9:40: error: template argument 2 is invalid a.cc:9:40: error: template argument 3 is invalid a.cc:9:40: error: template argument 4 is invalid a.cc:11:29: error: 'Set' has not been declared 11 | void FindAndUpdate(int key, Set* o) { | ^~~ a.cc: In function 'void FindAndUpdate(int, int*)': a.cc:12:18: error: request for member 'find' in '* o', which is of non-class type 'int' 12 | auto find = o->find(key); | ^~~~ a.cc:13:18: error: request for member 'end' in '* o', which is of non-class type 'int' 13 | if (find == o->end()) { | ^~~ a.cc:14:8: error: request for member 'insert' in '* o', which is of non-class type 'int' 14 | o->insert(key); | ^~~~~~ a.cc: In function 'int main()': a.cc:19:3: error: 'uint32_t' was not declared in this scope 19 | uint32_t n = 0; | ^~~~~~~~ a.cc:19:3: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:20:16: error: 'n' was not declared in this scope 20 | scanf("%d", &n); | ^ a.cc:22:11: error: expected ';' before 'a' 22 | uint32_t a = 0; | ^~ | ; a.cc:23:11: error: expected ';' before 'i' 23 | uint32_t i = 0; | ^~ | ; a.cc:24:3: error: 'Set' was not declared in this scope 24 | Set o; | ^~~ a.cc:25:11: error: expected ';' before 'free' 25 | uint32_t free = 0; | ^~~~~ | ; a.cc:26:22: error: 'a' was not declared in this scope 26 | while (std::cin >> a) { | ^ a.cc:28:25: error: 'o' was not declared in this scope 28 | FindAndUpdate(1, &o); | ^ a.cc:30:25: error: 'o' was not declared in this scope 30 | FindAndUpdate(2, &o); | ^ a.cc:32:25: error: 'o' was not declared in this scope 32 | FindAndUpdate(3, &o); | ^ a.cc:34:25: error: 'o' was not declared in this scope 34 | FindAndUpdate(4, &o); | ^ a.cc:36:25: error: 'o' was not declared in this scope 36 | FindAndUpdate(5, &o); | ^ a.cc:38:25: error: 'o' was not declared in this scope 38 | FindAndUpdate(6, &o); | ^ a.cc:40:25: error: 'o' was not declared in this scope 40 | FindAndUpdate(7, &o); | ^ a.cc:42:25: error: 'o' was not declared in this scope 42 | FindAndUpdate(8, &o); | ^ a.cc:44:7: warning: ISO C++ forbids incrementing a pointer of type 'void (*)(void*) noexcept' [-Wpointer-arith] 44 | free++; | ^~~~ a.cc:44:11: error: lvalue required as increment operand 44 | free++; | ^~ a.cc:47:5: error: 'i' was not declared in this scope 47 | i++; | ^ a.cc:53:11: error: expected ';' before 'max' 53 | uint32_t max = std::min(uint32_t(o.size()) + free, uint32_t(8)); | ^~~~ | ; a.cc:54:11: error: expected ';' before 'min' 54 | uint32_t min = std::max(uint32_t(o.size()), 1); | ^~~~ | ; a.cc:56:16: error: 'min' was not declared in this scope; did you mean 'std::min'? 56 | std::cout << min << " " << max << std::endl; | ^~~ | std::min 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: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:56:30: error: 'max' was not declared in this scope; did you mean 'std::max'? 56 | std::cout << min << " " << max << std::endl; | ^~~ | std::max /usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~
s911497261
p03695
C++
#include <cstdio> #include <iostream> #include <vector> #include <algorithm> #include <unordered_set> #include <climits> using Set = std::unordered_set<uint32_t>; void FindAndUpdate(int key, Set* o) { auto find = o->find(key); if (find == o->end()) { o->insert(key); } } int main() { uint32_t n = 0; scanf("%d", &n); uint32_t a = 0; uint32_t i = 0; Set o; uint32_t free = 0; while (std::cin >> a) { if (a >= 1 && a <= 399) { FindAndUpdate(1, &o); } else if (a >= 400 && a <= 799) { FindAndUpdate(2, &o); } else if (a >= 800 && a <= 1199) { FindAndUpdate(3, &o); } else if (a >= 1200 && a <= 1599) { FindAndUpdate(4, &o); } else if (a >= 1600 && a <= 1999) { FindAndUpdate(5, &o); } else if (a >= 2000 && a <= 2399) { FindAndUpdate(6, &o); } else if (a >= 2400 && a <= 2799) { FindAndUpdate(7, &o); } else if (a >= 2800 && a <= 3199) { FindAndUpdate(8, &o); } else { free++; } i++; if (i >= n) { break; } } uint32_t max = std::min(uint32_t(o.size()) + free, uint32_t(8)); uint32_t min = std::max(o.size(), 1); std::cout << min << " " << max << std::endl; }
a.cc:9:32: error: 'uint32_t' was not declared in this scope 9 | using Set = std::unordered_set<uint32_t>; | ^~~~~~~~ a.cc:8:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 7 | #include <climits> +++ |+#include <cstdint> 8 | a.cc:9:40: error: template argument 1 is invalid 9 | using Set = std::unordered_set<uint32_t>; | ^ a.cc:9:40: error: template argument 2 is invalid a.cc:9:40: error: template argument 3 is invalid a.cc:9:40: error: template argument 4 is invalid a.cc:11:29: error: 'Set' has not been declared 11 | void FindAndUpdate(int key, Set* o) { | ^~~ a.cc: In function 'void FindAndUpdate(int, int*)': a.cc:12:18: error: request for member 'find' in '* o', which is of non-class type 'int' 12 | auto find = o->find(key); | ^~~~ a.cc:13:18: error: request for member 'end' in '* o', which is of non-class type 'int' 13 | if (find == o->end()) { | ^~~ a.cc:14:8: error: request for member 'insert' in '* o', which is of non-class type 'int' 14 | o->insert(key); | ^~~~~~ a.cc: In function 'int main()': a.cc:19:3: error: 'uint32_t' was not declared in this scope 19 | uint32_t n = 0; | ^~~~~~~~ a.cc:19:3: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:20:16: error: 'n' was not declared in this scope 20 | scanf("%d", &n); | ^ a.cc:22:11: error: expected ';' before 'a' 22 | uint32_t a = 0; | ^~ | ; a.cc:23:11: error: expected ';' before 'i' 23 | uint32_t i = 0; | ^~ | ; a.cc:24:3: error: 'Set' was not declared in this scope 24 | Set o; | ^~~ a.cc:25:11: error: expected ';' before 'free' 25 | uint32_t free = 0; | ^~~~~ | ; a.cc:26:22: error: 'a' was not declared in this scope 26 | while (std::cin >> a) { | ^ a.cc:28:25: error: 'o' was not declared in this scope 28 | FindAndUpdate(1, &o); | ^ a.cc:30:25: error: 'o' was not declared in this scope 30 | FindAndUpdate(2, &o); | ^ a.cc:32:25: error: 'o' was not declared in this scope 32 | FindAndUpdate(3, &o); | ^ a.cc:34:25: error: 'o' was not declared in this scope 34 | FindAndUpdate(4, &o); | ^ a.cc:36:25: error: 'o' was not declared in this scope 36 | FindAndUpdate(5, &o); | ^ a.cc:38:25: error: 'o' was not declared in this scope 38 | FindAndUpdate(6, &o); | ^ a.cc:40:25: error: 'o' was not declared in this scope 40 | FindAndUpdate(7, &o); | ^ a.cc:42:25: error: 'o' was not declared in this scope 42 | FindAndUpdate(8, &o); | ^ a.cc:44:7: warning: ISO C++ forbids incrementing a pointer of type 'void (*)(void*) noexcept' [-Wpointer-arith] 44 | free++; | ^~~~ a.cc:44:11: error: lvalue required as increment operand 44 | free++; | ^~ a.cc:47:5: error: 'i' was not declared in this scope 47 | i++; | ^ a.cc:53:11: error: expected ';' before 'max' 53 | uint32_t max = std::min(uint32_t(o.size()) + free, uint32_t(8)); | ^~~~ | ; a.cc:54:11: error: expected ';' before 'min' 54 | uint32_t min = std::max(o.size(), 1); | ^~~~ | ; a.cc:56:16: error: 'min' was not declared in this scope; did you mean 'std::min'? 56 | std::cout << min << " " << max << std::endl; | ^~~ | std::min 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: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:56:30: error: 'max' was not declared in this scope; did you mean 'std::max'? 56 | std::cout << min << " " << max << std::endl; | ^~~ | std::max /usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~
s825224352
p03695
C++
#include<bits/stdc++.h> #include<bitset> using namespace std; #define M 1000000007 #define pb push_back #define f first #define s second #define rep(i, st, ed) for(int i=st; i<ed; i++) #define repn(i, st, ed) for(int i=st; i<=ed; i++) #define repb(i, ed, st) for(int i=ed; i>=st; i--) typedef long long ll; typedef unsigned long long int llt; typedef long double ld; const long double PI =3.141592653589793238463; const int N = 5e5 + 10; const ll INF = 1LL << 60; template<class T> void chmax(T &a,T b) { if (a<b) a=b;} template<class T> void chmin(T &a,T b) { if (a>b) a=b;} vector<int> g[N]; bool viss[N]; int vis[N]; // Normal DFS void dfs(int curr, int par) { for(auto x: g[curr]) if(x != par) dfs(x, curr); } // DFS with visiting status void dfs1(int curr, int par) { viss[curr] = 1; for(auto x: g[curr]) if(!viss[x]) dfs1(x, curr); } // DFS with strongly connected component void dfs2(int curr, int par, int num) { vis[curr] = num; for(auto x: g[curr]) if(vis[x] == 0) dfs2(x, curr, num); } // XOR from 0 to n ll fxor(ll n) { if(n < 0) return 0; if(n % 4 == 3) return 0; else if(n % 4 == 0) return n; else if(n % 4 == 1) return n^(n-1); else if(n%4 == 2) return n^(n-1)^(n-2); } // Power in logn with mod 1000000007 llt ppow(llt x, llt y) { llt res = 1; while(y > 0){ if(y&1) res = (res * x)%M; y = y >> 1; x = (x * x)%M; } return res; } // Factorial with dp llt factdp[N]; llt fact(llt x) { if(x == 0) return 1; if(x == 1) return 1; if(factdp[x] != -1) return factdp[x]; return factdp[x] = (x*fact(x-1))%M; } // String return to base b string ansConv =""; void convert10tob(llt N, int b) { if (N == 0) return; int x = N % b; N /= b; if (x < 0) N += 1; convert10tob(N, b); ansConv += to_string(x); return; } // Convert string to num wiht base b llt convertstrtob(string a, int b) { llt aa = 0; llt mul = 1; for(int i=a.length()-1; i>=0; i--) { int curr = a[i] - '0'; aa += (curr * mul); mul *= b; } return aa; } // Union Find algo with array // Find() int findpar(int curr, int arr[]) { while(arr[curr] != curr) curr = arr[curr]; return curr; } // Union() void Union(int b, int spa, int arr[]) { while(arr[b] != b) { int c = arr[b]; arr[b] = spa; b = c; } arr[b] = spa; } // Main Code bool gray, bro, green, cyn, blue, yellow, orange, red; int main() { int n; cin>>n; int minn = 0; int maxx = 0; bool f = false; int arr[n]; rep(i, 0, n) cin>>arr[i]; sort(arr, arr + n); rep(i, 0, n) { a = arr[i]; if(a < 400 && gray == 0) { minn++; maxx++; gray = 1; f = true; } else if(a >= 400 && a < 800 && bro == 0) { minn++; maxx++; bro = 1; f = true; } else if(a >= 800 && a < 1200 && green == 0) { minn++; maxx++; green = 1;f = true; } else if(a >= 1200 && a < 1600 && cyn == 0) { minn++; maxx++; cyn = 1;f = true; } else if(a >= 1600 && a < 2000 && blue == 0) { minn++; maxx++; blue = 1;f = true; } else if(a >= 2000 && a < 2400 && yellow == 0) { minn++; maxx++; yellow = 1;f = true; } else if(a >= 2400 && a < 2800 && orange == 0) { minn++; maxx++; orange = 1;f = true; } else if(a >= 2800 && a < 3200 && red == 0) { minn++; maxx++; red = 1;f = true; } else if(a >= 3200) { if(f == false) {minn++; f= true;} maxx++; } } cout<<minn<<" "<<maxx<<endl; return 0; }
a.cc: In function 'int main()': a.cc:151:5: error: 'a' was not declared in this scope 151 | a = arr[i]; | ^ a.cc: In function 'll fxor(ll)': a.cc:64:1: warning: control reaches end of non-void function [-Wreturn-type] 64 | } | ^
s200069600
p03695
C++
#include<bits/stdc++.h> #include<bitset> using namespace std; #define M 1000000007 #define pb push_back #define f first #define s second #define rep(i, st, ed) for(int i=st; i<ed; i++) #define repn(i, st, ed) for(int i=st; i<=ed; i++) #define repb(i, ed, st) for(int i=ed; i>=st; i--) typedef long long ll; typedef unsigned long long int llt; typedef long double ld; const long double PI =3.141592653589793238463; const int N = 5e5 + 10; const ll INF = 1LL << 60; template<class T> void chmax(T &a,T b) { if (a<b) a=b;} template<class T> void chmin(T &a,T b) { if (a>b) a=b;} vector<int> g[N]; bool viss[N]; int vis[N]; // Normal DFS void dfs(int curr, int par) { for(auto x: g[curr]) if(x != par) dfs(x, curr); } // DFS with visiting status void dfs1(int curr, int par) { viss[curr] = 1; for(auto x: g[curr]) if(!viss[x]) dfs1(x, curr); } // DFS with strongly connected component void dfs2(int curr, int par, int num) { vis[curr] = num; for(auto x: g[curr]) if(vis[x] == 0) dfs2(x, curr, num); } // XOR from 0 to n ll fxor(ll n) { if(n < 0) return 0; if(n % 4 == 3) return 0; else if(n % 4 == 0) return n; else if(n % 4 == 1) return n^(n-1); else if(n%4 == 2) return n^(n-1)^(n-2); } // Power in logn with mod 1000000007 llt ppow(llt x, llt y) { llt res = 1; while(y > 0){ if(y&1) res = (res * x)%M; y = y >> 1; x = (x * x)%M; } return res; } // Factorial with dp llt factdp[N]; llt fact(llt x) { if(x == 0) return 1; if(x == 1) return 1; if(factdp[x] != -1) return factdp[x]; return factdp[x] = (x*fact(x-1))%M; } // String return to base b string ansConv =""; void convert10tob(llt N, int b) { if (N == 0) return; int x = N % b; N /= b; if (x < 0) N += 1; convert10tob(N, b); ansConv += to_string(x); return; } // Convert string to num wiht base b llt convertstrtob(string a, int b) { llt aa = 0; llt mul = 1; for(int i=a.length()-1; i>=0; i--) { int curr = a[i] - '0'; aa += (curr * mul); mul *= b; } return aa; } // Union Find algo with array // Find() int findpar(int curr, int arr[]) { while(arr[curr] != curr) curr = arr[curr]; return curr; } // Union() void Union(int b, int spa, int arr[]) { while(arr[b] != b) { int c = arr[b]; arr[b] = spa; b = c; } arr[b] = spa; } // Main Code bool gray, bro, green, cyn, blue, yellow, orange, red; int main() { int n; cin>>n; int minn = 0; int maxx = 0; bool f = false; int arr[n]; rep(i, 0, n) cin>>arr[i]; sort(arr, arr + n); rep(i, 0, n) { a = arr[i]; if(a < 400 && gray == 0) { minn++; maxx++; gray = 1; f = true; } else if(a >= 400 && a < 800 && bro == 0) { minn++; maxx++; bro = 1; f = true; } else if(a >= 800 && a < 1200 && green == 0) { minn++; maxx++; green = 1;f = true; } else if(a >= 1200 && a < 1600 && cyn == 0) { minn++; maxx++; cyn = 1;f = true; } else if(a >= 1600 && a < 2000 && blue == 0) { minn++; maxx++; blue = 1;f = true; } else if(a >= 2000 && a < 2400 && yellow == 0) { minn++; maxx++; yellow = 1;f = true; } else if(a >= 2400 && a < 2800 && orange == 0) { minn++; maxx++; orange = 1;f = true; } else if(a >= 2800 && a < 3200 && red == 0) { minn++; maxx++; red = 1;f = true; } else if(a >= 3200) { if(f == false) minn++; maxx++; } } cout<<minn<<" "<<maxx<<endl; return 0; }
a.cc: In function 'int main()': a.cc:151:5: error: 'a' was not declared in this scope 151 | a = arr[i]; | ^ a.cc: In function 'll fxor(ll)': a.cc:64:1: warning: control reaches end of non-void function [-Wreturn-type] 64 | } | ^