submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s766738471
p03695
C++
#include<iostream> using namespace std; int main() { int arlong; cin >> arlong; int ar[arlong]; int color[8]={0}; int more=0; for (int i=0; i<arlong; i++) { cin >>ar[i]; } for(int i = 0; i < arlong; ++i) { if(ar[i]<3200){ if(color[ar[i]/400]==0){ color[ar[i]/400]=1; } }else{ more++; } } int sum = 0; for(int i = 0; i < 8; ++i) { sum += color[i]; // 合計に追加 } if(sum==0){ sum=1; more--; } cout << sum <<" "<< (sum+more)<<endl; return 0;
a.cc: In function 'int main()': a.cc:34:14: error: expected '}' at end of input 34 | return 0; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s690424616
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define FORr(i, j, k) for(int i = j; i >= k; --i) #define repr(i, j) FOR(i, j, 0) #define INF (1 << 30) #define MOD 1e9 + 7 typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<P, int> Pi; int N, color[9]; int main() { scanf("%d", &N); rep(i, N) { int a; scanf("%d", &a); if(1 <= a && a <= 399) ++color[0]; else if(400 <= a && a <= 700) ++color[1]; else if(800 <= a && a <= 1199) ++color[2]; else if(1200 <= a && a <= 1599) ++color[3]; else if(1600 <= a && a <= 1999) ++color[4]; else if(2000 <= a && a <= 2399) ++color[5]; else if(2400 <= a && a <= 2799) ++color[6]; else if(2800 <= a && a <= 3199) ++color[7]; else ++color[8]; } int ans = 0; rep(i, 8) if(color[i]) ++ans; if(ans == 0) { ans = 1; --color[8]; printf("%d %d\n", ans, maxi); return 0; }
a.cc: In function 'int main()': a.cc:41:32: error: 'maxi' was not declared in this scope 41 | printf("%d %d\n", ans, maxi); | ^~~~ a.cc:43:2: error: expected '}' at end of input 43 | } | ^ a.cc:19:12: note: to match this '{' 19 | int main() { | ^
s035263385
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define FORr(i, j, k) for(int i = j; i >= k; --i) #define repr(i, j) FOR(i, j, 0) #define INF (1 << 30) #define MOD 1e9 + 7 typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<P, int> Pi; int N, color[9]; int main() { scanf("%d", &N); rep(i, N) { int a; scanf("%d", &a); if(1 <= a && a <= 399) ++color[0]; else if(400 <= a && a <= 700) ++color[1]; else if(800 <= a && a <= 1199) ++color[2]; else if(1200 <= a && a <= 1599) ++color[3]; else if(1600 <= a && a <= 1999) ++color[4]; else if(2000 <= a && a <= 2399) ++color[5]; else if(2400 <= a && a <= 2799) ++color[6]; else if(2800 <= a && a <= 3199) ++color[7]; else ++color[8]; } int ans = 0; rep(i, 8) if(color[i]) ++ans; if(ans == 0) { ans = 1; --color[8]; printf("%d %d\n", ans, maxi); return 0; }
a.cc: In function 'int main()': a.cc:41:32: error: 'maxi' was not declared in this scope 41 | printf("%d %d\n", ans, maxi); | ^~~~ a.cc:43:2: error: expected '}' at end of input 43 | } | ^ a.cc:19:12: note: to match this '{' 19 | int main() { | ^
s383278278
p03695
C
#include <stdio.h> void change(int *color, int a){ if (1 <= a && a <= 399){ color[0] = 1; } else if(400 <= a && a <= 799){ color[1] = 1; } else if(800 <= a && a <= 1199){ color[2] = 1; } else if(1200 <= a && a <= 1599){ color[3] = 1; } else if(1600 <= a && a <= 1999){ color[4] = 1; } else if(2000 <= a && a <= 2399){ color[5] = 1; } else if(2400 <= a && a <= 2799){ color[6] = 1; } else if(2800 <= a && a <= 3199){ color[7] = 1; } } int main(void){ int a[100], n, i, color[8] = {0,0,0,0,0,0,0,0}, max=0, min=0; scanf("%d", &n); for (int i=0; i<n; ++i){ scanf("%d", &a[i]); } for (int i=0; i<n; ++i){ change(color, a[i]); if (a[i]>=3200){ max += 1; } } for (int i=0; i<8; ++i){ if (color[i] == 1){ max += 1; min += 1; } } if (max >= 8){ max = 8; } if (min == 0){ min = 1; printf("%d %d\n", min, max); return 0; }
main.c: In function 'main': main.c:48:1: error: expected declaration or statement at end of input 48 | } | ^
s000871793
p03695
C++
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <cmath> #include <utility> using namespace std; int N; bool Count[8] = {false, false, false, false, false, false, false. false}; int color(int rate) { return rate / 400; } int main() { cin >> N; int countEx = 0; int rate; for (int i = 0; i < N; i++) { cin >> rate; if (rate < 3200) Count[color(rate)] = true; else countEx++; } int countColors = 0; for (int i = 0; i < 8; i++) { if (Count[i]) countColors++; } cout << max(countColors, 1) << " " << countEx + countColors << endl; return 0; }
a.cc:10:67: error: expected unqualified-id before 'false' 10 | bool Count[8] = {false, false, false, false, false, false, false. false}; | ^~~~~ a.cc:10:67: error: expected '}' before 'false' 10 | bool Count[8] = {false, false, false, false, false, false, false. false}; | ~ ^~~~~ a.cc:10:72: error: expected declaration before '}' token 10 | bool Count[8] = {false, false, false, false, false, false, false. false}; | ^
s189138210
p03695
C
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(void){ int ai[100],c[9]; int N,i,sum,max,min; scanf("%d",&N); for(i = 0;i < 9; i++) c[i] = 0; for(i = 0;i < N; i++){ scanf("%d",&ai[i]) if((ai[i] / 400) < 8){ c[ai[i] / 400] = 1; }else{ c[ai[9] / 400]++; } } for(i = 0;i < 8; i++) sum += c[i]; min = sum; max = sum; if(c[ai[9]] > 0){ min++; max + c[ai[9]]; } if(min > 8) min = 8; if(max > 8) max = 8; }
main.c: In function 'main': main.c:12:43: error: expected ';' before 'if' 12 | scanf("%d",&ai[i]) | ^ | ; 13 | if((ai[i] / 400) < 8){ | ~~
s424744515
p03695
C
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(void){ int ai[100],c[9]; int N,i,sum,max,min; scanf("%d",&N); for(i = 0;i < 9; i++) c[i] = 0; for(i = 0;i < N; i++){ scanf("%d",&ai[i]) if((ai[i] / 400) < 8) c[ai[i] / 400] = 1; else c[ai[9] / 400]++; } for(i = 0;i < 8; i++) sum += c[i]; min = sum; max = sum; if(c[ai[9]] > 0){ min++; max + c[ai[9]]; } if(min > 8) min = 8; if(max > 8) max = 8; }
main.c: In function 'main': main.c:12:35: error: expected ';' before 'if' 12 | scanf("%d",&ai[i]) | ^ | ; 13 | if((ai[i] / 400) < 8) c[ai[i] / 400] = 1; | ~~ main.c:14:17: error: 'else' without a previous 'if' 14 | else c[ai[9] / 400]++; | ^~~~
s422650145
p03695
C
include<stdio.h> int main() { int N; scanf("%d", &N); int a, i, kind[9]; for(i = 0; i < N; i++){ scanf("%d", &a); switch(a / 400){ case 0 : kind[0] = 1; break; case 1 : kind[1] = 1; break; case 2 : kind[2] = 1; break; case 3 : kind[3] = 1; break; case 4 : kind[4] = 1; break; case 5 : kind[5] = 1; break; case 6 : kind[6] = 1; break; case 7 : kind[7] = 1; break; default : kind[8] ++; break; } } int sum, min, max; for(i=0; i<8; i++)sum += kind[i]; if(sum + kind[8] <= 8) max = sum + kind[8]; else max = 8; if(sum = 0)min = 1; else min = sum; printf("%d %d", min, max); return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s865135226
p03695
Java
import java.io.IOException; import java.util.Scanner; public class ABC064_C { private static int color[] = {0,0,0,0,0,0,0,0,0}; public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int count = sc.nextInt(); for(int i=0;i<count;i++){ int rate = sc.nextInt(); if(rate>=1 && rate<=399){ color[0]=1; } else if(rate>=400 && rate<=799){ color[1]=1; } else if(rate>=800 && rate<=1199){ color[2]=1; } else if(rate>=1200 && rate<=1599){ color[3]=1; } else if(rate>=1600 && rate<=1999){ color[4]=1; } else if(rate>=2000 && rate<=2399){ color[5]=1; } else if(rate>=2400 && rate<2799){ color[6]=1; } else if(rate>=2400 && rate<3199){ color[7]=1; } else if(rate>=3200){ color[8]++; } } int min = 0; for(int j=0;j<8;j++){ if(color[j]>0){ min+=1; } } int max = min + color[8]; System.out.println(min + " " + max); } }
Main.java:4: error: class ABC064_C is public, should be declared in a file named ABC064_C.java public class ABC064_C { ^ 1 error
s113418496
p03695
Java
import jdk.internal.cmm.SystemResourcePressureImpl; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] rates = new int[N]; for (int i = 0; i < N; i++) { rates[i] = sc.nextInt(); } int[] pointFlag = new int[9]; for (int i = 0; i < 9; i++) { pointFlag[i] = 0; } for(int i = 0; i<N; i++){ if(rates[i] >= 1 && rates[i] <= 399){ pointFlag[0] = 1; }else if(rates[i] >= 400 && rates[i] <= 799){ pointFlag[1] = 1; }else if(rates[i] >= 800 && rates[i] <= 1199){ pointFlag[2] = 1; }else if(rates[i] >= 1200 && rates[i] <= 1599){ pointFlag[3] = 1; }else if(rates[i] >= 1600 && rates[i] <= 1999){ pointFlag[4] = 1; }else if(rates[i] >= 2000 && rates[i] <= 2399){ pointFlag[5] = 1; }else if(rates[i] >= 2400 && rates[i] <= 2799){ pointFlag[6] = 1; }else if(rates[i] >= 2800 && rates[i] <= 3199){ pointFlag[7] = 1; }else if(rates[i] >= 3200){ pointFlag[8] += 1; } } int minAns = 0; int maxAns = 0; for (int i = 0; i < 8; i++) { minAns += pointFlag[i]; maxAns += pointFlag[i]; } maxAns += pointFlag[8]; System.out.println(minAns+" "+maxAns); } }
Main.java:1: error: package jdk.internal.cmm does not exist import jdk.internal.cmm.SystemResourcePressureImpl; ^ 1 error
s290996019
p03695
C++
#include <iostream> using namespace std; int main (){ int n; int a,temp; int b[9] = {0}; cin >> n; for (int i = 0; i < n; i++ ){ cin >> a; temp = a / 400; if (temp < 8) b[temp]++; else b[8]++; } int min = 0; for (int i = 0; i < 8; i++){ if (b[i] != 0){ min++; } } cout << min < << min + b[8] << endl; return 0; }
a.cc: In function 'int main()': a.cc:32:19: error: expected primary-expression before '<<' token 32 | cout << min < << min + b[8] << endl; | ^~
s155688276
p03695
C
#include<stdio.h> int main(){ int n,a,b,ct = 0,count = 0; int flag[8] = {0,0,0,0,0,0,0,0} scanf("%d",&n); for(;n > 0;n--){ scanf("%d",&a); if(a < 3200){flag[a /400] = 1;} else{ct++;} } for(n = 0;n < 8;n++){ count += flag[n]; } if(count != 0){a = count;} else{a = 1;} if(count + ct > 8){b = 8;} else{b = count + ct;} printf("%d %d\n",a,b); return 0; }
main.c: In function 'main': main.c:7:1: error: expected ',' or ';' before 'scanf' 7 | scanf("%d",&n); | ^~~~~
s716537191
p03695
C++
#include<bits/stdc++.h> using namespace std; int N; int mem[10] = {0}; int ans = 0; int sum = 0; int main() { scanf("%d",&N); for(int i = 0; i < N; i++) { int a; scanf("%d",&a); if(a >= 3200) { sum++; } else if(mem[a / 400] == 0) { ans++; mem[a / 400] = 1; } } printf("%d %d\n",max(ans,1),min(ans + sum)); return 0; }
a.cc: In function 'int main()': a.cc:26:36: error: no matching function for call to 'min(int)' 26 | printf("%d %d\n",max(ans,1),min(ans + sum)); | ~~~^~~~~~~~~~~ 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:26:36: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 26 | printf("%d %d\n",max(ans,1),min(ans + sum)); | ~~~^~~~~~~~~~~ /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
s718945929
p03695
C++
#include<iostream> #include<algorithm> using namespace std; #define int long long int cnt[9] = {}; signed main(){ int N; cin >> N; for (int i = 0; i < N; i++){ int tmp; cin >> tmp; if (1 <= tmp&&tmp <= 399) cnt[0]++; else if (400 <= tmp&&tmp <= 799) cnt[1]++; else if(800 <= tmp&&tmp <= 1199) cnt[2]++; else if (1200 <= tmp&&tmp <= 1599) cnt[3]++; else if (1600 <= tmp&&tmp <= 1999) cnt[4]++; else if (2000 <= tmp&&tmp <= 2399) cnt[5]++; else if (2400 <= tmp&&tmp <= 2799) cnt[6]++; else if (2800 <= tmp&&tmp <= 3199) cnt[7]++; else if (3200 <= tmp)cnt[8]++; } int min = 0 , max = 0,now=0; for (int i = 0; i < 8; i++){ if (cnt[i]!=0) now++; } if (now == 0 && tmp[8] != 0){ cout << "1 1" << endl; return 0; } max = now + cnt[8]; if (max>8) max = 8; min = now; cout << min <<" "<< max << endl; }
a.cc: In function 'int main()': a.cc:27:25: error: 'tmp' was not declared in this scope; did you mean 'tm'? 27 | if (now == 0 && tmp[8] != 0){ | ^~~ | tm
s742419403
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> rate(8, 0); int in; int over = 0; int cnt = 0; for(int i = 0; i < n; i++){ cin >> in; if(in >= 3200)over++; else rate[a / 400]++; } for(int i = 0; i < n; i++)if(rate[i] > 0)cnt++; cout << max(1, cnt) << ' ' << cnt + over << endl; }
a.cc: In function 'int main()': a.cc:14:27: error: 'a' was not declared in this scope 14 | else rate[a / 400]++; | ^
s459988913
p03695
C++
#include<stdio.h> int n,a,i,si,br,gr,sk,bl,ye,ol,re,t,g,p,x,y,o; int main() { scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); if(a<400){ si=1; }else if(400<=a&&a<800){ br=1; }else if(800<=a&&a<1200){ gr=1; }else if(1200<=a&&a<1600){ sk=1; }else if(1600<=a&&a<2000){ bl=1; }else if(2000<=a&&a<2400){ ye=1; }else if(2400<=a&&a<2800){ ol=1; }else if(2800<=a&&a<3200){ re=1; }else if(3200<=a){ t++; } } g=si+br+gr+sk+bl+ye+ol+re; o=g+t; if(g==0&&t>0){ g=1; } if(o=>8){ o=8; } printf("%d %d\n",g,o); return 0; }
a.cc: In function 'int main()': a.cc:33:14: error: expected primary-expression before '>' token 33 | if(o=>8){ | ^
s639794115
p03695
C++
#include <iostream> using namespace std; bool ary[8]; int main(){ int N,sum=0; cin>>N; int tmp; for(int i=1;i<=N;i++){ cin>>tmp; if(tmp<3200)ary[(tmp-1)/400]|=true; else sum++; } int num=0; for(int i=0;i<8;i++) if(ary[i]) num++; if(!res) cout<<1<<" "<<sum<<endl; else cout<<res<<" "<<res+sum<<endl; return 0; }
a.cc: In function 'int main()': a.cc:17:13: error: 'res' was not declared in this scope 17 | if(!res) cout<<1<<" "<<sum<<endl; | ^~~
s751835603
p03695
C++
int main(){ int N; std::cin >> N; int a[100]; for (int i = 0; i < N; ++i) { std::cin >> a[i]; } int col[13]{}; for (int i = 0; i < N; ++i) { col[(a[i] / 400)] += 1; } int colcount = 0; for (int i = 0; i < 8; ++i) { colcount += (col[i] ? 1 : 0); } int colfree = 0; for (int i = 8; i < 13; ++i) { colfree += col[i]; } int min = colcount; int max = colcount + colfree; if (min == 0) { min = 1; } std::cout << min << ' ' << max << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:5:14: error: 'cin' is not a member of 'std' 5 | std::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 | a.cc:10:22: error: 'cin' is not a member of 'std' 10 | std::cin >> a[i]; | ^~~ a.cc:10:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:35:14: error: 'cout' is not a member of 'std' 35 | std::cout << min << ' ' << max << std::endl; | ^~~~ a.cc:35:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:35:48: error: 'endl' is not a member of 'std' 35 | std::cout << min << ' ' << max << std::endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 |
s665066038
p03695
Java
public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.next()); int[] a = new int[n]; int wildCount = 0; for(int i=0;i<n;i++){ a[i] = Integer.parseInt(scan.next()); if(a[i]>=3200)wildCount++; } int min,sum = 0; for(int j=0;j<8;j++){//jは色 if(check(a,j))sum ++; } //最小値 if(sum==0){ min = 1; }else{ min = sum; } //最大値 int max = sum; max += wildCount;     System.out.println(min+" "+max);     }   static boolean check(int[] a,int b){ for(int i=0;i<a.length;i++){ if(400*b<=a[i] && a[i]<400*(b+1)){ return true; } } return false; } }
Main.java:24: error: illegal character: '\u00a0' ? ^ Main.java:25: error: illegal character: '\u00a0' ? ^ Main.java:27: error: illegal character: '\u00a0' ? ^ Main.java:28: error: illegal character: '\u00a0' ? ^ Main.java:30: error: illegal character: '\u00a0' ? ^ 5 errors
s679159498
p03695
C
#include<stdio.h> #define scanf scanf_s int main(void) { int N = 0; int a[4801]; int hai = 0, tya = 0, midori = 0, mizu = 0, ao = 0, ki = 0, daidai = 0, aka = 0, over = 0; int kinds = 0, max = 0; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d", &a[i]); switch (a[i] / 400) { case 0: hai++; break; case 1: tya++; break; case 2: midori++; break; case 3: mizu++; break; case 4: ao++; break; case 5: ki++; break; case 6: daidai++; break; case 7: aka++; break; default:over++; break; } } if (hai > 0) kinds++; if (tya > 0) kinds++; if (midori > 0) kinds++; if (mizu > 0) kinds++; if (ao > 0) kinds++; if (ki > 0) kinds++; if (daidai > 0) kinds++; if (aka > 0) kinds++; max = kinds + over; if (max > 7)max = 7; printf("%d %d", kinds, max); return 0; }
main.c: In function 'main': main.c:2:15: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 2 | #define scanf scanf_s | ^~~~~~~ main.c:10:9: note: in expansion of macro 'scanf' 10 | scanf("%d", &N); | ^~~~~
s018582402
p03695
C
#include<stdio.h> #define scanf scanf_s int main(void) { int N = 0; int a[4801]; int hai = 0, tya = 0, midori = 0, mizu = 0, ao = 0, ki = 0, daidai = 0, aka = 0, over = 0; int kinds = 0, max = 0; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d", &a[i]); switch (a[i] / 400) { case 0: hai++; break; case 1: tya++; break; case 2: midori; break; case 3: mizu++; break; case 4: ao++; break; case 5: ki++; break; case 6: daidai++; break; case 7: aka++; break; default:over++; break; } } if (hai > 0) kinds++; if (tya > 0) kinds++; if (midori > 0) kinds++; if (mizu > 0) kinds++; if (ao > 0) kinds++; if (ki > 0) kinds++; if (daidai > 0) kinds++; if (aka > 0) kinds++; max = kinds + over; if (max > 7)max = 7; printf("%d %d", kinds, max); return 0; }
main.c: In function 'main': main.c:2:15: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 2 | #define scanf scanf_s | ^~~~~~~ main.c:10:9: note: in expansion of macro 'scanf' 10 | scanf("%d", &N); | ^~~~~
s409638476
p03695
C++
#include <iostream> #include <map> #include <algorithm> using namespace std; int main() { int N; cin >> N; map<int, int> r; int x = 0; for (int i = 0; i < N; ++i) { int a; cin >> a; if (a < 3200) { ++r[a / 400]; } else { ++x; } } int mn = r.size(); int mx = min(8u, r.size() + x); cout << mn << " " << mx << endl; }
a.cc: In function 'int main()': a.cc:24:21: error: no matching function for call to 'min(unsigned int, std::map<int, int>::size_type)' 24 | int mx = min(8u, r.size() + x); | ~~~^~~~~~~~~~~~~~~~~~ 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:24:21: note: deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'}) 24 | int mx = min(8u, r.size() + x); | ~~~^~~~~~~~~~~~~~~~~~ /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:24:21: note: mismatched types 'std::initializer_list<_Tp>' and 'unsigned int' 24 | int mx = min(8u, r.size() + x); | ~~~^~~~~~~~~~~~~~~~~~
s911930957
p03695
C++
#include<stdio.h> int n,a,i,si,br,gr,sk,bl,ye,or,re,t; int main() { scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); if(a<400){ si=1; }else if(400<=a&&a<800){ br=1; }else if(800<=a&&a<1200){ gr=1; }else if(1200<=a&&a<1600){ sk=1; }else if(1600<=a&&a<2000){ bl=1; }else if(2000<=a&&a<2400){ ye=1; }else if(2400<=a&&a<2800){ or=1; }else if(2800<=a&&a<3200){ re=1; }else if(3200<=a){ t++; } } printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9); return 0; }
a.cc:2:29: error: expected unqualified-id before 'or' token 2 | int n,a,i,si,br,gr,sk,bl,ye,or,re,t; | ^~ a.cc: In function 'int main()': a.cc:21:33: error: expected primary-expression before 'or' token 21 | or=1; | ^~ a.cc:21:35: error: expected primary-expression before '=' token 21 | or=1; | ^ a.cc:23:33: error: 're' was not declared in this scope; did you mean 'ye'? 23 | re=1; | ^~ | ye a.cc:25:33: error: 't' was not declared in this scope 25 | t++; | ^ a.cc:29:44: error: expected primary-expression before 'or' token 29 | printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9); | ^~ a.cc:29:47: error: 're' was not declared in this scope; did you mean 'ye'? 29 | printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9); | ^~ | ye a.cc:29:69: error: expected primary-expression before 'or' token 29 | printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9); | ^~ a.cc:29:75: error: 't' was not declared in this scope 29 | printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9); | ^
s485909764
p03695
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int Rate(int rate){ rate = rate/400; if (rate > 8) { return 8; } return rate; } int main(int argc, char const *argv[]) { int count,temp,color,over; color = over = 0; std::vector<int> v = {0,1,2,3,4,5,6,7}; std::cin >> count; vec.resize(count); for (size_t i = 0; i < count; i++) { std::cin >> temp; temp = Rate(temp); if (temp == 8) { over++; } for (size_t j = 0; j < v.size(); j++) { if (temp == v[j]) { color++; v.erase(j); break; } } } std::cout << color << " " << min(color+over,8) << '\n'; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:20:9: error: 'vec' was not declared in this scope 20 | vec.resize(count); | ^~~ a.cc:30:40: error: no matching function for call to 'std::vector<int>::erase(size_t&)' 30 | v.erase(j); | ~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]' 1536 | erase(const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/stl_vector.h:1536:28: note: no known conversion for argument 1 from 'size_t' {aka 'long unsigned int'} to 'std::vector<int>::const_iterator' 1536 | erase(const_iterator __position) | ~~~~~~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]' 1564 | erase(const_iterator __first, const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate expects 2 arguments, 1 provided
s403576537
p03695
C++
//start of jonathanirvings' template v3.0.3 (BETA) #include <bits/stdc++.h> using namespace std; #define _CRT_SECURE_NO_WARNINGS /** using std::max; using std::swap; using std::abs; using std::priority_queue; using std::queue; using std::bitset; using std::make_tuple; using std::istream; using std::ostream; using std::fixed; using std::greater; using std::tuple; using std::tie; using std::make_pair; using std::cout; using std::cerr; using std::endl; using std::lower_bound; using std::upper_bound; using std::deque; using std::min; using std::map; using std::string; using std::fill; using std::copy; using std::sort; using std::unique; using std::unordered_set; using std::multiset; using std::nth_element; using std::min_element; using std::max_element; using std::vector; using std::set; using std::unordered_map; using std::pair; using std::next_permutation; using std::reverse; using std::rotate; using std::cin; using std::iota; using std::function; using std::shuffle; using std::iter_swap; int const INF = 100 + (int) 1e9; ll const INFL = 100 + (ll) 1e18; const ll INF = 1e18; */ typedef long double ld; typedef unsigned int uint; typedef complex<double> P; typedef unsigned char byte; typedef long long ll; typedef long long LL; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<double, double> pdd; typedef pair<string, string> pss; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<pll> vll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<bool> vb; //typedef vector<vb> vvb; const ll moder = 1e9+7; double EPS = 1e-9; int INF = 1000000005; long long INFF = 1000000000000000005LL; double PI = acos(-1); int dirx[8] = {-1,0,0,1,-1,-1,1,1}; int diry[8] = {0,1,-1,0,-1,1,-1,1}; #ifdef TESTING #define DEBUG fprintf(stderr,"====TESTING====\n") #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl #define debug(...) fprintf(stderr, __VA_ARGS__) #else #define DEBUG #define VALUE(x) #define debug(...) #endif // nichijou // data type #define fi first #define se second #define _1 first #define _2 second // STL container #define ALL(a) (a).begin(), (a).end() #define All(s) (s).begin(),(s).end() #define rAll(s) (s).rbegin(),(s).rend() #define CLR(a) a.clear() #define BK(a) (a.back()) #define FT(a) (a.front()) #define DB(a) a.pop_back() #define DF(a) a.pop_front() #define PB push_back #define EB emplace_back #define MP make_pair #define mp make_pair #define pb push_back #define REP(i,a,b) for (int i(a), _B(b); i < _B; ++i) #define RP(i,n) REP(i,0,n) #define PER(i,a,b) for(int i((a)-1), _B(b); i >= _B; --i) #define PR(i,n) PER(i,n,0) #define REP1(i,a,b) REP(i,a,(b)+1) #define RP1(i,n) REP1(i,1,n) #define PER1(i,a,b) PER(i,(a)+1,b) #define PR1(i,n) PER1(i,n,1) #define DO(n) REP(__i,0,n) #define FO(x, n) for (int x = 0; x < n; ++x) #define RFO(x, n) for (int x = n - 1; x >= 0; --x) #define FOR(i,a,b) for(int _b=(b),(i)=(a);(i)<_b;++(i)) #define RFOR(x, a, b) for (int x = b - 1; x >= a; --x) //#define FOR(x, a, b) for (int x = a; x < b; ++x) #define ROF(i,b,a) for(int _a=(a),i=(b);i>_a;--i) #define FORN(a,b,c) for (int (a)=(b);(a)<=(c);++(a)) #define FORD(a,b,c) for (int (a)=(b);(a)>=(c);--(a)) #define FORSQ(a,b,c) for (int (a)=(b);(a)*(a)<=(c);++(a)) #define FORC(a,b,c) for (char (a)=(b);(a)<=(c);++(a)) #define FOREACH(a,b) for (auto &(a) : (b)) #define FOR_ITER(x, a) for(auto (x) = (a).begin(); (x) != (a).end(); ++(x)) #define REPN(i,n) FORN(i,1,n) #define REPP(I, A, B) for (int I = (A); I < (B); ++I) #define MS0(X) memset((X), 0, sizeof((X))) #define MS1(X) memset((X), -1, sizeof((X))) #define LEN(X) strlen(X) #define SQR(x) ((LL)(x) * (x)) #define RESET(a,b) memset(a,b,sizeof(a)) #define ALLA(arr,sz) arr,arr+sz #define SZ(X) ((int)(X).size()) #define SIZE(X) ((int)(X).size()) #define SORT(v) sort(ALL(v)) #define REVERSE(v) reverse(ALL(v)) #define SORTA(arr,sz) sort(ALLA(arr,sz)) #define REVERSEA(arr,sz) reverse(ALLA(arr,sz)) #define PERMUTE next_permutation #define TC(t) while(t--) #define MSET(m,v) memset(m,v,sizeof(m)) #define MAX_PQ(T) priority_queue<T> #define MIN_PQ(T) priority_queue<T,vector<T>,greater<T>> #define IO(){ios_base::sync_with_stdio(0);cin.tie(0);} #define nl '\n' #define cint1(a) int a;cin>>a #define cint2(a,b) int a,b;cin>>a>>b #define cint3(a,b,c) int a,b,c;cin>>a>>b>>c #define cout1(a) cout<<(a)<<endl #define cout2(a,b) cout<<(a)<<" "<<(b)<<endl #define cout3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl /* I gave you my heart and then you turned around. */ void _BG(const char * s) {} template<typename T, typename ... TT> void _BG(const char * s,T a, TT...b) { for (int c = 0; *s && (c || *s != ','); ++s) { cerr<<*s; switch (*s) { case '(': case '[': case '{': ++c; break; case ')': case ']': case '}': --c; break; } } cerr<<" = "<<a; if (*s) { cerr<<", "; _BG(++s,b...); } else cerr<<endl; } #define BG(...) do { \ cerr << __PRETTY_FUNCTION__ << ':' << __LINE__ << ": "; \ _BG(#__VA_ARGS__,__VA_ARGS__); \ } while(0) /* Reading input is now 20% cooler! */ bool RD(void) {return true;} bool RD(char & a) {return scanf(" %c", &a) == 1;} bool RD(char * a) {return scanf("%s", a) == 1;} bool RD(double & a) {return scanf("%lf", &a) == 1;} bool RD(int & a) {return scanf("%d", &a) == 1;} bool RD(ll & a) {return scanf("%lld", &a) == 1;} template<typename T, typename ... TT> bool RD(T & a, TT & ... b) {return RD(a) && RD(b...);} /* Do princesses dream of magic sheep? */ #define RI(a) RD(a) #define RII(a,b) RI(a); RI(b) #define RIII(a,b,c) RI(a); RII(b,c) #define RIIII(a,b,c,d) RI(a); RIII(b,c,d) #define DRI(a) int a; RD(a) #define DRII(a,b) RI(a); RI(b) #define DRIII(a,b,c) RI(a); RII(b,c) #define DRIIII(a,b,c,d) RI(a); RIII(b,c,d) #define RS(X) scanf("%s", (X)) #define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0) /* For it's time for you to fulfill your output. */ void PT(const char a) {putchar(a);} void PT(const char * a) {fputs(a, stdout);} void PT(char * a) {fputs(a, stdout);} void PT(const double a) {printf("%.16f", a);} void PT(const int a) {printf("%d", a);} void PT(const ll a) {printf("%lld", a);} /* The line will last forever! */ template<char sep = ' ',char end = '\n'> void PL(void) {if (end) PT(end);} template<char sep = ' ',char end = '\n',typename T, typename ... TT> void PL(const T a, const TT ... b) {PT(a); if (sizeof...(b) && sep) PT(sep); PL<sep,end>(b...);} /* Good Luck && Have Fun ! */ inline string IntToString(LL a){ char x[100]; sprintf(x,"%lld",a); string s = x; return s; } inline LL StringToInt(string a){ char x[100]; LL res; strcpy(x,a.c_str()); sscanf(x,"%lld",&res); return res; } inline string GetString(void){ char x[1000005]; scanf("%s",x); string s = x; return s; } inline string uppercase(string s){ int n = SIZE(s); RP(i,n) if (s[i] >= 'a' && s[i] <= 'z') s[i] = s[i] - 'a' + 'A'; return s; } inline string lowercase(string s){ int n = SIZE(s); RP(i,n) if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a'; return s; } inline void OPEN (string s) { #ifndef TESTING freopen ((s + ".in").c_str (), "r", stdin); freopen ((s + ".out").c_str (), "w", stdout); #endif } struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); } } initializer; template<typename T> istream& operator>>(istream &s, vector<T> &v) { for (T &t : v) s >> t; return s; } template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) { for (const T &t : v) s << t << endl; return s; } template<typename T> T min(vector<T>& v) {return *min_element(v.begin(), v.end());} template<typename T> T max(vector<T>& v) {return *max_element(v.begin(), v.end());} template<typename T> int min_element(vector<T>& v) {return min_element(v.begin(), v.end()) - v.begin();} template<typename T> int max_element(vector<T>& v) {return max_element(v.begin(), v.end()) - v.begin();} template<typename T> void sort(vector<T>& v) {sort(v.begin(), v.end());} template<typename T, typename Function> void sort(vector<T>& v, Function func) {sort(v.begin(), v.end(), func);} template<typename T> void rsort(vector<T>& v) {sort(v.rbegin(), v.rend());} template<typename T> void reverse(vector<T>& v) {reverse(v.begin(), v.end());} template<typename T> void unique(vector<T>& v) {v.erase(unique(v.begin(), v.end()), v.end());} template<typename T> void nth_element(vector<T>& v, int n) {nth_element(v.begin(), v.begin() + n, v.end());} template<typename T> bool next_permutation(vector<T>& v) {return next_permutation(v.begin(), v.end());} template<typename T> int find(vector<T>& v, T t) {return find(v.begin(), v.end(), t) - v.begin();} template<typename T> int in(vector<T> v, T t) {return find(v, t) != (int)v.size();} template<typename T> int lower_bound(vector<T>& v, T t) {return lower_bound(v.begin(), v.end(), t) - v.begin();} template<typename T> int upper_bound(vector<T>& v, T t) {return upper_bound(v.begin(), v.end(), t) - v.begin();} template<typename T> T accumulate(const vector<T>& v, function<T(T, T)> func = plus<T>()) {return accumulate(v.begin(), v.end(), T(), func);} template<typename T> void adjacent_difference(vector<T>& v) {adjacent_difference(v.begin(), v.end(), v.begin());} template<typename T> void adjacent_difference(vector<T>& v, vector<T>& u) {adjacent_difference(v.begin(), v.end(), u.begin());} template<typename T> void partial_sum(vector<T>& v, vector<T>& u) {partial_sum(v.begin(), v.end(), u.begin());} template<typename T> T inner_product(vector<T>& v, vector<T>& u) {return inner_product(v.begin(), v.end(), u.begin(), T(0));} template<typename T> int count(const vector<T>& v, T t) {return count(v.begin(), v.end(), t);} template<typename T, typename Function> int count_if(const vector<T>& v, Function func) {return count_if(v.begin(), v.end(), func);} template<typename T, typename Function> void remove_if(vector<T>& v, Function func) {v.erase(remove_if(v.begin(), v.end(), func), v.end());} template<typename T, typename Function> bool any_of(vector<T> v, Function func) {return any_of(v.begin(), v.end(), func);} template<typename T> vector<T> subvector(vector<T>& v, int a, int b) {return vector<T>(v.begin() + a, v.begin() + b);} template<typename T> int kinds(const vector<T>& v) {return set<T>(v.begin(), v.end()).size();} template<typename T> void iota(vector<T>& v) {iota(v.begin(), v.end(), T());} template<typename T> bool is_sorted(const vector<T>& v) {return is_sorted(v.begin(), v.end());} template<typename Weight, typename Value> Value knapsack(Weight maxWeight, const vector<Weight>& weight, const vector<Value>& value) { vector<Value> dp1(maxWeight + Weight(1)), dp2(maxWeight + Weight(1)); for (size_t i = 0; i < weight.size(); ++i) { for (int w = 0; w <= maxWeight; ++w) { Weight ww = Weight(w) + weight[i]; Value vv = dp1[w] + value[i]; if (ww <= maxWeight && dp2[ww] < vv) dp2[ww] = vv; } dp1 = dp2; } return dp1[maxWeight]; } template<typename Weight, typename Value = long long> vector<Value> knapsackCount(Weight maxWeight, const vector<Weight>& weight) { vector<Value> dp1(maxWeight + Weight(1)), dp2(maxWeight + Weight(1)); dp1[0] = dp2[0] = 1; for (auto& w : weight) { for (int i = 0; i <= maxWeight; ++i) { Weight ww = Weight(i) + w; if (ww <= maxWeight) dp2[ww] += dp1[i]; } dp1 = dp2; } return dp1; } template<typename Weight> vector<bool> knapsackFill(Weight maxWeight, const vector<Weight>& weight) { vector<bool> dp1(maxWeight + Weight(1)), dp2(maxWeight + Weight(1)); dp1[0] = dp2[0] = true; for (auto& w : weight) { for (int i = 0; i <= maxWeight; ++i) { Weight ww = Weight(i) + w; if (ww <= maxWeight && dp1[i]) dp2[ww] = true; } dp1 = dp2; } return dp1; } //int main() { // int64_t n, a, res = 0; // cin >> n >> a; // vector<int> x(n); // cin >> x; // vector<int> y, z; // for (int i : x) { // if (i >= a) y.emplace_back(i - a); // else z.emplace_back(a - i); // } // auto yy = knapsackCount(2500, y); // auto zz = knapsackCount(2500, z); // for (int i = 0; i <= 2500; ++i) res += yy[i] * zz[i]; // cout << res - 1 << endl; //} inline bool feq(const double& a, const double& b) { return fabs(a - b) < 1e-10; } //ll rnd(ll x, ll y) { static auto gen = std::bind(std::uniform_int_distribution<ll>(), std::mt19937); return gen() % (y - x + 1) + x; } bool is_prime(ll x) { if (x <= 1) return 0; for (ll y = 2; y * y <= x; ++y) if (x % y == 0) return 0; return 1; } ll sqr(int a) { return (ll) a * a; } ld sqr(ld a) { return a * a; } ll sqr(ll a) { return a * a; } ll gcd(ll a, ll b) { while (b > 0) { ll t = a % b; a = b; b = t; } return a; } long long int nCm(long long int n, long long int m) { if (m == 1) { return n; } else { return n*nCm(n - 1, m - 1) / m; } } long long int npm(long long int n,long long int m) { if (m == 1) { return n; } else if (m == 0) { return 1; }else { return n*npm(n, m - 1); } } template<class A,class B>inline bool mina(A &x,const B &y){return(y<x)?(x=y,1):0;} template<class A,class B>inline bool maxa(A &x,const B &y){return(x<y)?(x=y,1):0;} template<class Int, Int mod> class ModInt { public: Int x; ModInt(): x(0) {} ModInt(int a, bool m=1) { if(m) {x=a%mod; if(x<0)x+=mod;} else x=a; } ModInt(LL a, bool m=1) { if(m) {x=a%mod; if(x<0)x+=mod;} else x=a; } inline ModInt &operator+=(ModInt that) { if((x += that.x) >= mod) x -= mod; return *this; } inline ModInt &operator-=(ModInt that) { if((x += mod - that.x) >= mod) x -= mod; return *this; } inline ModInt &operator*=(ModInt that) { x = LL(x) * that.x % mod; return *this; } inline ModInt &operator/=(ModInt that) { return *this *= that.inverse(); } inline ModInt operator-() const { return ModInt(-this->x); } ModInt inverse() const {LL a=x,b=mod,u=1,v=0;while(b){LL t=a/b;a-=t*b;u-=t*v;swap(a,b);swap(u,v);} return ModInt(u);} inline friend ostream& operator << (ostream &out, ModInt m) {return out << m.x;} #define op(o1,o2) ModInt operator o1(ModInt that) const { return ModInt(*this) o2 that; } op(+,+=) op(-,-=) op(*,*=) op(/,/=) #undef op #define op(o) bool operator o(ModInt that) const { return x o that.x; } op(==) op(!=) op(<) op(<=) op(>) op(>=) #undef op }; typedef ModInt<int,moder> Mint; #define MAXN (300005) Mint F[MAXN]; Mint FI[MAXN]; Mint Cnr(int n, int r) { if(r < 0 || r > n) return 0; return F[n] * FI[r] * FI[n-r]; } // spnauT //end of jonathanirvings' template v3.0.3 (BETA) //ll si(int i) { // return (ll)i * (i + 1) / 2; //} // //ll multModer(ll l1, ll l2) { // return (l1 * l2) % moder; //} // //ll addModer(ll l1, ll l2) { // return (l1 + l2) % moder; //} int main(){ IO(); cint1(N); set<int> rs; int m = 0; FO(i, N) { cint1(a); if (a < 3200) { rs.insert(a / 400); } else { m++; } } cout2(max(rs.size(), 1), rs.size() + m); // F[0] = 1; // FOR(i,1,MAXN) F[i] = F[i-1] * i; // FI[MAXN-1] = F[MAXN-1].inverse(); // ROF(i,MAXN-2,-1) FI[i] = FI[i+1] * (i+1); // // cint2(H,W); // cint2(A,B); // Mint sol; // FOR(i,B+1,W+1) sol += Cnr(i-1+H-A-1, i-1) * Cnr(A-1+W-i, A-1); // // cout << sol << nl; // LL C[55][55]; // C[0][0] = 1; // FORN(i,1,50) // { // C[i][0] = C[i][i] = 1; // FOR(j,1,i) C[i][j] = C[i-1][j-1] + C[i-1][j]; // } // // long double avg0 = (long double) accumulate(ns.rbegin(), ns.rbegin() + i, 0ll) / i; // if (avg - avg0 > 1e-6) { // break; // } // printf("%.6Lf\n%lld\n", avg, rs); return 0; } /** //#include <fcntl.h> void solve() { } int main() { //freopen("", "r", stdin); //freopen("", "w", stdout); cout.precision(15); cout << fixed; cerr.precision(6); cerr << fixed; solve(); #ifdef LOCAL cerr << "time: " << (ll) clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl; #endif } */ /** #define SORT(v) sort(v.begin(), v.end()) #include <iostream> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <cstdlib> #include <cstdarg> #include <cstdio> #include <cmath> #include <numeric> #include <utility> // #include "ane.cpp" #define INF (int)1e9 #define INFLL (long long)1e18 #define NMAX 100005 #define MMAX 100005 #define MOD 100000 using namespace std; // コメントアウトするとdebug()を実行しない // #define DEBUG // // ライブラリ // // frequent used aliases typedef long long ll; typedef pair<int, int> p; typedef pair<ll, int> lp; typedef pair<ll, ll> llp; typedef vector<int> vec; typedef vector<vec> mat; // frequent used constants static const int di[] = {-1, 0, 1, -1, 1, -1, 0, 1}; static const int dj[] = {-1, -1, -1, 0, 0, 1, 1, 1}; // デバッグ用printf void debug(const char* format, ...){ #ifndef DEBUG return; #endif va_list arg; va_start(arg, format); vprintf(format, arg); // コンソールに出力 va_end(arg); } // n次元配列の初期化。第2引数の型のサイズごとに初期化していく。 template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } // Union-Find Tree class UnionFindTree{ struct node{ int par; }; std::vector<node> T; public: void init(int num){ T.resize(num+1); // ignore T[0] for (int i = 1; i <= num; ++i) { T[i].par = i; } } void unite(int x, int y){ T[find(y)].par = find(x); } int find(int x){ if (T[x].par == x) return x; else return T[x].par = find(T[x].par); } bool same(int x, int y){ return find(x) == find(y); } }; // Segment Tree for Range Minimum Query // ********************************************************** // *** important: all functions' variable, *** // *** such as "index", "l", "r", etc., must be 0-origin. *** // ********************************************************** // ******************************************** // *** important: NMAX must be power of 2. *** // ******************************************** template<typename T> class SegmentTree{ private: ll N; T INF_VAL; T dat[NMAX * 2]; // 0 origin, A[i] = dat[i + N] T _query(ll l, ll r, ll l_resp, ll r_resp, ll i_dat){ debug("query(%lld, %lld, %lld, %lld, %lld) called\n", l, r, l_resp, r_resp, i_dat); if (r < l_resp || r_resp < l) return INF_VAL; else if(l <= l_resp && r_resp <= r) return dat[i_dat]; else return min(_query(l ,r, l_resp, (l_resp + r_resp) / 2, i_dat * 2), _query(l, r, (l_resp + r_resp) / 2 + 1, r_resp, i_dat * 2 + 1)); } public: void init(ll _N, T _inf_val){ N = 1; while(N < _N) N *= 2; INF_VAL = _inf_val; Fill(dat, _inf_val); } T get(ll index){ return dat[index + N]; } void set(int index, T val){ int i_dat = index + N; dat[i_dat] = val; for (i_dat /= 2; i_dat > 0; i_dat /= 2) { dat[i_dat] = min(dat[i_dat * 2], dat[i_dat * 2 + 1]); } } T query(ll l, ll r){ return _query(l, r, 0, N - 1, 1); } void dump(){ cout << "*** SegTree dump begin ***\n"; cout << "N = " << N << ", INF_VAL = " << INF_VAL << endl; for (int i = 1; i < N * 2; i *= 2) { for (int j = i; j < i * 2; ++j) { if(dat[j] == INF_VAL) cout << "INF "; else cout << dat[j] << " "; } cout << endl; } cout << "*** SegTree dump end ***\n"; } }; // Binary Indexed Tree for Range Sum Query // ******************************************* // *** important: all functions' variable, *** // *** such as "i", must be 1-origin. *** // ******************************************* template<typename T> class BinaryIndexedTree{ private: ll N; T dat[NMAX + 1]; // 1 origin, A[i] = sum(i) - sum(i-1) public: void init(ll _N){ N = _N; Fill(dat, 0); } void add(int i, T val){ while(i <= N) { dat[i] += val; i += i & -i; } } T sum(ll i){ T ret = 0; while(i > 0) { ret += dat[i]; i -= i & -i; // set last HIGH bit to LOW } return ret; } T sum(ll left, ll right){ return sum(right) - sum(left - 1); } void dump(){ cout << "*** BITree dump begin ***\n"; cout << "N = " << N << endl; for (int i = 1; i <= N; i *= 2) { cout << dat[i] << " "; } cout << "*** BITree dump end ***\n"; } }; // // ライブラリ終了 // */
a.cc: In function 'int main()': a.cc:489:14: error: no matching function for call to 'max(std::set<int>::size_type, int)' 489 | cout2(max(rs.size(), 1), rs.size() + m); | ~~~^~~~~~~~~~~~~~ a.cc:141:27: note: in definition of macro 'cout2' 141 | #define cout2(a,b) cout<<(a)<<" "<<(b)<<endl | ^ a.cc:275:24: note: candidate: 'template<class T> T max(std::vector<_Tp>&)' 275 | template<typename T> T max(vector<T>& v) {return *max_element(v.begin(), v.end());} | ^~~ a.cc:275:24: note: candidate expects 1 argument, 2 provided 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: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:489:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 489 | cout2(max(rs.size(), 1), rs.size() + m); | ~~~^~~~~~~~~~~~~~ a.cc:141:27: note: in definition of macro 'cout2' 141 | #define cout2(a,b) cout<<(a)<<" "<<(b)<<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:489:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 489 | cout2(max(rs.size(), 1), rs.size() + m); | ~~~^~~~~~~~~~~~~~ a.cc:141:27: note: in definition of macro 'cout2' 141 | #define cout2(a,b) cout<<(a)<<" "<<(b)<<endl | ^
s805645271
p03695
C++
//start of jonathanirvings' template v3.0.3 (BETA) #include <bits/stdc++.h> using namespace std; #define _CRT_SECURE_NO_WARNINGS /** using std::max; using std::swap; using std::abs; using std::priority_queue; using std::queue; using std::bitset; using std::make_tuple; using std::istream; using std::ostream; using std::fixed; using std::greater; using std::tuple; using std::tie; using std::make_pair; using std::cout; using std::cerr; using std::endl; using std::lower_bound; using std::upper_bound; using std::deque; using std::min; using std::map; using std::string; using std::fill; using std::copy; using std::sort; using std::unique; using std::unordered_set; using std::multiset; using std::nth_element; using std::min_element; using std::max_element; using std::vector; using std::set; using std::unordered_map; using std::pair; using std::next_permutation; using std::reverse; using std::rotate; using std::cin; using std::iota; using std::function; using std::shuffle; using std::iter_swap; int const INF = 100 + (int) 1e9; ll const INFL = 100 + (ll) 1e18; const ll INF = 1e18; */ typedef long double ld; typedef unsigned int uint; typedef complex<double> P; typedef unsigned char byte; typedef long long ll; typedef long long LL; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<double, double> pdd; typedef pair<string, string> pss; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<pll> vll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<bool> vb; //typedef vector<vb> vvb; const ll moder = 1e9+7; double EPS = 1e-9; int INF = 1000000005; long long INFF = 1000000000000000005LL; double PI = acos(-1); int dirx[8] = {-1,0,0,1,-1,-1,1,1}; int diry[8] = {0,1,-1,0,-1,1,-1,1}; #ifdef TESTING #define DEBUG fprintf(stderr,"====TESTING====\n") #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl #define debug(...) fprintf(stderr, __VA_ARGS__) #else #define DEBUG #define VALUE(x) #define debug(...) #endif // nichijou // data type #define fi first #define se second #define _1 first #define _2 second // STL container #define ALL(a) (a).begin(), (a).end() #define All(s) (s).begin(),(s).end() #define rAll(s) (s).rbegin(),(s).rend() #define CLR(a) a.clear() #define BK(a) (a.back()) #define FT(a) (a.front()) #define DB(a) a.pop_back() #define DF(a) a.pop_front() #define PB push_back #define EB emplace_back #define MP make_pair #define mp make_pair #define pb push_back #define REP(i,a,b) for (int i(a), _B(b); i < _B; ++i) #define RP(i,n) REP(i,0,n) #define PER(i,a,b) for(int i((a)-1), _B(b); i >= _B; --i) #define PR(i,n) PER(i,n,0) #define REP1(i,a,b) REP(i,a,(b)+1) #define RP1(i,n) REP1(i,1,n) #define PER1(i,a,b) PER(i,(a)+1,b) #define PR1(i,n) PER1(i,n,1) #define DO(n) REP(__i,0,n) #define FO(x, n) for (int x = 0; x < n; ++x) #define RFO(x, n) for (int x = n - 1; x >= 0; --x) #define FOR(i,a,b) for(int _b=(b),(i)=(a);(i)<_b;++(i)) #define RFOR(x, a, b) for (int x = b - 1; x >= a; --x) //#define FOR(x, a, b) for (int x = a; x < b; ++x) #define ROF(i,b,a) for(int _a=(a),i=(b);i>_a;--i) #define FORN(a,b,c) for (int (a)=(b);(a)<=(c);++(a)) #define FORD(a,b,c) for (int (a)=(b);(a)>=(c);--(a)) #define FORSQ(a,b,c) for (int (a)=(b);(a)*(a)<=(c);++(a)) #define FORC(a,b,c) for (char (a)=(b);(a)<=(c);++(a)) #define FOREACH(a,b) for (auto &(a) : (b)) #define FOR_ITER(x, a) for(auto (x) = (a).begin(); (x) != (a).end(); ++(x)) #define REPN(i,n) FORN(i,1,n) #define REPP(I, A, B) for (int I = (A); I < (B); ++I) #define MS0(X) memset((X), 0, sizeof((X))) #define MS1(X) memset((X), -1, sizeof((X))) #define LEN(X) strlen(X) #define SQR(x) ((LL)(x) * (x)) #define RESET(a,b) memset(a,b,sizeof(a)) #define ALLA(arr,sz) arr,arr+sz #define SZ(X) ((int)(X).size()) #define SIZE(X) ((int)(X).size()) #define SORT(v) sort(ALL(v)) #define REVERSE(v) reverse(ALL(v)) #define SORTA(arr,sz) sort(ALLA(arr,sz)) #define REVERSEA(arr,sz) reverse(ALLA(arr,sz)) #define PERMUTE next_permutation #define TC(t) while(t--) #define MSET(m,v) memset(m,v,sizeof(m)) #define MAX_PQ(T) priority_queue<T> #define MIN_PQ(T) priority_queue<T,vector<T>,greater<T>> #define IO(){ios_base::sync_with_stdio(0);cin.tie(0);} #define nl '\n' #define cint1(a) int a;cin>>a #define cint2(a,b) int a,b;cin>>a>>b #define cint3(a,b,c) int a,b,c;cin>>a>>b>>c #define cout1(a) cout<<(a)<<endl #define cout2(a,b) cout<<(a)<<" "<<(b)<<endl #define cout3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl /* I gave you my heart and then you turned around. */ void _BG(const char * s) {} template<typename T, typename ... TT> void _BG(const char * s,T a, TT...b) { for (int c = 0; *s && (c || *s != ','); ++s) { cerr<<*s; switch (*s) { case '(': case '[': case '{': ++c; break; case ')': case ']': case '}': --c; break; } } cerr<<" = "<<a; if (*s) { cerr<<", "; _BG(++s,b...); } else cerr<<endl; } #define BG(...) do { \ cerr << __PRETTY_FUNCTION__ << ':' << __LINE__ << ": "; \ _BG(#__VA_ARGS__,__VA_ARGS__); \ } while(0) /* Reading input is now 20% cooler! */ bool RD(void) {return true;} bool RD(char & a) {return scanf(" %c", &a) == 1;} bool RD(char * a) {return scanf("%s", a) == 1;} bool RD(double & a) {return scanf("%lf", &a) == 1;} bool RD(int & a) {return scanf("%d", &a) == 1;} bool RD(ll & a) {return scanf("%lld", &a) == 1;} template<typename T, typename ... TT> bool RD(T & a, TT & ... b) {return RD(a) && RD(b...);} /* Do princesses dream of magic sheep? */ #define RI(a) RD(a) #define RII(a,b) RI(a); RI(b) #define RIII(a,b,c) RI(a); RII(b,c) #define RIIII(a,b,c,d) RI(a); RIII(b,c,d) #define DRI(a) int a; RD(a) #define DRII(a,b) RI(a); RI(b) #define DRIII(a,b,c) RI(a); RII(b,c) #define DRIIII(a,b,c,d) RI(a); RIII(b,c,d) #define RS(X) scanf("%s", (X)) #define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0) /* For it's time for you to fulfill your output. */ void PT(const char a) {putchar(a);} void PT(const char * a) {fputs(a, stdout);} void PT(char * a) {fputs(a, stdout);} void PT(const double a) {printf("%.16f", a);} void PT(const int a) {printf("%d", a);} void PT(const ll a) {printf("%lld", a);} /* The line will last forever! */ template<char sep = ' ',char end = '\n'> void PL(void) {if (end) PT(end);} template<char sep = ' ',char end = '\n',typename T, typename ... TT> void PL(const T a, const TT ... b) {PT(a); if (sizeof...(b) && sep) PT(sep); PL<sep,end>(b...);} /* Good Luck && Have Fun ! */ inline string IntToString(LL a){ char x[100]; sprintf(x,"%lld",a); string s = x; return s; } inline LL StringToInt(string a){ char x[100]; LL res; strcpy(x,a.c_str()); sscanf(x,"%lld",&res); return res; } inline string GetString(void){ char x[1000005]; scanf("%s",x); string s = x; return s; } inline string uppercase(string s){ int n = SIZE(s); RP(i,n) if (s[i] >= 'a' && s[i] <= 'z') s[i] = s[i] - 'a' + 'A'; return s; } inline string lowercase(string s){ int n = SIZE(s); RP(i,n) if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a'; return s; } inline void OPEN (string s) { #ifndef TESTING freopen ((s + ".in").c_str (), "r", stdin); freopen ((s + ".out").c_str (), "w", stdout); #endif } struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); } } initializer; template<typename T> istream& operator>>(istream &s, vector<T> &v) { for (T &t : v) s >> t; return s; } template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) { for (const T &t : v) s << t << endl; return s; } template<typename T> T min(vector<T>& v) {return *min_element(v.begin(), v.end());} template<typename T> T max(vector<T>& v) {return *max_element(v.begin(), v.end());} template<typename T> int min_element(vector<T>& v) {return min_element(v.begin(), v.end()) - v.begin();} template<typename T> int max_element(vector<T>& v) {return max_element(v.begin(), v.end()) - v.begin();} template<typename T> void sort(vector<T>& v) {sort(v.begin(), v.end());} template<typename T, typename Function> void sort(vector<T>& v, Function func) {sort(v.begin(), v.end(), func);} template<typename T> void rsort(vector<T>& v) {sort(v.rbegin(), v.rend());} template<typename T> void reverse(vector<T>& v) {reverse(v.begin(), v.end());} template<typename T> void unique(vector<T>& v) {v.erase(unique(v.begin(), v.end()), v.end());} template<typename T> void nth_element(vector<T>& v, int n) {nth_element(v.begin(), v.begin() + n, v.end());} template<typename T> bool next_permutation(vector<T>& v) {return next_permutation(v.begin(), v.end());} template<typename T> int find(vector<T>& v, T t) {return find(v.begin(), v.end(), t) - v.begin();} template<typename T> int in(vector<T> v, T t) {return find(v, t) != (int)v.size();} template<typename T> int lower_bound(vector<T>& v, T t) {return lower_bound(v.begin(), v.end(), t) - v.begin();} template<typename T> int upper_bound(vector<T>& v, T t) {return upper_bound(v.begin(), v.end(), t) - v.begin();} template<typename T> T accumulate(const vector<T>& v, function<T(T, T)> func = plus<T>()) {return accumulate(v.begin(), v.end(), T(), func);} template<typename T> void adjacent_difference(vector<T>& v) {adjacent_difference(v.begin(), v.end(), v.begin());} template<typename T> void adjacent_difference(vector<T>& v, vector<T>& u) {adjacent_difference(v.begin(), v.end(), u.begin());} template<typename T> void partial_sum(vector<T>& v, vector<T>& u) {partial_sum(v.begin(), v.end(), u.begin());} template<typename T> T inner_product(vector<T>& v, vector<T>& u) {return inner_product(v.begin(), v.end(), u.begin(), T(0));} template<typename T> int count(const vector<T>& v, T t) {return count(v.begin(), v.end(), t);} template<typename T, typename Function> int count_if(const vector<T>& v, Function func) {return count_if(v.begin(), v.end(), func);} template<typename T, typename Function> void remove_if(vector<T>& v, Function func) {v.erase(remove_if(v.begin(), v.end(), func), v.end());} template<typename T, typename Function> bool any_of(vector<T> v, Function func) {return any_of(v.begin(), v.end(), func);} template<typename T> vector<T> subvector(vector<T>& v, int a, int b) {return vector<T>(v.begin() + a, v.begin() + b);} template<typename T> int kinds(const vector<T>& v) {return set<T>(v.begin(), v.end()).size();} template<typename T> void iota(vector<T>& v) {iota(v.begin(), v.end(), T());} template<typename T> bool is_sorted(const vector<T>& v) {return is_sorted(v.begin(), v.end());} template<typename Weight, typename Value> Value knapsack(Weight maxWeight, const vector<Weight>& weight, const vector<Value>& value) { vector<Value> dp1(maxWeight + Weight(1)), dp2(maxWeight + Weight(1)); for (size_t i = 0; i < weight.size(); ++i) { for (int w = 0; w <= maxWeight; ++w) { Weight ww = Weight(w) + weight[i]; Value vv = dp1[w] + value[i]; if (ww <= maxWeight && dp2[ww] < vv) dp2[ww] = vv; } dp1 = dp2; } return dp1[maxWeight]; } template<typename Weight, typename Value = long long> vector<Value> knapsackCount(Weight maxWeight, const vector<Weight>& weight) { vector<Value> dp1(maxWeight + Weight(1)), dp2(maxWeight + Weight(1)); dp1[0] = dp2[0] = 1; for (auto& w : weight) { for (int i = 0; i <= maxWeight; ++i) { Weight ww = Weight(i) + w; if (ww <= maxWeight) dp2[ww] += dp1[i]; } dp1 = dp2; } return dp1; } template<typename Weight> vector<bool> knapsackFill(Weight maxWeight, const vector<Weight>& weight) { vector<bool> dp1(maxWeight + Weight(1)), dp2(maxWeight + Weight(1)); dp1[0] = dp2[0] = true; for (auto& w : weight) { for (int i = 0; i <= maxWeight; ++i) { Weight ww = Weight(i) + w; if (ww <= maxWeight && dp1[i]) dp2[ww] = true; } dp1 = dp2; } return dp1; } //int main() { // int64_t n, a, res = 0; // cin >> n >> a; // vector<int> x(n); // cin >> x; // vector<int> y, z; // for (int i : x) { // if (i >= a) y.emplace_back(i - a); // else z.emplace_back(a - i); // } // auto yy = knapsackCount(2500, y); // auto zz = knapsackCount(2500, z); // for (int i = 0; i <= 2500; ++i) res += yy[i] * zz[i]; // cout << res - 1 << endl; //} inline bool feq(const double& a, const double& b) { return fabs(a - b) < 1e-10; } //ll rnd(ll x, ll y) { static auto gen = std::bind(std::uniform_int_distribution<ll>(), std::mt19937); return gen() % (y - x + 1) + x; } bool is_prime(ll x) { if (x <= 1) return 0; for (ll y = 2; y * y <= x; ++y) if (x % y == 0) return 0; return 1; } ll sqr(int a) { return (ll) a * a; } ld sqr(ld a) { return a * a; } ll sqr(ll a) { return a * a; } ll gcd(ll a, ll b) { while (b > 0) { ll t = a % b; a = b; b = t; } return a; } long long int nCm(long long int n, long long int m) { if (m == 1) { return n; } else { return n*nCm(n - 1, m - 1) / m; } } long long int npm(long long int n,long long int m) { if (m == 1) { return n; } else if (m == 0) { return 1; }else { return n*npm(n, m - 1); } } template<class A,class B>inline bool mina(A &x,const B &y){return(y<x)?(x=y,1):0;} template<class A,class B>inline bool maxa(A &x,const B &y){return(x<y)?(x=y,1):0;} template<class Int, Int mod> class ModInt { public: Int x; ModInt(): x(0) {} ModInt(int a, bool m=1) { if(m) {x=a%mod; if(x<0)x+=mod;} else x=a; } ModInt(LL a, bool m=1) { if(m) {x=a%mod; if(x<0)x+=mod;} else x=a; } inline ModInt &operator+=(ModInt that) { if((x += that.x) >= mod) x -= mod; return *this; } inline ModInt &operator-=(ModInt that) { if((x += mod - that.x) >= mod) x -= mod; return *this; } inline ModInt &operator*=(ModInt that) { x = LL(x) * that.x % mod; return *this; } inline ModInt &operator/=(ModInt that) { return *this *= that.inverse(); } inline ModInt operator-() const { return ModInt(-this->x); } ModInt inverse() const {LL a=x,b=mod,u=1,v=0;while(b){LL t=a/b;a-=t*b;u-=t*v;swap(a,b);swap(u,v);} return ModInt(u);} inline friend ostream& operator << (ostream &out, ModInt m) {return out << m.x;} #define op(o1,o2) ModInt operator o1(ModInt that) const { return ModInt(*this) o2 that; } op(+,+=) op(-,-=) op(*,*=) op(/,/=) #undef op #define op(o) bool operator o(ModInt that) const { return x o that.x; } op(==) op(!=) op(<) op(<=) op(>) op(>=) #undef op }; typedef ModInt<int,moder> Mint; #define MAXN (300005) Mint F[MAXN]; Mint FI[MAXN]; Mint Cnr(int n, int r) { if(r < 0 || r > n) return 0; return F[n] * FI[r] * FI[n-r]; } // spnauT //end of jonathanirvings' template v3.0.3 (BETA) //ll si(int i) { // return (ll)i * (i + 1) / 2; //} // //ll multModer(ll l1, ll l2) { // return (l1 * l2) % moder; //} // //ll addModer(ll l1, ll l2) { // return (l1 + l2) % moder; //} int main(){ IO(); cint1(N); set<int> rs; int sum = 0; FO(i, N) { cint1(a); if (a < 3200) { rs.insert(a / 400); } else { m++; } } cout2(max(rs.size(), 1), rs.size() + m); // F[0] = 1; // FOR(i,1,MAXN) F[i] = F[i-1] * i; // FI[MAXN-1] = F[MAXN-1].inverse(); // ROF(i,MAXN-2,-1) FI[i] = FI[i+1] * (i+1); // // cint2(H,W); // cint2(A,B); // Mint sol; // FOR(i,B+1,W+1) sol += Cnr(i-1+H-A-1, i-1) * Cnr(A-1+W-i, A-1); // // cout << sol << nl; // LL C[55][55]; // C[0][0] = 1; // FORN(i,1,50) // { // C[i][0] = C[i][i] = 1; // FOR(j,1,i) C[i][j] = C[i-1][j-1] + C[i-1][j]; // } // // long double avg0 = (long double) accumulate(ns.rbegin(), ns.rbegin() + i, 0ll) / i; // if (avg - avg0 > 1e-6) { // break; // } // printf("%.6Lf\n%lld\n", avg, rs); return 0; } /** //#include <fcntl.h> void solve() { } int main() { //freopen("", "r", stdin); //freopen("", "w", stdout); cout.precision(15); cout << fixed; cerr.precision(6); cerr << fixed; solve(); #ifdef LOCAL cerr << "time: " << (ll) clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl; #endif } */ /** #define SORT(v) sort(v.begin(), v.end()) #include <iostream> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <cstdlib> #include <cstdarg> #include <cstdio> #include <cmath> #include <numeric> #include <utility> // #include "ane.cpp" #define INF (int)1e9 #define INFLL (long long)1e18 #define NMAX 100005 #define MMAX 100005 #define MOD 100000 using namespace std; // コメントアウトするとdebug()を実行しない // #define DEBUG // // ライブラリ // // frequent used aliases typedef long long ll; typedef pair<int, int> p; typedef pair<ll, int> lp; typedef pair<ll, ll> llp; typedef vector<int> vec; typedef vector<vec> mat; // frequent used constants static const int di[] = {-1, 0, 1, -1, 1, -1, 0, 1}; static const int dj[] = {-1, -1, -1, 0, 0, 1, 1, 1}; // デバッグ用printf void debug(const char* format, ...){ #ifndef DEBUG return; #endif va_list arg; va_start(arg, format); vprintf(format, arg); // コンソールに出力 va_end(arg); } // n次元配列の初期化。第2引数の型のサイズごとに初期化していく。 template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } // Union-Find Tree class UnionFindTree{ struct node{ int par; }; std::vector<node> T; public: void init(int num){ T.resize(num+1); // ignore T[0] for (int i = 1; i <= num; ++i) { T[i].par = i; } } void unite(int x, int y){ T[find(y)].par = find(x); } int find(int x){ if (T[x].par == x) return x; else return T[x].par = find(T[x].par); } bool same(int x, int y){ return find(x) == find(y); } }; // Segment Tree for Range Minimum Query // ********************************************************** // *** important: all functions' variable, *** // *** such as "index", "l", "r", etc., must be 0-origin. *** // ********************************************************** // ******************************************** // *** important: NMAX must be power of 2. *** // ******************************************** template<typename T> class SegmentTree{ private: ll N; T INF_VAL; T dat[NMAX * 2]; // 0 origin, A[i] = dat[i + N] T _query(ll l, ll r, ll l_resp, ll r_resp, ll i_dat){ debug("query(%lld, %lld, %lld, %lld, %lld) called\n", l, r, l_resp, r_resp, i_dat); if (r < l_resp || r_resp < l) return INF_VAL; else if(l <= l_resp && r_resp <= r) return dat[i_dat]; else return min(_query(l ,r, l_resp, (l_resp + r_resp) / 2, i_dat * 2), _query(l, r, (l_resp + r_resp) / 2 + 1, r_resp, i_dat * 2 + 1)); } public: void init(ll _N, T _inf_val){ N = 1; while(N < _N) N *= 2; INF_VAL = _inf_val; Fill(dat, _inf_val); } T get(ll index){ return dat[index + N]; } void set(int index, T val){ int i_dat = index + N; dat[i_dat] = val; for (i_dat /= 2; i_dat > 0; i_dat /= 2) { dat[i_dat] = min(dat[i_dat * 2], dat[i_dat * 2 + 1]); } } T query(ll l, ll r){ return _query(l, r, 0, N - 1, 1); } void dump(){ cout << "*** SegTree dump begin ***\n"; cout << "N = " << N << ", INF_VAL = " << INF_VAL << endl; for (int i = 1; i < N * 2; i *= 2) { for (int j = i; j < i * 2; ++j) { if(dat[j] == INF_VAL) cout << "INF "; else cout << dat[j] << " "; } cout << endl; } cout << "*** SegTree dump end ***\n"; } }; // Binary Indexed Tree for Range Sum Query // ******************************************* // *** important: all functions' variable, *** // *** such as "i", must be 1-origin. *** // ******************************************* template<typename T> class BinaryIndexedTree{ private: ll N; T dat[NMAX + 1]; // 1 origin, A[i] = sum(i) - sum(i-1) public: void init(ll _N){ N = _N; Fill(dat, 0); } void add(int i, T val){ while(i <= N) { dat[i] += val; i += i & -i; } } T sum(ll i){ T ret = 0; while(i > 0) { ret += dat[i]; i -= i & -i; // set last HIGH bit to LOW } return ret; } T sum(ll left, ll right){ return sum(right) - sum(left - 1); } void dump(){ cout << "*** BITree dump begin ***\n"; cout << "N = " << N << endl; for (int i = 1; i <= N; i *= 2) { cout << dat[i] << " "; } cout << "*** BITree dump end ***\n"; } }; // // ライブラリ終了 // */
a.cc: In function 'int main()': a.cc:485:13: error: 'm' was not declared in this scope 485 | m++; | ^ a.cc:489:14: error: no matching function for call to 'max(std::set<int>::size_type, int)' 489 | cout2(max(rs.size(), 1), rs.size() + m); | ~~~^~~~~~~~~~~~~~ a.cc:141:27: note: in definition of macro 'cout2' 141 | #define cout2(a,b) cout<<(a)<<" "<<(b)<<endl | ^ a.cc:275:24: note: candidate: 'template<class T> T max(std::vector<_Tp>&)' 275 | template<typename T> T max(vector<T>& v) {return *max_element(v.begin(), v.end());} | ^~~ a.cc:275:24: note: candidate expects 1 argument, 2 provided 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: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:489:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 489 | cout2(max(rs.size(), 1), rs.size() + m); | ~~~^~~~~~~~~~~~~~ a.cc:141:27: note: in definition of macro 'cout2' 141 | #define cout2(a,b) cout<<(a)<<" "<<(b)<<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:489:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 489 | cout2(max(rs.size(), 1), rs.size() + m); | ~~~^~~~~~~~~~~~~~ a.cc:141:27: note: in definition of macro 'cout2' 141 | #define cout2(a,b) cout<<(a)<<" "<<(b)<<endl | ^ a.cc:489:42: error: 'm' was not declared in this scope 489 | cout2(max(rs.size(), 1), rs.size() + m); | ^ a.cc:141:37: note: in definition of macro 'cout2' 141 | #define cout2(a,b) cout<<(a)<<" "<<(b)<<endl | ^
s538345409
p03695
C++
#include <iostream> #include <vector> #include <algorithm> int main( void ) { int N; std::cin >> N; // ただし便宜的に色が9色あることにする。 // 最後の色は、実は色ではなくて、「好きな色を使える」ことなので注意。 std::vector<bool> color_used = std::vector<bool>(8, false); // 8色あって、初期値はfalseです。と言う指定 // 自由な色を使って良いメンバーが何人いるか // 基本的に、みんな自由な色を使えることにしてしまう。 // しかし、「使わなきゃいけない色」が見つかったら、ここから減らす。 int free_color_members = N; // 入力しながら色を振り分けていく for( size_t i = 0; i < N; ++i ) { int rate; std::cin >> rate; // よくみるとレートの変化するところは400区切りだから、400で割って割り振ってもOK if( rate < 3200 ) { color_used[ rate / 400 ] = true; free_color_members -= 1; } } // 何種類の色が、決め打ちで使用済みなのか調べる int used_colors = 0; for( size_t i = 0; i < 8; ++i ) { if( color_used[ i ] > 0 ) { used_colors += 1; } } // 少なくとも一人のユーザがこの問題ではいることを考えると // 「決め打ちの色が1つもない」のであれば // 「自由な色の人が何か1つ決め打ちの色をとる」ようになるということ // なので自由な色を使える人の数を1つ減らして、used_colorを1にすることで問題を帰着できる。 if( used_color == 0 ) { free_color_members -= 1; used_color = 1; } std::cout << used_color << " " << free_color_members << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:42:9: error: 'used_color' was not declared in this scope; did you mean 'used_colors'? 42 | if( used_color == 0 ) { | ^~~~~~~~~~ | used_colors a.cc:47:18: error: 'used_color' was not declared in this scope; did you mean 'used_colors'? 47 | std::cout << used_color << " " << free_color_members << std::endl; | ^~~~~~~~~~ | used_colors
s337332445
p03695
C++
#include <iostream> #include <vector> #include <algorithm> int main( void ) { int N; std::cin >> N; // ただし便宜的に色が9色あることにする。 // 最後の色は、実は色ではなくて、「好きな色を使える」ことなので注意。 std::vector<bool> color_used = std::vector<bool>(8, false); // 8色あって、初期値はfalseです。と言う指定 // 自由な色を使って良いメンバーが何人いるか // 基本的に、みんな自由な色を使えることにしてしまう。 // しかし、「使わなきゃいけない色」が見つかったら、ここから減らす。 int free_color_members = N; // 入力しながら色を振り分けていく for( size_t i = 0; i < N; ++i ) { int rate; std::cin >> rate; // 上のテーブルを使って各メンバーを色に振り分けていきます。 // もちろん配列を使わずにif文で地道に振り分けてもOKです。(大変ですけどね!) for( size_t j = 0; j < color_ranges.size() - 1; ++j ) { // よくみるとレートの変化するところは400区切りだから、400で割って割り振ってもOK if( rate < 3200 ) { color_used[ rate / 400 ] = true; free_color_members -= 1; break; } } } // 何種類の色が、決め打ちで使用済みなのか調べる int used_colors = 0; for( size_t i = 0; i < 8; ++i ) { if( color_used[ i ] > 0 ) { used_colors += 1; } } // 少なくとも一人のユーザがこの問題ではいることを考えると // 「決め打ちの色が1つもない」のであれば // 「自由な色の人が何か1つ決め打ちの色をとる」ようになるということ // なので自由な色を使える人の数を1つ減らして、used_colorを1にすることで問題を帰着できる。 if( used_color == 0 ) { free_color_members -= 1; used_color = 1; } std::cout << used_color << " " << free_color_members << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:25:32: error: 'color_ranges' was not declared in this scope 25 | for( size_t j = 0; j < color_ranges.size() - 1; ++j ) { | ^~~~~~~~~~~~ a.cc:48:9: error: 'used_color' was not declared in this scope; did you mean 'used_colors'? 48 | if( used_color == 0 ) { | ^~~~~~~~~~ | used_colors a.cc:53:18: error: 'used_color' was not declared in this scope; did you mean 'used_colors'? 53 | std::cout << used_color << " " << free_color_members << std::endl; | ^~~~~~~~~~ | used_colors
s306703979
p03695
C++
#include <iostream> #include <vector> #include <algorithm> int main( void ) { int N; std::cin >> N; std::vector<int> a; for( size_t i = 0; i < N; ++i ) { int rate; std::cin >> rate; a.push_back( rate ); } // 色が変わるところを示すテーブル // i番目のレート以上、i+1番目のレート以下で、i番の色 // ただし3200を超えたら、好きな色をつけることができます。 // 問題の要請では、レートの値は4800点が最大のレートなので、 // その時も問題なく検索できるように、最後には4801を置いておきます。 const std::vector<int> color_table = { 1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801 }; // 便宜的に色が9色あることにする。 // ただし最後の人は好きな色を使えるので注意。 int color_count[ 9 ] = { 0 }; // 上のテーブルを使って各メンバーを色に振り分けていきます。 for( size_t i = 0; i < N; ++i ) { const int rate = a[i]; for( size_t j = 0; j < rate_table.size() - 1; ++j ) { const int min = rate_table[ j ]; const int max = rate_table[ j + 1 ]; if( min <= rate && rate < max ) { color = j; break; } } // 指定の色を持った人を1人増やす color_count[ color ] += 1; } // 決め打ちの色になってる人がいるなら、その個数をみる int constant_color_count = 0; for( size_t i = 0; i < 8; ++i ) { if( color_count [ i ] > 0 ) { constant_color_count += 1; } } if( constant_color_count == 0 && color_count[ 8 ] == 0 ) { std::cout << 0 << " " << 0 << std::endl; } else if ( constant_color_count == 0 && color_count[ 8 ] != 0 ) { std::cout << 1 << " " << color_count[ 8 ] << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] == 0 ) { std::cout << constant_color_count << " " << constant_color_count << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] != 0 ) { std::cout << constant_color_count << " " << constant_color_count + color_count[ 8 ] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:30:32: error: 'rate_table' was not declared in this scope 30 | for( size_t j = 0; j < rate_table.size() - 1; ++j ) { | ^~~~~~~~~~ a.cc:35:17: error: 'color' was not declared in this scope; did you mean 'tolower'? 35 | color = j; | ^~~~~ | tolower a.cc:40:22: error: 'color' was not declared in this scope; did you mean 'tolower'? 40 | color_count[ color ] += 1; | ^~~~~ | tolower
s236712400
p03695
C++
#include <iostream> #include <vector> #include <algorithm> int main( void ) { int N; std::cin >> N; std::vector<int> a; for( size_t i = 0; i < N; ++i ) { int rate; std::cin >> rate; a.push_back( rate ); } // 色が変わるところを示すテーブル // i番目のレート以上、i+1番目のレート以下で、i番の色 // ただし3200を超えたら、好きな色をつけることができます。 // 問題の要請では、レートの値は4800点が最大のレートなので、 // その時も問題なく検索できるように、最後には4801を置いておきます。 const std::vector<int> color_table = { 1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801 }; // 便宜的に色が9色あることにする。 // ただし最後の人は好きな色を使えるので注意。 int color_count[ 9 ] = { 0 }; // 上のテーブルを使って各メンバーを色に振り分けていきます。 for( size_t i = 0; i < N; ++i ) { const rate = a[i]; for( size_t j = 0; j < rate_table.size() - 1; ++j ) { const int min = rate_table[ j ]; const int max = rate_table[ j + 1 ]; if( min <= rate && rate < max ) { color = j; break; } } // 指定の色を持った人を1人増やす color_count[ color ] += 1; } // 決め打ちの色になってる人がいるなら、その個数をみる int constant_color_count = 0; for( size_t i = 0; i < 8; ++i ) { if( color_count [ i ] > 0 ) { constant_color_count += 1; } } if( constant_color_count == 0 && color_count[ 8 ] == 0 ) { std::cout << 0 << " " << 0 << std::endl; } else if ( constant_color_count == 0 && color_count[ 8 ] != 0 ) { std::cout << 1 << " " << color_count[ 8 ] << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] == 0 ) { std::cout << constant_color_count << " " << constant_color_count << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] != 0 ) { std::cout << constant_color_count << " " << constant_color_count + color_count[ 8 ] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:29:15: error: 'rate' does not name a type 29 | const rate = a[i]; | ^~~~ a.cc:30:32: error: 'rate_table' was not declared in this scope 30 | for( size_t j = 0; j < rate_table.size() - 1; ++j ) { | ^~~~~~~~~~ a.cc:34:24: error: 'rate' was not declared in this scope 34 | if( min <= rate && rate < max ) { | ^~~~ a.cc:35:17: error: 'color' was not declared in this scope; did you mean 'tolower'? 35 | color = j; | ^~~~~ | tolower a.cc:40:22: error: 'color' was not declared in this scope; did you mean 'tolower'? 40 | color_count[ color ] += 1; | ^~~~~ | tolower
s937164101
p03695
C++
#include <iostream> #include <vector> #include <algorithm> int main( void ) { std::vector<int> a; for( size_t i = 0; i < N; ++i ) { int rate; std::cin >> rate; a.push_back( rate ); } // 色が変わるところを示すテーブル // i番目のレート以上、i+1番目のレート以下で、i番の色 // ただし3200を超えたら、好きな色をつけることができます。 // 問題の要請では、レートの値は4800点が最大のレートなので、 // その時も問題なく検索できるように、最後には4801を置いておきます。 const std::vector<int> color_table = { 1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801 }; // 便宜的に色が9色あることにする。 // ただし最後の人は好きな色を使えるので注意。 int color_count[ 9 ] = { 0 }; // 上のテーブルを使って各メンバーを色に振り分けていきます。 for( size_t i = 0; i < N; ++i ) { const rate = a[i]; for( size_t j = 0; j < rate_table.size() - 1; ++j ) { const int min = rate_table[ j ]; const int max = rate_table[ j + 1 ]; if( min <= rate && rate < max ) { color = j; break; } } // 指定の色を持った人を1人増やす color_count[ color ] += 1; } // 決め打ちの色になってる人がいるなら、その個数をみる int constant_color_count = 0; for( size_t i = 0; i < 8; ++i ) { if( color_count [ i ] > 0 ) { constant_color_count += 1; } } if( constant_color_count == 0 && color_count[ 8 ] == 0 ) { std::cout << 0 << " " << 0 << std::endl; } else if ( constant_color_count == 0 && color_count[ 8 ] != 0 ) { std::cout << 1 << " " << color_count[ 8 ] << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] == 0 ) { std::cout << constant_color_count << " " << constant_color_count << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] != 0 ) { std::cout << constant_color_count << " " << constant_color_count + color_count[ 8 ] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:28: error: 'N' was not declared in this scope 7 | for( size_t i = 0; i < N; ++i ) { | ^ a.cc:25:28: error: 'N' was not declared in this scope 25 | for( size_t i = 0; i < N; ++i ) { | ^ a.cc:26:15: error: 'rate' does not name a type 26 | const rate = a[i]; | ^~~~ a.cc:27:32: error: 'rate_table' was not declared in this scope 27 | for( size_t j = 0; j < rate_table.size() - 1; ++j ) { | ^~~~~~~~~~ a.cc:31:24: error: 'rate' was not declared in this scope 31 | if( min <= rate && rate < max ) { | ^~~~ a.cc:32:17: error: 'color' was not declared in this scope; did you mean 'tolower'? 32 | color = j; | ^~~~~ | tolower a.cc:37:22: error: 'color' was not declared in this scope; did you mean 'tolower'? 37 | color_count[ color ] += 1; | ^~~~~ | tolower
s778658694
p03695
C++
#include <iostream> #include <vector> #include <algorithm> int main( void ) { for( size_t i = 0; i < N; ++i ) { int rate; std::cin >> rate; } // 色が変わるところを示すテーブル // i番目のレート以上、i+1番目のレート以下で、i番の色 // ただし3200を超えたら、好きな色をつけることができます。 // 問題の要請では、レートの値は4800点が最大のレートなので、 // その時も問題なく検索できるように、最後には4801を置いておきます。 const std::vector<int> color_table = { 1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801 }; // 便宜的に色が9色あることにする。 // ただし最後の人は好きな色を使えるので注意。 int color_count[ 9 ] = { 0 }; // 上のテーブルを使って各メンバーを色に振り分けていきます。 for( size_t i = 0; i < N; ++i ) { const rate = a[i]; for( size_t j = 0; j < rate_table.size() - 1; ++j ) { const int min = rate_table[ j ]; const int max = rate_table[ j + 1 ]; if( min <= rate && rate < max ) { color = j; break; } } // 指定の色を持った人を1人増やす color_count[ color ] += 1; } // 決め打ちの色になってる人がいるなら、その個数をみる int constant_color_count = 0; for( size_t i = 0; i < 8; ++i ) { if( color_count [ i ] > 0 ) { constant_color_count += 1; } } if( constant_color_count == 0 && color_count[ 8 ] == 0 ) { std::cout << 0 << " " << 0 << std::endl; } else if ( constant_color_count == 0 && color_count[ 8 ] != 0 ) { std::cout << 1 << " " << color_count[ 8 ] << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] == 0 ) { std::cout << constant_color_count << " " << constant_color_count << std::endl; } else if ( constant_color_count != 0 && color_count[ 8 ] != 0 ) { std::cout << constant_color_count << " " << constant_color_count + color_count[ 8 ] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:28: error: 'N' was not declared in this scope 7 | for( size_t i = 0; i < N; ++i ) { | ^ a.cc:24:28: error: 'N' was not declared in this scope 24 | for( size_t i = 0; i < N; ++i ) { | ^ a.cc:25:15: error: 'rate' does not name a type 25 | const rate = a[i]; | ^~~~ a.cc:26:32: error: 'rate_table' was not declared in this scope 26 | for( size_t j = 0; j < rate_table.size() - 1; ++j ) { | ^~~~~~~~~~ a.cc:30:24: error: 'rate' was not declared in this scope 30 | if( min <= rate && rate < max ) { | ^~~~ a.cc:31:17: error: 'color' was not declared in this scope; did you mean 'tolower'? 31 | color = j; | ^~~~~ | tolower a.cc:36:22: error: 'color' was not declared in this scope; did you mean 'tolower'? 36 | color_count[ color ] += 1; | ^~~~~ | tolower
s091018045
p03695
C++
#include <iostream> using namespace std; int main(void){ int n,min=0,max=0; cin>>n; int a[n],c[10]=0; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]<400)c[0]=1; else if(a[i]<800)c[1]=1; else if(a[i]<1200)c[2]=1; else if(a[i]<1600)c[3]=1; else if(a[i]<2000)c[4]=1; else if(a[i]<2400)c[5]=1; else if(a[i]<2800)c[6]=1; else if(a[i]<3200)c[7]=1; else c[8]++; } for(int i=0;i<8;i++){ min+=c[i]; if(c[i]==0)max++; } if(min==0)min++; if(c[8]>max)max=8; else max=8-(max-c[8]); cout<<min<<" "<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:18: error: array must be initialized with a brace-enclosed initializer 6 | int a[n],c[10]=0; | ^
s229513561
p03695
C++
#include<bits/stdc++.h> #define up(j,k,i) for(i=j;i<k;i++) #define down(j,k,i) for(i=j;i>k;i--) #define pp(n) printf("%lld\n",n) #define ps(s) printf("%s",s) #define is(n) scanf("%lld",&n) #define ips(n) scanf("%lld",n) #define ss(s) scanf("%s",s) #define cool 0 #define pb push_back #define mp make_pair #define F first #define S second #define f(i) cout<<i<<endl; #define pll pair<lld,lld> #define pi acos(-1) #ifdef G #define dg(x) cout<<#x<<' '<<x<<endl; #define dg2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<endl; #define dg3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<endl; #define dg4(x,y,z,zz) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<' '<<#zz<<' '<<zz<<endl; #else #define dg(x) ; #define dg2(x,y) ; #define dg3(x,y,z) ; #define dg4(x,y,z,zz) ; #endif #define ds(n,m) scanf("%lld %lld",&n,&m) #define ts(n,m,k) scanf("%lld %lld %lld",&n,&m,&k) #define yes printf("YES\n") #define no printf("NO\n") typedef long double ld; typedef long long int lld; using namespace std; const lld M =1e6+7; const lld mod=1e9+7; const lld infi =LLONG_MAX; lld ans,k,n,x,y,m,mymax=LLONG_MIN,mymin=LLONG_MAX,b,c,z,sum; lld a[M]; lld cnt[10]; int main() { lld i,j; is(n); up(1,n+1,i) { is(a[i]); lld temp=a[i]/400; cnt[temp]++; } ans=0; up(0,8,i) { if(cnt[i]!=0) { ans++; } } lld ans1=ans; if(ans==0) ans1=1,; cout<<ans1<<' '; ans=ans+cnt[8]; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:61:16: error: expected primary-expression before ';' token 61 | ans1=1,; | ^
s929403828
p03695
C++
#include<stdio.h> int main() { int N; while(scanf("%d",&N)!=EOF) { int max=0; int min=0; int n; int a[1000+20]; for (i=0;i<N;i++) { scanf("%d",&n); if(n/400<8) a[n/400]++; else max++; } for(i=0;i<9;i++) { if(a[i]!=0) min++; } max=min+max; if(min==0) min=1; printf("%d %d\n",min,max); } }
a.cc: In function 'int main()': a.cc:11:22: error: 'i' was not declared in this scope 11 | for (i=0;i<N;i++) | ^ a.cc:19:21: error: 'i' was not declared in this scope 19 | for(i=0;i<9;i++) | ^
s077606813
p03695
Java
import java.util.Arrays; import java.util.Scanner; import java.util.stream.IntStream; public class Main{ static final Scanner s=new Scanner(System.in); static int getInt(){ return Integer.parseInt(s.next()); } static IntStream REPS(int r){ return IntStream.range(0,r); } static IntStream REPS(int l,int r){ return IntStream.rangeClosed(l,r); } static IntStream INTS(int l){ return REPS(l).map(i->getInt()); } public static void main(String[] __){ int n=s.nextInt(); int[] color=new int[9]; for(int i=0;i<n;i++){ int latte=getInt(); if(latte<400) color[0]++; else if(latte<800) color[1]++; else if(latte<1200) color[2]++; else if(latte<1600) color[3]++; else if(latte<2000) color[4]++; else if(latte<2400) color[5]++; else if(latte<2800) color[6]++; else if(latte<3200) color[7]++; else color[8]++; } long v=Arrays.stream(color).limit(8).filter(i->i>0).count(); System.out.printf("%d %d\n", Math.max(1,v) Math.max(1,v+color[8]) ); } }
Main.java:47: error: ')' or ',' expected Math.max(1,v) ^ Main.java:48: error: ';' expected Math.max(1,v+color[8]) ^ 2 errors
s622680510
p03695
C++
// AtCoder Beginner Contest 064 // C - Colorful Leaderboard #include <cstdio> #include <cstring> #include <algprithm> using namespace std; typedef long long int ll; const int R = 8; const int R_STEP = 400; int N; int counts[R + 1]; int main() { int a; int rates; scanf("%d", &N); memset(counts, 0, sizeof(counts)); for (int i = 0; i < N; i++) { scanf("%d", &a); if (a >= R * R_STEP) { counts[R]++; } else { for (int j = 0; j < R; j++) { if (a < (j + 1) * R_STEP) { counts[j]++; break; } } } } rates = 0; for (int j = 0; j < R; j++) { if (counts[j] > 0) { rates++; } } printf("%d %d\n", max(rates, 1), rates + counts[R]); return 0; }
a.cc:6:10: fatal error: algprithm: No such file or directory 6 | #include <algprithm> | ^~~~~~~~~~~ compilation terminated.
s320487242
p03695
C++
#include <iostream> #include <algorithm> #include <string> #include <stack> #include <queue> #define rep(i,n) for(i=0;i<(n);i++) using namespace std; int main() { int n,min=0,max=0,f[9]={0},i; cin>>n; int a[n]; rep(i,n){ cin>>a[i]; if(a[i]<=399){ f[0]=1; } else if( a[i]<=799){ f[1]=1; } else if(a[i]<=1199){ f[2]=1; } else if(a[i]<=1599){ f[3]=1; } else if(a[i]<=1999){ f[4]=1; } else if(a[i]<=2399){ f[5]=1; } else if(a[i]<=2799){ f[6]=1; } else if(a[i]<=3199){ f[7]=1; } else{ f[8]++; } } rep(i,9){ if(i!=8){ min+=f[i]; max+=f[i]; } else{ max=min+f[8]; if(min==0 && any>0){ min=1; max=f[8]; } } } cout<<min<<" "<<max<<endl; // your code goes here return 0; }
a.cc: In function 'int main()': a.cc:53:38: error: 'any' was not declared in this scope 53 | if(min==0 && any>0){ | ^~~ a.cc:6:1: note: 'std::any' is defined in header '<any>'; this is probably fixable by adding '#include <any>' 5 | #include <queue> +++ |+#include <any> 6 |
s443828252
p03695
C++
#include <iostream> #include <algorithm> #include <string> #include <stack> #include <queue> #define rep(i,n) for(i=0;i<(n);i++) using namespace std; int main() { int n,min=0,max=0,f[9]={0},i; cin>>n; int a[n]; rep(i,n){ cin>>a[i]; if(a[i]>=1 && a[i]<=399){ f[0]=1; } else if(a[i]>=400 && a[i]<=799){ f[1]=1; } else if(a[i]>=800 && a[i]<=1199){ f[2]=1; } else if(a[i]>=1200 && a[i]<=1599){ f[3]=1; } else if(a[i]>=1600 && a[i]<=1999){ f[4]=1; } else if(a[i]>=2000 && a[i]<=2399){ f[5]=1; } else if(a[i]>=2400 && a[i]<=2799){ f[6]=1; } else if(a[i]>=2800 && a[i]<=3199){ f[7]=1; } else{ f[8]++; } } rep(i,9){ if(i!=8){ min+=f[i]; max+=f[i]; } else{ if(min==0 && any>0){ min=1; max=f[8]; } } } cout<<min<<" "<<max<<endl; // your code goes here return 0; }
a.cc: In function 'int main()': a.cc:52:38: error: 'any' was not declared in this scope 52 | if(min==0 && any>0){ | ^~~ a.cc:6:1: note: 'std::any' is defined in header '<any>'; this is probably fixable by adding '#include <any>' 5 | #include <queue> +++ |+#include <any> 6 |
s565754230
p03695
C
#include<stdio.h> int main(){ int n, a, i, hai=0, cha=0, mid=0, miz=0, ao=0, ki=0, o=0, aka=0, c=0, min; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d", &a); if(1<=a&&a<=399) hai=1; if(400<=a&&a<=799) cha=1; if(800<=a&&a<=1199) mid=1; if(1200<=a&&a<=1599) miz=1; if(1600<=a&&a<=1999) ao=1; if(2000<=a&&a<=2399) ki=1; if(2400<=a&&a<=2799) o=1; if(2800<=a&&a<=3199) aka=1; if(3200<=a) c++; } min=hai+cha+mid+miz+ao+ki+o+aka; if(min=0) printf("%d %d\n", min+1, min+c); else printf("%d %d\n", min, min+c) return 0; }
main.c: In function 'main': main.c:25:37: error: expected ';' before 'return' 25 | else printf("%d %d\n", min, min+c) | ^ | ; 26 | 27 | return 0; | ~~~~~~
s253952665
p03695
C++
#include<iostream> using namespace std; int main(){ int n,a[100]={0}; cin>>n; int b[9]={0}; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]<3200){ a[i]/=400; } else{ a[i]=8; } } int max=a[0]; for(int i=1;i<n;i++){ if(max<a[i]){ max=a[i]; } } for(int i=0;i<n;i++){ b[a[i]]+=1; "gc.cpp" 40L, 493C 1,1 先頭
a.cc: In function 'int main()': a.cc:24:9: error: expected ';' before numeric constant 24 | "gc.cpp" 40L, 493C 1,1 先頭 | ^~~~ | ; a.cc:24:80: error: expected '}' at end of input 24 | "gc.cpp" 40L, 493C 1,1 先頭 | ^ a.cc:22:29: note: to match this '{' 22 | for(int i=0;i<n;i++){ | ^ a.cc:24:80: error: expected '}' at end of input 24 | "gc.cpp" 40L, 493C 1,1 先頭 | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s000398932
p03695
C++
#include<cstdio> #include<cstring> int main() { int n,a[4850],f[9]; while(scanf("%d",&n)==1) { int cnt=0,sum=0; memset(f,0,sizeof(f)); for(int i=0; i<n; i++) { scanf("%d",&a[i]); } for(int i=0; i<n; i++) { if(a[i]>=1&&a[i]<=399) f[1]=1; if(a[i]>=400&&a[i]<=799) f[2]=1; if(a[i]>=800&&a[i]<=1199) f[3]=1; if(a[i]>=1200&&a[i]<=1599) f[4]=1; if(a[i]>=1600&&a[i]<=1999) f[5]=1; if(a[i]>=2000&&a[i]<=2399) f[6]=1; if(a[i]>=2400&&a[i]<=2799) f[7]=1; if(a[i]>=2800&&a[i]<=3199) f[8]=1; if(a[i]>3199) cnt++; } for(int i=1; i<9; i++) { if(f[i]==1) sum++; } cnt+=sum; if (cnt > 0) { if (sum > 1) sum -= 1; cnt += k - 1; } printf("%d %d\n",sum,cnt); } return 0; }
a.cc: In function 'int main()': a.cc:45:32: error: 'k' was not declared in this scope 45 | cnt += k - 1; | ^
s150169136
p03695
C++
#include<cstdio> #include<cstring> int main() { int n,a[4850],f[9]; while(scanf("%d",&n)==1) { int cnt=0,sum=0; memset(f,0,sizeof(f)); for(int i=0; i<n; i++) { scanf("%d",&a[i]); } for(int i=0; i<n; i++) { if(a[i]>=1&&a[i]<=399) f[1]=1; if(a[i]>=400&&a[i]<=799) f[2]=1; if(a[i]>=800&&a[i]<=1199) f[3]=1; if(a[i]>=1200&&a[i]<=1599) f[4]=1; if(a[i]>=1600&&a[i]<=1999) f[5]=1; if(a[i]>=2000&&a[i]<=2399) f[6]=1; if(a[i]>=2400&&a[i]<=2799) f[7]=1; if(a[i]>=2800&&a[i]<=3199) f[8]=1; if(a[i]>3199) cnt++; } for(int i=1; i<9; i++) { if(f[i]==1) sum++; } cnt+=sum; if (cnt > 0) { if (sum > 1) sum -= 1; cnt += k - 1; } /*if(sum==0) sum=1; if(cnt>8) cnt=8;*/ printf("%d %d\n",sum,cnt); } return 0; }
a.cc: In function 'int main()': a.cc:45:32: error: 'k' was not declared in this scope 45 | cnt += k - 1; | ^
s037407593
p03695
C
#include <stdio.h> #include <stdlib.h> int main(void) { char a[1000000],w[10]; int n, num[101],i,j,k,color[10], min = 0, max = 0; for(i = 0; i < 10; i++) color[i] = 0; scanf("%d", &n); rewind(stdin); gets(a); j=0; k=0; for(i=0;a[i]!='\0';i++){ if(a[i]==' '){ w[j]='\0'; num[k++]=atoi(w); j=0; } w[j++]=a[i]; } w[j]='\0'; num[k++]=atoi(w); for(i = 0; i < n; i++){ switch (i/400){ case 0: color[0]++; break; case 1: color[1]++; break; case 2: color[2]++; break; case 3: color[3]++; break; case 4: color[4]++; break; case 5: color[5]++; break; case 6: color[6]++; break; case 7: color[7]++; break; default: color[8]++; break; } } for(i = 0; i < 8; i++){ if(color[i] > 0) min++; max++; } } if(color[8] > 0){ if(8-max < color[8]) max = 8; else max = max + color[8]; } printf("%d %d", min, max); return 0; }
main.c: In function 'main': main.c:12:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 12 | gets(a); | ^~~~ | fgets main.c: At top level: main.c:63:9: error: expected identifier or '(' before 'if' 63 | if(color[8] > 0){ | ^~ main.c:69:16: error: expected declaration specifiers or '...' before string constant 69 | printf("%d %d", min, max); | ^~~~~~~ main.c:69:25: error: unknown type name 'min' 69 | printf("%d %d", min, max); | ^~~ main.c:69:30: error: unknown type name 'max' 69 | printf("%d %d", min, max); | ^~~ main.c:71:9: error: expected identifier or '(' before 'return' 71 | return 0; | ^~~~~~ main.c:72:1: error: expected identifier or '(' before '}' token 72 | } | ^
s507502947
p03695
C++
#include <iostream> #include<string> #include<cctype> #include<algorithm> using namespace std; int main() { int n; int a[1000]; int gray = 0; int br = 0; int gr = 0; int lb = 0; int bl = 0, ye = 0, ora = 0, re = 0, min = 0, max = 0, god = 0; cin >> n ; for (int x = 0; x < n; ++x)cin >> a[x]; sort(a,a+n) for (int x = 0; x < n; ++x) { if (a[x] < 400 && gray == 0)gray = 1; else if (a[x] >= 400 && a[x] < 800 && br == 0)br = 1; else if (a[x] >= 800 && a[x] < 1200 && gr == 0)gr = 1; else if (a[x] >= 1200 && a[x] < 1600 && lb == 0)lb = 1; else if (a[x] >= 1600 && a[x] < 2000 && bl == 0)bl = 1; else if (a[x] >= 2000 && a[x] < 2400 && ye == 0)ye = 1; else if (a[x] >= 2400 && a[x] < 2800 && ora == 0)ora = 1; else if (a[x] >= 2800 && a[x] < 3200 && re == 0)re = 1; else if(a[x] >= 3200 ) god = god + 1; } min = gray + br + gr + lb + bl + ye + ora +re; max= gray + br + gr + lb + bl + ye + ora +re+god; if (min<1)min=1; if (max > 8)max = 8; cout << min <<" "<< max << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:20: error: expected ';' before 'for' 17 | sort(a,a+n) | ^ | ; 18 | for (int x = 0; x < n; ++x) { | ~~~ a.cc:18:25: error: 'x' was not declared in this scope 18 | for (int x = 0; x < n; ++x) { | ^
s780225531
p03695
C
#include <stdio.h> int main(void) { int N,i,M,m,a[4800]; a[4800]={0},m=0; int b[9]={0}; scanf("%d",&N); for(i=0;i<N;i++) { scanf("%d",&a[i]); } for(i=0;i<N;i++) { if(a[i]<400) { b[0]=1; } if((a[i]>=400)&&a[i]<800) { b[1]=1; } if((a[i]>=800)&&a[i]<1200) { b[2]=1; } if((a[i]>=1200)&&a[i]<1600) { b[3]=1; } if((a[i]>=1600)&&a[i]<2000) { b[4]=1; } if((a[i]>=2000)&&a[i]<2400) { b[5]=1; } if((a[i]>=2400)&&a[i]<2800) { b[6]=1; } if((a[i]>=2800)&&a[i]<3200) { b[7]=1; } if(a[i]>=3200) { b[8]++; } } for(i=0;i<8;i++) { m=m+b[i]; } M=m+b[8]; if(M>8) { M=8; } printf("%d %d",m,M); return 0; }
main.c: In function 'main': main.c:6:13: error: expected expression before '{' token 6 | a[4800]={0},m=0; | ^
s584466501
p03695
C
#include <stdio.h> int main(void) { int N,i,M,m,a[4800]; a[4800]={0},m=0; int b[9]={0}; scanf("%d",&N); for(i=0;i<N;i++) { scanf("%d",&a[i]); } for(i=0;i<N;i++) { if(a[i]<400) { b[0]=1; } if((a[i]>=400)&&a[i]<800) { b[1]=1; } if((a[i]>=800)&&a[i]<1200) { b[2]=1; } if((a[i]>=1200)&&a[i]<1600) { b[3]=1; } if((a[i]>=1600)&&a[i]<2000) { b[4]=1; } if((a[i]>=2000)&&a[i]<2400) { b[5]=1; } if((a[i]>=2400)&&a[i]<2800) { b[6]=1; } if((a[i]>=2800)&&a[i]<3200) { b[7]=1; } if(a[i]>=3200) { b[8]++; } } for(i=0;i<8;i++) { m=m+b[i]; } M=m+b[8]; if(M>8) { M=8; } printf("%d %d",m,M); return 0; }
main.c: In function 'main': main.c:6:13: error: expected expression before '{' token 6 | a[4800]={0},m=0; | ^
s333860914
p03695
Java
"C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\bin" -Dfile.encoding=windows-31j -classpath "C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\zipfs.jar;C:\xampp\htdocs\untitled2\out\production\untitled2;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain Main 20 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1 1 Process finished with exit code 0
Main.java:1: error: illegal escape character "C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\bin" -Dfile.encoding=windows-31j -classpath "C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\zipfs.jar;C:\xampp\htdocs\untitled2\out\production\untitled2;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain Main ^ Main.java:1: error: illegal escape character "C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\bin" -Dfile.encoding=windows-31j -classpath "C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\zipfs.jar;C:\xampp\htdocs\untitled2\out\production\untitled2;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain Main ^ Main.java:1: error: illegal escape character "C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\bin" -Dfile.encoding=windows-31j -classpath "C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\zipfs.jar;C:\xampp\htdocs\untitled2\out\production\untitled2;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain Main ^ Main.java:1: error: illegal escape character "C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\bin" -Dfile.encoding=windows-31j -classpath "C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\zipfs.jar;C:\xampp\htdocs\untitled2\out\production\untitled2;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain Main ^ Main.java:1: error: class, interface, enum, or record expected "C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\bin" -Dfile.encoding=windows-31j -classpath "C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\ext\zipfs.jar;C:\xampp\htdocs\untitled2\out\production\untitled2;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain Main ^ Main.java:1: error: illegal escape character "C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java" -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.6\bin" -Dfile.encoding=windows-31j -classpath "C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_71\jre\lib\plu
s920286946
p03695
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n, i, num, max, min; int gray, brown, green, lightblue, blue, yellow, orange, red, tmp; gray = brown = green = lightblue = blue = yellow = orange = red = tmp = 0; cin >> n; for(i = 0; i < n; i++){ cin >> num; if(num >= 1 && num <= 399){ if(gray == 0) gray++; }else if(num >= 400 && num <= 799){ if(brown == 0) brown++; }else if(num >= 800 && num <= 1199){ if(green == 0) green++; }else if(num >= 1200 && num <= 1599){ if(lightblue == 0) lightblue++; }else if(num >= 1600 && num <= 1999){ if(blue == 0) blue++; }else if(num >= 2000 && num <= 2399){ if(yellow == 0) yellow++; }else if(num >= 2400 && num <= 2799){ if(orange == 0) orange++; }else if(num >= 2800 && num <= 3199){ if(red == 0) red++; }else{ tmp++; } } max = gray + brown + green + lightblue + blue + yellow + orange + red; min = gray + brown + green + lightblue + blue + yellow + orange + red; if(n <= 8 || (max == 0 && tmp >= 1){ max += tmp; }else if(n > 8 && max == 0){ max = 8; } if(min == 0 && tmp >= 1) min = 1; cout << min << " " << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:38: error: expected ';' before '{' token 36 | if(n <= 8 || (max == 0 && tmp >= 1){ | ^ | ; a.cc:38:4: error: expected primary-expression before 'else' 38 | }else if(n > 8 && max == 0){ | ^~~~ a.cc:38:4: error: expected ')' before 'else' 38 | }else if(n > 8 && max == 0){ | ^~~~ | ) a.cc:36:5: note: to match this '(' 36 | if(n <= 8 || (max == 0 && tmp >= 1){ | ^
s866470052
p03695
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <stack> #include <queue> #include <cctype> #include <cmath> #include <map> #include <set> #define rep(i, m, n) for(int i = m;i < n;i++) #define repr(i, n) for(int i = n;i >= 0;i--) #define ll long long #define ull unsigned long long #define pb(a) push_back(a) #define popb(a) pop_back(a) #define debug(x) cout<<#x<<": "<<x<<endl #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define INF 999999999 #define PI 3.14159265358979 using namespace std; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; int main(){ int n,a,cnt[15]={},sum1=0,sum2=0; bool flag=false; cin>>n; rep(i,0,n){ cin>>a; a/=400; cnt[a]+++ if((a>=8)flag=true; } rep(i,0,8){ sum1+=cnt[i]; } rep(i,8,13){ sum2+=cnt[i]; } if(flag){ cout<<(++sum1)<<" "<<sum1+sum2<<endl; }else{ cout<<sum1<<" "<<sum1<<endl; } }
a.cc: In function 'int main()': a.cc:39:5: error: expected primary-expression before 'if' 39 | if((a>=8)flag=true; | ^~
s403294524
p03695
C++
#include "bits//stdc++.h" using namespace std; int N; set<int> ratings; int M = 0; int main() { freopen("data.txt", "r", stdin); cin >> N; for (int i = 0; i < N; ++i) { int temp = 0; cin >> temp; if (temp >= 3200) { ++M; } else { int r = temp / 400; ratings.insert(r); } } cout << max(ratings.size(), 1) << " " << (ratings.size() + M) << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:20: error: no matching function for call to 'max(std::set<int>::size_type, int)' 20 | cout << max(ratings.size(), 1) << " " << (ratings.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:20:20: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 20 | cout << max(ratings.size(), 1) << " " << (ratings.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:20:20: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 20 | cout << max(ratings.size(), 1) << " " << (ratings.size() + M) << endl; | ~~~^~~~~~~~~~~~~~~~~~~
s886556786
p03695
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <stack> #include <queue> #include <cctype> #include <cmath> #include <map> #include <set> #define rep(i, m, n) for(int i = m;i < n;i++) #define repr(i, n) for(int i = n;i >= 0;i--) #define ll long long #define ull unsigned long long #define pb(a) push_back(a) #define popb(a) pop_back(a) #define debug(x) cout<<#x<<": "<<x<<endl #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define INF 999999999 #define PI 3.14159265358979 using namespace std; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; int main(){ int n,a,cnt[15]={},sum1=0,sum2=0; bool flag=false; cin>>n; rep(i,0,n){ cin>>a; cnt[a/400]+++ if(a/400>=8)flag=true; } rep(i,0,8){ sum1+=cnt[i]; } rep(i,8,13){ sum2+=cnt[i]; } if(flag){ cout<<(++sum1)<<" "<<sum1+sum2<<endl; }else{ cout<<sum1<<" "<<sum1<<endl; }z }
a.cc: In function 'int main()': a.cc:38:5: error: expected primary-expression before 'if' 38 | if(a/400>=8)flag=true; | ^~ a.cc:50:4: error: 'z' was not declared in this scope 50 | }z | ^
s226309263
p03695
C
#include <stdio.h> int main(){ int n, i; int data; int rate[8]={}; int king=0; int ans=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&data); if(data[i]<400){ rate[0]=1; }else if(data<800){ rate[1]=1; }else if(data<1200){ rate[2]=1; }else if(data<1600){ rate[3]=1; }else if(data<2000){ rate[4]=1; }else if(data<2400){ rate[5]=1; }else if(data<2800){ rate[6]=1; }else if(data<3200){ rate[7]=1; }else{ king++; } } for(i=0;i<8;i++){ if(rate[i]==1) ans++; } printf("%d ",ans); ans+=king; printf("%d\n",ans); return 0; }
main.c: In function 'main': main.c:12:16: error: subscripted value is neither array nor pointer nor vector 12 | if(data[i]<400){ | ^
s200549683
p03695
C++
#include <iostream> using namespace std; int main(){ int n; cin>>n; int a[n]; int b[9]={0}; int total=0; int other=0; int cnt=0; int min=0; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ if(1<=a[i]&&a[i]<400){ b[0]++; } else if(400<=a[i]&&a[i]<800){ b[1]++; } else if(800<=a[i]&&a[i]<1200){ b[2]++; } else if(1200<=a[i]&&a[i]<1600){ b[3]++; } else if(1600<=a[i]&&a[i]<2000){ b[4]++; } else if(2000<=a[i]&&a[i]<2400){ b[5]++; } else if(2400<=a[i]&&a[i]<2800){ b[6]++; } else if(2800<=a[i]&&a[i]<3200){ b[7]++; } else{ other++; } total++; } for(int i=0;i<8;i++){ cout<<b[i]<<" "; } for(int i=0;i<8;i++){ if(b[i]!=0){ min++; } } cout<<endl; cout<<min<<" "l; // cout<<endl; // cout<<other<<endl; if(other==0){ cout<<min<<endl; }else if(min+other>9){ cout<<8<<endl; }else{ cout<<other+min<<endl; } // cout<<cnt<<endl; // cout<<total<<endl; // cout<<other<<endl; // cout<< // if(other+cnt>9){ // total=8; // } // cout<<cnt<<" "<<total<<endl; }
a.cc: In function 'int main()': a.cc:64:20: error: unable to find string literal operator 'operator""l' with 'const char [2]', 'long unsigned int' arguments 64 | cout<<min<<" "l; | ^~~~
s873287696
p03695
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(){ int N; cin >> N; vector<int> a(N); for(int i=0;i < N;i++){ cin >> a[i]; } vector<bool> add_flag(8,true); int rate_normal_num = 0; int over_rate_num = 0; for(int i=0;i < N;i++){ for(int j=0;j < 8;j++){ if(j*400 <= a[i] && a[i] <= ((j+1)*400 - 1) && add_flag[j]){ rate_normal_num ++; add_flag[j] = false; } } if(3200 <= a[i]){ over_rate_num++; } } if{rate_normal_num == 0}{ if(over_rate_num > 8){ cout << "" << 1 << ' ' << 8; }else{ cout << "" << 1 << ' ' << over_rate_num; } }else{ if(rate_normal_num + over_rate_num > 8){ cout << "" << rate_normal_num << ' ' << 8; }else{ cout << "" << rate_normal_num << ' ' << rate_normal_num+over_rate_num; } } return 0; }
a.cc: In function 'int main()': a.cc:28:7: error: expected '(' before '{' token 28 | if{rate_normal_num == 0}{ | ^ | ( a.cc:34:6: error: 'else' without a previous 'if' 34 | }else{ | ^~~~
s120883285
p03695
C++
#include <iostream> #include <vector> #include <numeric> #include <algorithm> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> v(N), c(8, 0); int free_color = 0; for (int i = 0; i < N; ++i){ cin >> v[i]; if (v[i] < 400) c[0] = 1; else if (v[i] > 399 && v[i] < 800) c[1] = 1; else if (v[i] > 799 && v[i] < 1200) c[2] = 1; else if (v[i] > 1199 && v[i] < 1600) c[3] = 1; else if (v[i] > 1599 && v[i] < 2000) c[4] = 1; else if (v[i] > 1999 && v[i] < 2400) c[5] = 1; else if (v[i] > 2399 && v[i] < 2800) c[6] = 1; else if (v[i] > 2799 && v[i] < 3200) c[7] = 1; else if (v[i] > 3199) free_color += 1; } int sum = accumulate(c.begin(), c.end(), 0); if (sum + free_color <= 8) cout << sum << " " << sum + free_color << endl; else if (sum.size() == 0 && free_color <= 8) cout << 1 << " " << free_color << endl; else if (sum.size() == 0 && free_color > 8) cout << 1 << " " << 8 << endl; else cout << sum << " " << 8 << endl; return 0; }
a.cc: In function 'int main()': a.cc:32:18: error: request for member 'size' in 'sum', which is of non-class type 'int' 32 | else if (sum.size() == 0 && free_color <= 8) cout << 1 << " " << free_color << endl; | ^~~~ a.cc:33:18: error: request for member 'size' in 'sum', which is of non-class type 'int' 33 | else if (sum.size() == 0 && free_color > 8) cout << 1 << " " << 8 << endl; | ^~~~
s201776189
p03695
C++
#include<iostream> #include<set> using namespace std;   int WhichColor(int rate) { if (rate >= 1 && rate <= 399) return 1; if (rate >= 400 && rate <= 799) return 2; if (rate >= 800 && rate <= 1199) return 3; if (rate >= 1200 && rate <= 1599) return 4; if (rate >= 1600 && rate <= 1999) return 5; if (rate >= 2000 && rate <= 2399) return 6; if (rate >= 2400 && rate <= 2799) return 7; if (rate >= 2800 && rate <= 3199) return 8; else return 0; }   int main() { set<int> s; int N; while (cin >> N) { s.clear(); int a, k = 0; for (int i = 1; i <= N; i++) { cin >> a; int color = WhichColor(a); if (color == 0) k++; s.insert(color); } int min = s.size(); int max = min; if (k > 0) { if (min > 1) min -= 1; max += k - 1; } cout << min << " " << max << endl; } system("pause"); return 0; }
a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:25:1: error: extended character   is not valid in an identifier 25 |   | ^ a.cc:4:1: error: '\U000000a0' does not name a type 4 |   | ^ a.cc:25:1: error: '\U000000a0' does not name a type 25 |   | ^
s377322777
p03695
C++
#include <iostream> using namespace std; int cnt=0,ans=0,n; bool b[8]; int main(){ cin>>n; memset(b,0,sizeof(b)); for(int i=0;i<n;++i){ int a,now; cin>>a; if(1<=a && a<=399) now=0; else if(400<=a && a<=799) now=1; else if(800<=a && a<=1199) now=2; else if(1200<=a && a<=1599) now=3; else if(1600<=a && a<=1999) now=4; else if(2000<=a && a<=2399) now=5; else if(2400<=a && a<=2799) now=6; else if(2800<=a && a<=3199) now=7; else { cnt++; continue; } if(!b[now]){ ans++; b[now]=true; } } cout<<((!ans)?1:ans)<<" "<<min(8,ans+cnt)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'memset' was not declared in this scope 7 | memset(b,0,sizeof(b)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s059413738
p03695
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; int main(){ int n; scanf("%d",&n); int a[1000]={0}; int cnt1=0; int cnt2=0; int cnt3=0; int cnt4=0; int cnt5=0; int cnt6=0; int cnt7=0; int cnt8=0; int cnt9=0; for(int i = 0;i < n;i++){ scanf("%d",&a[i]); if(a[i]<400){ cnt1=1; }else if(a[i]<800){ cnt2=1; }else if(a[i]<1200){ cnt3=1; }else if(a[i]<1600){ cnt4=1; }else if(a[i]<2000){ cnt5=1; }else if(a[i]<2400){ cnt6=1; }else if(a[i]<2800){ cnt7=1; }else if(a[i]<3200){ cnt8=1; }else{ cnt9++; } } int res1 = cnt1+cnt2+cnt3+cnt4+cnt5+cnt6+cnt7+cnt8; res2 = res1 + cnt9; printf("%d %d",res1,res2); return 0; }
a.cc: In function 'int main()': a.cc:45:3: error: 'res2' was not declared in this scope; did you mean 'res1'? 45 | res2 = res1 + cnt9; | ^~~~ | res1
s362213869
p03695
C++
#include <iostream> #include <vector> #include <numeric> #include <algorithm> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> v(N), c(8, 0); int free_color = 0; for (int i = 0; i < N; ++i){ cin >> v[i]; if (v[i] < 400) c[0] = 1; else if (v[i] > 399 && v[i] < 800) c[1] = 1; else if (v[i] > 799 && v[i] < 1200) c[2] = 1; else if (v[i] > 1199 && v[i] < 1600) c[3] = 1; else if (v[i] > 1599 && v[i] < 2000) c[4] = 1; else if (v[i] > 1999 && v[i] < 2400) c[5] = 1; else if (v[i] > 2399 && v[i] < 2800) c[6] = 1; else if (v[i] > 2799 && v[i] < 3200) c[7] = 1; else if (v[i] > 3199) free_color += 1; } int sum = accumulate(c.begin(), c.end(), 0); if (n_count + free_color <= 8) cout << sum << " " << sum + free_color << endl; else cout << sum << " " << 8 << endl; return 0; }
a.cc: In function 'int main()': a.cc:31:9: error: 'n_count' was not declared in this scope 31 | if (n_count + free_color <= 8) cout << sum << " " << sum + free_color << endl; | ^~~~~~~
s224381712
p03695
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; int main(){ int n; scanf("%d",&n); int a[1000]={0}; int cnt1=0; int cnt2=0; int cnt3=0; int cnt4=0; int cnt5=0; int cnt6=0; int cnt7=0; int cnt8=0; int cnt9=0; for(int i = 0;i < n;i++){ scanf("%d",&a[i]); if(a[i]<400){ cnt1=1; }else if(a[i]<800){ cnt2=1; }else if(a[i]<1200){ cnt3=1; }else if(a[i]<1600){ cnt4=1; }else if(a[i]<2000){ cnt5=1; }else if(a[i]<2400){ cnt6=1; }else if(a[i]<2800){ cnt7=1; }else if(a[i]<3200){ cnt8=1; }else{ cnt9++; } } int res1 = cnt1+cnt2+cnt3+cnt4+cnt5+cnt6+cnt7+cnt8; int resout; int res2=0; if(res1==8){ res2=8; }else if(res1==7&&cnt9>0){ res2=8; }else if(res1<7&&res1/=0&&cnt9>=8-res1){ res2=8; }else{ res2 = res1 + cnt9; } printf("%d %d",res1,res2); return 0; }
a.cc: In function 'int main()': a.cc:50:24: warning: division by zero [-Wdiv-by-zero] 50 | }else if(res1<7&&res1/=0&&cnt9>=8-res1){ | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ a.cc:50:18: error: lvalue required as left operand of assignment 50 | }else if(res1<7&&res1/=0&&cnt9>=8-res1){ | ~~~~~~^~~~~~
s295852752
p03695
C++
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key #define INF 1e9 typedef long long ll; typedef pair<ll,ll> ii; typedef vector<int> vi; typedef vector < pair<int, int> > vii; typedef long double ld; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; typedef set<int>::iterator sit; typedef map<int,int>::iterator mit; typedef vector<int>::iterator vit; ll n, a, ans; ll used[9], level[9]; int main() { cin >> n; level[0]=399; level[1]=799; level[2]=1199; level[3]=1599; level[4]=1999; level[5]=2399; level[6]=2799; level[7]=3199; level[8]=INF; for(int i =0; i < n; i++){ cin >> a; for(int j = 0; j <= 8; j++){ if(a<=level[j]){ used[j]++; j=9; } } } for(int i = 0; i <= 7; i++){ if(used[i]){ ans++; } } if(ans){ cout << ans << " " << ans+used[8] << endl; } else{ cout << min(1,used[8]) << " " << used[8] << endl; } }
a.cc: In function 'int main()': a.cc:59:28: error: no matching function for call to 'min(int, ll&)' 59 | cout << min(1,used[8]) << " " << used[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:59:28: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 59 | cout << min(1,used[8]) << " " << used[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:59:28: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 59 | cout << min(1,used[8]) << " " << used[8] << endl; | ~~~^~~~~~~~~~~
s429647453
p03695
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; int main() { nt n; scanf("%d", &n); int c[9]; memset(c, 0, sizeof c); for (int i = 0; i < n; i++) { int a; scanf("%d", &a); c[min(a / 400, 8)]++; } int mn = 0; for (int i = 0; i < 8; i++) mn += (c[i] > 0); if (mn) printf("%d %d\n", mn, mn + c[8]); else printf("1 %d\n", c[8]); return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'nt' was not declared in this scope; did you mean 'int'? 8 | nt n; | ^~ | int a.cc:9:22: error: 'n' was not declared in this scope 9 | scanf("%d", &n); | ^
s690219480
p03695
C++
#include<iostream> #include<vector> #include<stack> #include<algorithm> #include<string> #include<set> #include<numeric> #include<functional> #include<unordered_map> using namespace std; int main() { int N; cin >> N; int color[8]; for (int i = 0; i < 8; i++) color[i] = 0; int free = 0; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a[i]; if (0 <= a[i] && a[i] < 400) color[0]++; else if (400 <= a[i] && a[i] < 800) color[1]++; else if (800 <= a[i] && a[i] < 1200) color[2]++; else if (1200 <= a[i] && a[i] < 1600) color[3]++; else if (1600 <= a[i] && a[i] < 2000) color[4]++; else if (2000 <= a[i] && a[i] < 2400) color[5]++; else if (2400 <= a[i] && a[i] < 2800) color[6]++; else if (2800 <= a[i] && a[i] < 3200) color[7]++; else if (3200 <= a[i]) free++; } int min_ = 0, max_; for (int i = 0; i < 8; i++) { if (color[i] > 0) min_++; } min_ max(min_, 1); max_ = min_ + free; printf("%d %d\n", min_, max_);}
a.cc: In function 'int main()': a.cc:49:9: error: expected ';' before 'max' 49 | min_ max(min_, 1); | ^~~~ | ;
s482311168
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define rep(i,a,b) for(ll i=a;i<b;i++) #define repx(i,a,b,x) for(ll i=a;i<b;i+=x) #define rev(i,a,b) for(ll i=a;i>b;i--) #define revx(i,a,b,x) for(ll i=a;i>b;i-=x) #define arep(it,v) for(auto it=v.begin();it!=v.end();it++) #define wh1(n) rep(xy1,0,n) #define wh2(n) rep(xy2,0,n) #define wh3(n) rep(xy3,0,n) #define sc(i) cin>>i #define ssc(i,j) sc(i);sc(j) #define sssc(i,j,k) ssc(i,j);sc(k) #define pf(i) cout<<i<<" " #define pfn(i) cout<<i<<endl #define cvec(v,n) rep(abc,0,n){ll xyz;sc(xyz);v.pb(xyz);} #define pvec(v,n) rep(abc,0,n){pf(v[abc].F);pf(v[abc].S);}pfn("") #define pll pair<ll,ll> #define vll vector<ll> #define mll map<ll,ll> #define sll set<ll> #define spll set<pll> #define vpll vector<pll> #define vvll vector<vll> #define vvpll vector<vpll> #define pq(a) priority_queue<a> #define pqc(a,cmp) priority_queue<a,vector<a>,cmp> #define F first #define S second #define B begin #define E end #define R return #define mp make_pair #define pb push_back #define ln length() #define to_s to_string #define Sort(v) sort(v.begin(),v.end()) #define Scmp(v,cmp) sort(v.begin(),v.end(),cmp) #define zero_arr(v) memset(v,0,sizeof(v)) #define update_map(m,i) if(m.find(i)!=m.end()){m[i]++;}else{m[i]=1;} #define update_mapx(m,i,x) if(m.find(i)!=m.end()){m[i]+=x;}else{m[i]=x;} #define M 1000000007 #define INF 2000000000 #define fast ios::sync_with_stdio(0); cin.tie(0) int main(){ fast; ll n; sc(n); vll v; cvec(v,n); vll c(9,0); rep(i,0,n){ if(v[i]<400){ c[0]++; }else if(v[i]<800){ c[1]++; }else if(v[i]<1200){ c[2]++; }else if(v[i]<1600){ c[3]++; }else if(v[i]<2000){ c[4]++; }else if(v[i]<2400){ c[5]++; }else if(v[i]<2800){ c[6]++; }else if(v[i]<3200){ c[7]++; }else{ c[8]++; } } ll c1=0,c2=0; rep(i,0,8){ if(c[i]>0){ c1++; } } c2=c[8]; pf(max(c1,1)); pfn(c1+c2); R 0; }
a.cc: In function 'int main()': a.cc:83:11: error: no matching function for call to 'max(ll&, int)' 83 | pf(max(c1,1)); | ~~~^~~~~~ a.cc:17:21: note: in definition of macro 'pf' 17 | #define pf(i) cout<<i<<" " | ^ 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:83:11: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 83 | pf(max(c1,1)); | ~~~^~~~~~ a.cc:17:21: note: in definition of macro 'pf' 17 | #define pf(i) cout<<i<<" " | ^ /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:83:11: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 83 | pf(max(c1,1)); | ~~~^~~~~~ a.cc:17:21: note: in definition of macro 'pf' 17 | #define pf(i) cout<<i<<" " | ^
s995534222
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define rFOR(i,a,b) for(int i=a;i>=b;i--) #define rep(i,b) FOR(i,0,b) #define INF 1e9 #define dump(x) cerr<< #x << " = "<<(x)<<endl #define int long long using ll = long long; const ll mod = LLONG_MAX; typedef pair<int,int> P; int a[110]; bool isc[10]; int cnt,ret; signed main(){ int n; cin>>n; rep(i,n){ cin>>a[i]; } rep(i,10){ isc[i]=false; } rep(i,n){ if(a[i]<=399)isc[0]=true; else if(a[i]<=799)isc[1]=true; else if(a[i]<=1199)isc[2]=true; else if(a[i]<=1599)isc[3]=true; else if(a[i]<=1999)isc[4]=true; else if(a[i]<=2399)isc[5]=true; else if(a[i]<=2799)isc[6]=true; else if(a[i]<=3199)isc[7]=true; else cnt++; } rep(i,9){ if(isc[i])ret++; } if(ret>0)t=0; else t=1; cout<<ret+t<<" "<<ret+cnt<<endl; }
a.cc: In function 'int main()': a.cc:45:12: error: 't' was not declared in this scope 45 | if(ret>0)t=0; | ^ a.cc:46:8: error: 't' was not declared in this scope 46 | else t=1; | ^ a.cc:48:13: error: 't' was not declared in this scope 48 | cout<<ret+t<<" "<<ret+cnt<<endl; | ^
s233175769
p03695
C++
#include <iostream> using namespace std; int main(){ int col[10]; for(int x=0; x<10; x++) col[x] = 0; int N; cin>>N; int gt = 0; int a; for(int n=0; n<N; n++){ cin>>a; if(a>=3200) gt++; else if(a>=2800) col[7]++; else if(a>=2400) col[6]++; else if(a>=2000) col[5]++; else if(a>=1600) col[4]++; else if(a>=1200) col[3]++; else if(a>=800) col[2]++; else if(a>=400) col[1]++; else col[0]++; } int diffc = 0; for(int x=0; x<8; x++){ diffc += (col[x]>0); } if(diffc==0&&gt>0) cout << 1; else cout << diffc; cout << " "; cout << min(1e9, diffc+gt) << endl; return 0; }
a.cc: In function 'int main()': a.cc:42:20: error: no matching function for call to 'min(double, int)' 42 | cout << min(1e9, diffc+gt) << 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:42:20: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'int') 42 | cout << min(1e9, diffc+gt) << 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
s797692923
p03695
C++
5 1100 1900 2800 3200 3200
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^
s278658143
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(void){ int n; cin >> n; int a; set<int> st; int cnt = 0; for(int i=0;i<n;i++){ cin >> a; if(a >= 3200){ cnt++; }else{ st.insert(a / 400); } } cout << max(1,st.size()) << " " << st.size() + cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:14: error: no matching function for call to 'max(int, std::set<int>::size_type)' 18 | cout << max(1,st.size()) << " " << st.size() + cnt << endl; | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:18:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<int>::size_type' {aka 'long unsigned int'}) 18 | cout << max(1,st.size()) << " " << st.size() + cnt << endl; | ~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:18:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 18 | cout << max(1,st.size()) << " " << st.size() + cnt << endl; | ~~~^~~~~~~~~~~~~
s062226248
p03695
C++
#include <iostream> using namespace std; int main() { int rate[4800] = {0}; int colorNum , i= 0; int varN = 0; int min = 0, max = 0; bool colorflag[8]; memset(colorflag, false, sizeof(colorflag[0])); while (cin >> rate[i]) { i++; } for (int ci = 0; ci != i; ci++) { if (1 <= rate[ci] && rate[ci] <= 399) { colorflag[0] = true; } else if (400 <= rate[ci] && rate[ci] <= 799) { colorflag[1] = true; } else if (800 <= rate[ci] && rate[ci] <= 1199) { colorflag[2] = true; } else if (1200 <= rate[ci] && rate[ci] <= 1599) { colorflag[3] = true; } else if (1600 <= rate[ci] && rate[ci] <= 1999) { colorflag[4] = true; } else if (2000 <= rate[ci] && rate[ci] <= 2399) { colorflag[5] = true; } else if (2400 <= rate[ci] && rate[ci] <= 2799) { colorflag[6] = true; } else if (2800 <= rate[ci] && rate[ci] <= 3199) { colorflag[7] = true; } else { varN++; } } for (int ci = 0; ci < 8; ci++) { if (colorflag[ci] == true) { min++; } } max = min + varN; max = (8 < max) ? 8 : max; cout << min << " " << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'memset' was not declared in this scope 11 | memset(colorflag, false, sizeof(colorflag[0])); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s432155943
p03695
C++
#include <cassert> #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> /* //#if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> */ // C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> /* //#if __cplusplus >= 201103L #include <array> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <typeindex> #include <type_traits> #include <unordered_map> #include <unordered_set> */ using namespace std; #define fi first #define se second #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define each(itr,v) for(auto itr:v) #define pb(s) push_back(s) #define mmax(x,y) (x>y?x:y) #define mmin(x,y) (x<y?x:y) #define maxch(x,y) x=mmax(x,y) #define minch(x,y) x=mmin(x,y) #define mp(a,b) make_pair(a,b) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<<x<<endl #define uni(x) x.erase(unique(all(x)),x.end()) template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;} template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;} #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) > (b) ? (b) : (a)) typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<P, int> PPI; #define INF INT_MAX/3 #define MAX_N 1000 #define M_INF 1000000000 int n,m,v,i; void solve(){ cin.tie(0); ios::sync_with_stdio(false); cin>>n; vector<int> v(n); rep(i,n) { cin>>v[i]; } int ans = 0; map<int,int> rate; rep(i,n){ if(v[i]>=3200){ ans++; continue; } rate.insert(mp(v[i]/400,v[i]/400)); } if(rate.size() == 0) cout<<1<<" "rate.size()+ans<<endl; else cout<<rate.size()<<" "rate.size()+ans<<endl; // if(rate.size()+ans > 8) cout<<8<<endl; // else cout<<rate.size()+ans<<endl; } int main(){ solve(); return 0; }
a.cc: In function 'void solve()': a.cc:131:33: error: unable to find string literal operator 'operator""rate' with 'const char [2]', 'long unsigned int' arguments 131 | if(rate.size() == 0) cout<<1<<" "rate.size()+ans<<endl; | ^~~~~~~ a.cc:132:27: error: unable to find string literal operator 'operator""rate' with 'const char [2]', 'long unsigned int' arguments 132 | else cout<<rate.size()<<" "rate.size()+ans<<endl; | ^~~~~~~
s009932405
p03695
Java
public class Main { public static void main(String[] args) { new Main().solve(); } int N; int[]a; //max4800 void solve(){ Scanner sc=new Scanner(System.in); N=sc.nextInt(); a=new int[N]; int[] color=new int[9]; for(int i=0;i<N;i++){ a[i]=sc.nextInt(); if(a[i]<3200)color[a[i]/400]++; else color[8]++; } int cnt=0; for(int i=0;i<8;i++){ if(color[i]>0){ cnt++; } } if(color[8]>0){ if(cnt==8)System.out.println(8+" "+8); else if(cnt==0)System.out.println(1+" "+Math.min(8, color[8])); else if(cnt+color[8]<=8) System.out.println(cnt+" "+(cnt+color[8])); else System.out.println(cnt+" "+8); }else{ System.out.println(cnt+" "+cnt); } } }
Main.java:10: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:10: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s954063643
p03695
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cassert> #include <string> #include <cstring> #include <vector> #include <list> #include <map> #include <set> #include <stack> #include <queue> #include <algorithm> using namespace std; // --------------------- // repetition #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) // debug #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; // --------------------- #define INF 922337203685477580 typedef long long ll; int main() { int N; cin >> N; int colors[10]; // 8 REP(i, 10) { colors[i] = 0; } int pros = 0; REP(i, N) { int score; cin >> score; if (score >= 3200) { pros += 1; } else { colors[score / 400] += 1; } } int cnum = 0; REP(i, 8) { if (colors[i] > 0) { cnum++; } } int mn = max(cnum, 1); int mx = min(cnum + pros); cout << mn << " " << mx << endl; return 0; }
a.cc: In function 'int main()': a.cc:62:15: error: no matching function for call to 'min(int)' 62 | int mx = min(cnum + pros); | ~~~^~~~~~~~~~~~~ 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: 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, from a.cc:13: /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:62:15: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 62 | int mx = min(cnum + pros); | ~~~^~~~~~~~~~~~~ /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
s537154062
p03695
C++
#include <iostream> #include <algorithm> using namespace std; int a[128],n; bool check(int x,int y){ for(int i=0;i<n;i++){ if(x<=a[i] && a[i]<=y){ return true; } } return false; } main(){ cin >> n; for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); int ans1=0; if(check(1,399)){ ans1++; } if(check(400,799)){ ans1++; } if(check(800,1199)){ ans1++; } if(check(1200,1599)){ ans1++; } if(check(1699,1999)){ ans1++; } if(check(2000,2399)){ ans1++; } if(check(2400,3199)){ ans1++; } int x=n+1; for(int i=-;i<n;i++){ if(a[i]>=3200){ x=i; break; } } cout << ans1 << " " << ans1+(n-x+1) <<endl; }
a.cc:16:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 16 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:48:14: error: expected primary-expression before ';' token 48 | for(int i=-;i<n;i++){ | ^
s951407364
p03695
C++
#include <iostream> #include <algorithm> using namespace std; int a[128],n; bool check(int a,int b){ bool flag=false; for(int i=0;i<n;i++){ if(a<=a[i] && a[i]<=b){ return true; } } return false; } main(){ cin >> n; for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); int ans1=0; if(check(1,399)){ ans1++; } if(check(400,799)){ ans1++; } if(check(800,1199)){ ans1++; } if(check(1200,1599)){ ans1++; } if(check(1699,1999)){ ans1++; } if(check(2000,2399)){ ans1++; } if(check(2400,3199)){ ans1++; } int x=n+1; for(int i=-;i<n;i++){ if(a[i]>=3200){ x=i; break; } } cout << ans1 << " " << ans1+(n-x+1) <<endl; }
a.cc: In function 'bool check(int, int)': a.cc:10:12: error: invalid types 'int[int]' for array subscript 10 | if(a<=a[i] && a[i]<=b){ | ^ a.cc:10:20: error: invalid types 'int[int]' for array subscript 10 | if(a<=a[i] && a[i]<=b){ | ^ a.cc: At global scope: a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 17 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:49:14: error: expected primary-expression before ';' token 49 | for(int i=-;i<n;i++){ | ^
s256099946
p03695
C++
#include <iostream> #include <algorithm> using namespace std; int a[128]; bool check(int a,int b){ bool flag=false; for(int i=0;i<n;i++){ if(a<=a[i] && a[i]<=b){ return true; } } return false; } main(){ int n; cin >> n; for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); int ans1=0; if(check(1,399)){ ans1++; } if(check(400,799)){ ans1++; } if(check(800,1199)){ ans1++; } if(check(1200,1599)){ ans1++; } if(check(1699,1999)){ ans1++; } if(check(2000,2399)){ ans1++; } if(check(2400,3199)){ ans1++; } int x=n+1; for(int i=-;i<n;i++){ if(a[i]>=3200){ x=i; break; } } cout << ans1 << " " << ans1+(n-x+1) <<endl; }
a.cc: In function 'bool check(int, int)': a.cc:9:17: error: 'n' was not declared in this scope 9 | for(int i=0;i<n;i++){ | ^ a.cc:10:12: error: invalid types 'int[int]' for array subscript 10 | if(a<=a[i] && a[i]<=b){ | ^ a.cc:10:20: error: invalid types 'int[int]' for array subscript 10 | if(a<=a[i] && a[i]<=b){ | ^ a.cc: At global scope: a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 17 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:50:14: error: expected primary-expression before ';' token 50 | for(int i=-;i<n;i++){ | ^
s248913175
p03695
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> using namespace std;   int main(){ int n,num; int s[15]={}; cin >> n; for (int i=1; i<=n;i++){ cin >> num; if (1<=num && num<=399) ++s[1]; else if (400<=num && num<=799) ++s[2]; else if (800<=num && num<=1199) ++s[3]; else if (1200<=num && num<=1599) ++s[4]; else if (1600<=num && num<=1999) ++s[5]; else if (2000<=num && num<=2399) ++s[6]; else if (2400<=num && num<=2799) ++ s[7]; else if (2800<=num && num <=3199) ++s[8]; else ++s[9]; } int ans=0; for (int i=1;i<=8;i++) if (s[i]>0) ++ans; if (ans==0) cout << 0; else cout << ans; ans=ans+s[9]; if (ans>8) ans=8; cout << " " << ans; return 0; }
a.cc:6:1: error: extended character   is not valid in an identifier 6 |   | ^ a.cc:6:1: error: '\U000000a0' does not name a type 6 |   | ^
s285907456
p03695
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<sstream> #include<cstdio> #include<ctime> #include<utility> #include<cstdlib> #include<iterator> #include<queue> #include<stack> #define int long long using namespace std; typedef long long llong; typedef unsigned long long ullong; typedef unsigned int uint; const int INF = 9223372036854775806; namespace G { } int rate[] = { 399,799,1199,1599,2399,2799,3199 }; int map[8]{ 0 }; int solve(int n) { if (n <= 399) return 0; else if (n <= 799) return 1; else if (n <= 1199)return 2; else if (n <= 1599) return 3; else if (n <= 2399)return 4; else if (n <= 2799) return 5; else if (n <= 3199) return 6; else return 7; } signed main() { int ans = 0; int n; cin >> n; for (int i = 0; i < n; ++i) { int ngo; int index; cin >> ngo; index = solve(ngo); if ((map[index] == 0) && (index != 7)) { ans += 1; map[index] = 1; } else if (index == 7) { ans += 1; map[index] += 1; } } if (ans - map[7] == 0) cout << 1 << " " << ans << endl; else cout << ans - map[7] << " " << ans << endl; return 0; }
a.cc:19:22: error: conflicting declaration 'typedef long long unsigned int uint' 19 | typedef unsigned int uint; | ^~~~ In file included from /usr/include/stdlib.h:514, from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/x86_64-linux-gnu/sys/types.h:150:22: note: previous declaration as 'typedef unsigned int uint' 150 | typedef unsigned int uint; | ^~~~
s571727773
p03695
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define rFOR(i,a,b) for(int i=a;i>=b;i--) #define rep(i,b) FOR(i,0,b) #define INF 1e9 #define dump(x) cerr<< #x << " = "<<(x)<<endl #define int long long using ll = long long; const ll mod = LLONG_MAX; typedef pair<int,int> P; int a[110]; bool isc[10]; int cnt,ret; signed main(){ int n; cin>>n; rep(i,n)cin>>a[i]; rep(i,n){ if(a[i]<=399)isc[0]=true; else if(a[i]<=799)isc[1]=true; else if(a[i]<=1199)isc[2]=true; else if(a[i]<=1599)isc[3]=true; else if(a[i]<=1999)isc[4]=true; else if(a[i]<=2399)isc[5]=true; else if(a[i]<=2799)isc[6]=true; else if(a[i]<=3199)isc[7]=true; else cnt++; } rep(i,10){ if(isc[i])ret++; } cout<<ret+min(0,(cnt-ret))<<" "<<ret+cnt<<endl; }
a.cc: In function 'int main()': a.cc:39:16: error: no matching function for call to 'min(int, long long int)' 39 | cout<<ret+min(0,(cnt-ret))<<" "<<ret+cnt<<endl; | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:39:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 39 | cout<<ret+min(0,(cnt-ret))<<" "<<ret+cnt<<endl; | ~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:39:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 39 | cout<<ret+min(0,(cnt-ret))<<" "<<ret+cnt<<endl; | ~~~^~~~~~~~~~~~~
s473746703
p03695
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> using namespace std;   int main(){ int n,num; int s[15]={}; cin >> n; for (int i=1; i<=n;i++){ cin >> num; if (1<=num && num<=399) ++s[1]; else if (400<=num && num<=799) ++s[2]; else if (800<=num && num<=1199) ++s[3]; else if (1200<=num && num<=1599) ++s[4]; else if (1600<=num && num<=1999) ++s[5]; else if (2000<=num && num<=2399) ++s[6]; else if (2400<=num && num<=2799) ++ s[7]; else if (2800<=num && num <=3199) ++s[8]; else ++s[9]; } int ans=0; for (int i=1;i<=8;i++) if (s[i]>0) ++ans; if (ans==0) cout << 0; else cout << ans; ans=ans+s[9]; if (ans>8) ans=8; cout << " " << ans; return 0; }
a.cc:6:1: error: extended character   is not valid in an identifier 6 |   | ^ a.cc:6:1: error: '\U000000a0' does not name a type 6 |   | ^
s829858398
p03695
C++
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<sstream> #include<cstdio> #include<ctime> #include<utility> #include<cstdlib> #include<iterator> #include<queue> #include<stack> #define int long long using namespace std; typedef long long llong; typedef unsigned long long ullong; typedef unsigned int uint; const int INF = 9223372036854775806; namespace G { } int rate[] = { 399,799,1199,1599,2399,2799,3199 }; int map[8]{ 0 }; int solve(int n) { if (n <= 399) return 0; else if (n <= 799) return 1; else if (n <= 1199)return 2; else if (n <= 1599) return 3; else if (n <= 2399)return 4; else if (n <= 2799) return 5; else if (n <= 3199) return 6; else return 7; } signed main() { int ans = 0; int n; cin >> n; for (int i = 0; i < n; ++i) { int ngo; int index; cin >> ngo; index = solve(ngo); if ((map[index] == 0) && (index != 7)) { ans += 1; map[index] = 1; } else if (index == 7) { ans += 1; map[index] += 1; } } if (ans - map[7] == 0) cout << 1 << " " << ans << endl; else cout << ans - map[7] << " " << ans << endl; return 0; }
a.cc:20:22: error: conflicting declaration 'typedef long long unsigned int uint' 20 | typedef unsigned int uint; | ^~~~ In file included from /usr/include/stdlib.h:514, from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/x86_64-linux-gnu/sys/types.h:150:22: note: previous declaration as 'typedef unsigned int uint' 150 | typedef unsigned int uint; | ^~~~
s650156446
p03695
Java
package codes; import FastInput.Scanner; import java.io.PrintWriter; public class TaskC { public void solve(int testNumber, Scanner sc, PrintWriter out) { int n = sc.nextInt(); int mask = 0; boolean ok = false; int num = 0; while (n-- > 0) { int rating = sc.nextInt(); if (rating >= 1 && rating <= 399) { mask |= 1; } else if (rating >= 400 && rating <= 799) { mask |= 2; } else if (rating >= 800 && rating <= 1199) { mask |= 4; } else if (rating >= 1200 && rating <= 1599) { mask |= 8; } else if (rating >= 1600 && rating <= 1999) { mask |= 16; } else if (rating >= 2000 && rating <= 2399) { mask |= 32; } else if (rating >= 2400 && rating <= 2799) { mask |= 64; } else if (rating >= 2800 && rating <= 3199) { mask |= 128; } else { num++; ok = true; } } int res = 0; for (int i = 0; i <= 7; i++) if ((mask & (1 << i)) != 0) res++; out.print(ok ? Math.max(0, res) : res); out.println(" " + (ok ? Math.min(8, res + num) : res)); } }
Main.java:6: error: class TaskC is public, should be declared in a file named TaskC.java public class TaskC { ^ Main.java:3: error: package FastInput does not exist import FastInput.Scanner; ^ Main.java:7: error: cannot find symbol public void solve(int testNumber, Scanner sc, PrintWriter out) { ^ symbol: class Scanner location: class TaskC 3 errors
s126439506
p03695
C++
#include <cstdio> #include <algorithm> int main(){ int cnt[8] = {}; int any = 0; int N = 0; int temp = 0; scanf("%d", &N); for(int i=0; i < N; i++){ scanf("%d", &temp); if(temp >= 3200){ any++; }else{ cnt[temp/400]++; } } int mymin = 0; for(int i=0; i < 8; i++){ if(cnt[i] > 0){ mymin++; } } int mymax = 8, mymin + any; if(any == N){ printf("1 %d\n", any); }else{ printf("%d %d\n", mymin, mymax); } return 0; } // when all are over 3200?
a.cc: In function 'int main()': a.cc:25:26: error: expected initializer before '+' token 25 | int mymax = 8, mymin + any; | ^
s353057914
p03695
Java
public class Main { public static int getRank(int val) { if(val <= 399) return 0; if(val <= 799) return 1; if(val <= 1199) return 2; if(val <= 1599) return 3; if(val <= 1999) return 4; if(val <= 2399) return 5; if(val <= 2799) return 6; if(val <= 3199) return 7; return 8; } public static void main(String[] args) { int rankNum = 9; int[] count = new int[rankNum]; Arrays.fill(count, 0); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i=0; i<n; i++) count[getRank(sc.nextInt())]++; sc.close(); int colorNum = 0; for(int i=0; i<count.length - 1; i++) { if(count[i] != 0) colorNum++; } int minColorNum = colorNum; int maxColorNum = (int)Math.min(colorNum+count[count.length-1], rankNum-1); System.out.println(minColorNum + " " + maxColorNum); } }
Main.java:19: error: cannot find symbol Arrays.fill(count, 0); ^ symbol: variable Arrays location: class Main Main.java:21: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:21: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 3 errors
s823791908
p03695
C++
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { long N; cin >> N; vector<bool> flags(8); fill(flags.begin(), flags.end(), false); long fcnt = 0; for (long i = 0; i < N; i++) { long a; cin >> a; long idx = a / 400; if (idx >= 8) { fcnt++; continue; } flags[idx] = true; } long ccnt = 0; for (long i = 0; i < flags.size(); i++) { if (flags[i]) { ccnt++; } } cout << max(ccnt, 1) << ' ' << min(ccnt + fcnt, 8) << endl; return 0; }
a.cc: In function 'int main()': a.cc:34:14: error: no matching function for call to 'max(long int&, int)' 34 | cout << max(ccnt, 1) << ' ' << min(ccnt + fcnt, 8) << endl; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:34:14: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 34 | cout << max(ccnt, 1) << ' ' << min(ccnt + fcnt, 8) << endl; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:34:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 34 | cout << max(ccnt, 1) << ' ' << min(ccnt + fcnt, 8) << endl; | ~~~^~~~~~~~~ a.cc:34:37: error: no matching function for call to 'min(long int, int)' 34 | cout << max(ccnt, 1) << ' ' << min(ccnt + fcnt, 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:34:37: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 34 | cout << max(ccnt, 1) << ' ' << min(ccnt + fcnt, 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:34:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 34 | cout << max(ccnt, 1) << ' ' << min(ccnt + fcnt, 8) << endl; | ~~~^~~~~~~~~~~~~~~~
s948657132
p03695
C++
#include<bits/stdc++.h> using namespace std; int main() { int gg=1000; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--; gg++; gg--;gg++; gg--;v int ra[19]={0}; int n; cin>>n; int i,a[n]; for(i=0;i<n;i++) cin>>a[i]; long long int ex=0; for(i=0;i<n;i++) { if(a[i]>=3200) {ex++;continue;} int z=a[i]/400; ra[z]++; } long long int cnt=0; for(i=0;i<=7;i++) { if(ra[i]!=0) cnt++; } cout<<cnt<<" "<<cnt+ex<<endl; return 0; }
a.cc: In function 'int main()': a.cc:224:53: error: 'v' was not declared in this scope 224 | gg++; gg--;gg++; gg--;v | ^ a.cc:237:9: error: 'ra' was not declared in this scope; did you mean 'a'? 237 | ra[z]++; | ^~ | a a.cc:242:12: error: 'ra' was not declared in this scope; did you mean 'a'? 242 | if(ra[i]!=0) | ^~ | a
s650174981
p03695
C++
#include <iostream> #include <algorithm> using namespace std; bool check(int a,int b){ bool flag=false; for(int i=0;i<n;i++){ if(a<=a[i] && a[i]<=b){ return true; } } return false; } main(){ int n; cin >> n; public : int a[n]; for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); int ans1=0; if(check(1,399)){ ans1++; } if(check(400,799)){ ans1++; } if(check(800,1199)){ ans1++; } if(check(1200,1599)){ ans1++; } if(check(1699,1999)){ ans1++; } if(check(2000,2399)){ ans1++; } if(check(2400,3199)){ ans1++; } int x=n+1; for(int i=-;i<n;i++){ if(a[i]>=3200){ x=i; break; } } cout << ans1 << " " << ans1+(n-x+1) <<endl; }
a.cc: In function 'bool check(int, int)': a.cc:7:17: error: 'n' was not declared in this scope 7 | for(int i=0;i<n;i++){ | ^ a.cc:8:12: error: invalid types 'int[int]' for array subscript 8 | if(a<=a[i] && a[i]<=b){ | ^ a.cc:8:20: error: invalid types 'int[int]' for array subscript 8 | if(a<=a[i] && a[i]<=b){ | ^ a.cc: At global scope: a.cc:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 15 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:18:3: error: expected primary-expression before 'public' 18 | public : | ^~~~~~ a.cc:21:12: error: 'a' was not declared in this scope 21 | cin >> a[i]; | ^ a.cc:23:8: error: 'a' was not declared in this scope 23 | sort(a,a+n); | ^ a.cc:50:14: error: expected primary-expression before ';' token 50 | for(int i=-;i<n;i++){ | ^
s914976406
p03695
C++
#include <iostream> #include <algorithm> using namespace std; bool check(int a,int b){ bool flag=false; for(int i=0;i<n;i++){ if(a<=a[i] && a[i]<=b){ return true; } } return false; } main(){ int n; cin >> n; int a[n]; for(int i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n); int ans1=0; if(check(1,399)){ ans1++; } if(check(400,799)){ ans1++; } if(check(800,1199)){ ans1++; } if(check(1200,1599)){ ans1++; } if(check(1699,1999)){ ans1++; } if(check(2000,2399)){ ans1++; } if(check(2400,3199)){ ans1++; } int x=n+1; for(int i=-;i<n;i++){ if(a[i]>=3200){ x=i; break; } } cout << ans1 << " " << ans1+(n-x+1) <<endl; }
a.cc: In function 'bool check(int, int)': a.cc:7:17: error: 'n' was not declared in this scope 7 | for(int i=0;i<n;i++){ | ^ a.cc:8:12: error: invalid types 'int[int]' for array subscript 8 | if(a<=a[i] && a[i]<=b){ | ^ a.cc:8:20: error: invalid types 'int[int]' for array subscript 8 | if(a<=a[i] && a[i]<=b){ | ^ a.cc: At global scope: a.cc:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 15 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:49:14: error: expected primary-expression before ';' token 49 | for(int i=-;i<n;i++){ | ^
s692997285
p03695
C++
20 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990#include <iostream> #include <algorithm> #include <vector> #include <cstdio> #include <string> #include <set> #include <map> #include <queue> #include <stack> #include <cmath> #include <functional> #include <numeric> #include <iomanip> #define fi first #define se second #define fcout(n) cout<<fixed<<setprecision((n)) #define cinl(str) getline(cin,(str)) using namespace std; bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;} typedef pair<int,int> pii; typedef long long ll; typedef vector<int> vi; typedef vector<long long > vll; typedef vector< vi > vvi; double pie=acos(-1); int INF=1000000007; int dx[4] = { 0,-1,0,1 }; int dy[4] = { -1,0,1,0 }; int main() { int n; int a[5000]; int ans,x[9]; ans=0; for(int i=0;i<9;i++){ x[i]=0; } cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]<400){ x[0]++; } else if(a[i]>=400 && a[i]<800){ x[1]++; } else if(a[i]>=800 && a[i]<1200){ x[2]++; } else if(a[i]>=1200 && a[i]<1600){ x[3]++; } else if(a[i]>=1600 && a[i]<2000){ x[4]++; } else if(a[i]>=2000 && a[i]<2400){ x[5]++; } else if(a[i]>=2400 && a[i]<2800){ x[6]++; } else if(a[i]>=2800 && a[i]<3200){ x[7]++; } else if(a[i]>=3200){ x[8]++; } } for(int i=0;i<9;i++){ if(x[i]>0 && i<8){ ans++; } } cout<<ans<<" "<<ans+x[8]<<endl; }
a.cc:2:80: error: stray '#' in program 2 | 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990#include <iostream> | ^ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 20 | ^~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct
s260831814
p03695
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int N; int a; int ans = 0; bool color[8]; int colorfree = 0; for (int i = 0; i < 8; i++) color[i] = false; cin >> N; for (int i = 0; i < N; i++) { cin >> a; if (a >= 3200) { colorfree++; } else { if (!color[a / 400]) { ans++; color[a / 400] = true; } } } if (colorfree > ans) { cout << colorfree << " " << (ans + colorfree) << endl; return; } cout << ans << " " << (ans + colorfree) << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:17: error: return-statement with no value, in function returning 'int' [-fpermissive] 36 | return; | ^~~~~~
s594836470
p03695
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int N; int a; int ans = 0; bool color[8]; int colorfree = 0; for (int i = 0; i < 8; i++) color[i] = false; cin >> N; for (int i = 0; i < N; i++) { cin >> a; if (a >= 3200) { colorfree++; } else { if (!color[a / 400]) { ans++; color[a / 400] = true; } } } if (colorfree > ans) { cout << colorfree << " " << (ans + colorfree) << endl; return; } cout << ans << " " << (ans + colorfree) << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:17: error: return-statement with no value, in function returning 'int' [-fpermissive] 36 | return; | ^~~~~~
s113508411
p03695
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(); int strong = 0; for(int i = 0; i < N; i++) { int a = sc.nextInt(); int c = -1; if(a < 400) c = 0; if((a >= 400) && (a < 800)) c = 1; if((a >= 800) && (a < 1200)) c = 2; if((a >= 1200) && (a < 1600)) c = 3; if((a >= 1600) && (a < 2000)) c = 4; if((a >= 2000) && (a < 2400)) c = 5; if((a >= 2400) && (a < 2800)) c = 6; if((a >= 2800) && (a < 3200)) c = 7; if(c == -1) strong++; if(map.containsKey(c)) { } else { map.put(c, 1); } } int vari = 0; for(int key : map.keySet()) { vari++; } int min = 0; int max = 0; if(vari == 0) { min = 1; max = Math.min(8, N); } else { min = vari; max = Math.min(8, vari + strong) } System.out.println(min + " " + max); } }
Main.java:37: error: ';' expected max = Math.min(8, vari + strong) ^ 1 error
s955570936
p03695
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(); int strong = 0; for(int i = 0; i < N; i++) { int a = sc.nextInt(); int c = -1; if(a < 400) c = 0; if((a >= 400) && (a < 800)) c = 1; if((a >= 800) && (a < 1200)) c = 2; if((a >= 1200) && (a < 1600)) c = 3; if((a >= 1600) && (a < 2000)) c = 4; if((a >= 2000) && (a < 2400)) c = 5; if((a >= 2400) && (a < 2800)) c = 6; if((a >= 2800) && (a < 3200)) c = 7; if(c == -1) strong++; if(map.containsKey(c)) { } else { map.put(c, 1); } } int vari = 0; for(int key : map.keySet()) { vari++; } int min = 0; int max = 0; if(vari == 0) { min = 1; max = Math.min(8, N); } else { min = vari; max = Math.min(8, vari + strong) } System.out.println(min + " " + max); } }
Main.java:37: error: ';' expected max = Math.min(8, vari + strong) ^ 1 error
s825245478
p03695
C++
#include <bits/stdc++.h> using namespace std; #define int long long main() { int n; int a; int sum = 0; bool kind[10] = {}; cin >> n; for(int i = 0; i < n; i++) { cin >> a; if(a >= 3200) { sum++; } else { kind[a / 400] |= 1; } } int val = 0; for(int i = 0; i < 10; i++) { if(kind[i]) val++; } cout << max(1, val) << " " << val + sum << endl; return (0); }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~ a.cc: In function 'int main()': a.cc:29:14: error: no matching function for call to 'max(int, long long int&)' 29 | cout << max(1, val) << " " << val + sum << 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:29:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 29 | cout << max(1, val) << " " << val + sum << 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:29:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 29 | cout << max(1, val) << " " << val + sum << endl; | ~~~^~~~~~~~
s967092170
p03695
C++
#include <iostream> using namespace std; int main() { vector<int> freq(9, 0); int N; cin>>N; for (int i = 0; i < N; ++i) { int a; cin>>a; freq[a/400]++; } int cnt = 0; for (int i = 0; i <= 7; ++i) if (freq[i]) cnt++; cout<<cnt<<" "<<min(8, cnt+freq[8]); return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: 'vector' was not declared in this scope 5 | vector<int> freq(9, 0); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:5:12: error: expected primary-expression before 'int' 5 | vector<int> freq(9, 0); | ^~~ a.cc:9:9: error: 'freq' was not declared in this scope; did you mean 'free'? 9 | freq[a/400]++; | ^~~~ | free a.cc:14:13: error: 'freq' was not declared in this scope; did you mean 'free'? 14 | if (freq[i]) | ^~~~ | free a.cc:17:32: error: 'freq' was not declared in this scope; did you mean 'free'? 17 | cout<<cnt<<" "<<min(8, cnt+freq[8]); | ^~~~ | free
s236716823
p03695
C++
''' Rating 1-399 : gray Rating 400-799 : brown Rating 800-1199 : green Rating 1200-1599 : cyan Rating 1600-1999 : blue Rating 2000-2399 : yellow Rating 2400-2799 : orange Rating 2800-3199 : red ''' n = int(input()) a = list(map(int, input().split())) st = [0] * 10 extra = 0 for x in a: if x >= 3200: extra += 1 continue for i in range(0, 2801, 400): if i <= x <= i + 399: st[i // 400] = 1 break ans = sum(st) print(ans, min(ans + extra, 8))
a.cc:1:1: error: empty character constant 1 | ''' | ^~ a.cc:1:3: warning: missing terminating ' character 1 | ''' | ^ a.cc:1:3: error: missing terminating ' character a.cc:10:1: error: empty character constant 10 | ''' | ^~ a.cc:10:3: warning: missing terminating ' character 10 | ''' | ^ a.cc:10:3: error: missing terminating ' character a.cc:1:1: error: expected unqualified-id before '\x0' 1 | ''' | ^~
s332063338
p03695
C++
#include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; int main() { int N; cin >> N; map<int, int> mp(9, 0); int a; for (int i=0; i<N; i++) { cin >> a; mp[a/400]++; } int n=0; for (int i=0; i<8; i++) n += (mp[i] > 0) ? 1 : 0; int min = (n > 0) ? n : 1; int max = (n+mp[8] < 8) ? n+mp[8] : 8; cout << min << " " << max << endl; return 0; }
In file included from /usr/include/c++/14/map:63, from a.cc:4: /usr/include/c++/14/bits/stl_map.h: In instantiation of 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]': a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_map.h:287:38: error: no matching function for call to 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::_M_insert_range_unique(int&, int&)' 287 | { _M_t._M_insert_range_unique(__first, __last); } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/map:62: /usr/include/c++/14/bits/stl_tree.h:1096:9: note: candidate: 'template<class _InputIterator> std::__enable_if_t<((bool)std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value)> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_range_unique(_InputIterator, _InputIterator) [with _Key = int; _Val = std::pair<const int, int>; _KeyOfValue = std::_Select1st<std::pair<const int, int> >; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 1096 | _M_insert_range_unique(_InputIterator __first, _InputIterator __last) | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1096:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_tree.h: In substitution of 'template<class _InputIterator> std::__enable_if_t<((bool)std::is_same<std::pair<const int, int>, typename std::iterator_traits< <template-parameter-1-1> >::value_type>::value), void> std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::_M_insert_range_unique(_InputIterator, _InputIterator) [with _InputIterator = int]': /usr/include/c++/14/bits/stl_map.h:287:31: required from 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 287 | { _M_t._M_insert_range_unique(__first, __last); } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_tree.h:1095:58: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1095 | __enable_if_t<__same_value_type<_InputIterator>::value> | ^~~~~ /usr/include/c++/14/bits/stl_map.h: In instantiation of 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]': a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_tree.h:1105:9: note: candidate: 'template<class _InputIterator> std::__enable_if_t<((bool)(! std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value))> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_range_unique(_InputIterator, _InputIterator) [with _Key = int; _Val = std::pair<const int, int>; _KeyOfValue = std::_Select1st<std::pair<const int, int> >; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 1105 | _M_insert_range_unique(_InputIterator __first, _InputIterator __last) | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1105:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_tree.h: In substitution of 'template<class _InputIterator> std::__enable_if_t<((bool)(! std::is_same<std::pair<const int, int>, typename std::iterator_traits< <template-parameter-1-1> >::value_type>::value)), void> std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::_M_insert_range_unique(_InputIterator, _InputIterator) [with _InputIterator = int]': /usr/include/c++/14/bits/stl_map.h:287:31: required from 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 287 | { _M_t._M_insert_range_unique(__first, __last); } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_tree.h:1104:59: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1104 | __enable_if_t<!__same_value_type<_InputIterator>::value> | ^~~~~
s234276833
p03695
C++
#include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; int main() { int N; cin >> N; map<int, int> mp(9, 0); int a; for (int i=0; i<N; i++) { cin >> a; mp[a/400]++; } int n=0; for (int i=0; i<8; i++) n += (mp[i] > 0) ? 1 : 0; int min = (n > 0) ? n : 1; int max = (n+mp[i] < 8) ? n+mp[i] : 8; cout << min << " " << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:21: error: 'i' was not declared in this scope 22 | int max = (n+mp[i] < 8) ? n+mp[i] : 8; | ^ In file included from /usr/include/c++/14/map:63, from a.cc:4: /usr/include/c++/14/bits/stl_map.h: In instantiation of 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]': a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_map.h:287:38: error: no matching function for call to 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::_M_insert_range_unique(int&, int&)' 287 | { _M_t._M_insert_range_unique(__first, __last); } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/map:62: /usr/include/c++/14/bits/stl_tree.h:1096:9: note: candidate: 'template<class _InputIterator> std::__enable_if_t<((bool)std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value)> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_range_unique(_InputIterator, _InputIterator) [with _Key = int; _Val = std::pair<const int, int>; _KeyOfValue = std::_Select1st<std::pair<const int, int> >; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 1096 | _M_insert_range_unique(_InputIterator __first, _InputIterator __last) | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1096:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_tree.h: In substitution of 'template<class _InputIterator> std::__enable_if_t<((bool)std::is_same<std::pair<const int, int>, typename std::iterator_traits< <template-parameter-1-1> >::value_type>::value), void> std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::_M_insert_range_unique(_InputIterator, _InputIterator) [with _InputIterator = int]': /usr/include/c++/14/bits/stl_map.h:287:31: required from 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 287 | { _M_t._M_insert_range_unique(__first, __last); } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_tree.h:1095:58: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1095 | __enable_if_t<__same_value_type<_InputIterator>::value> | ^~~~~ /usr/include/c++/14/bits/stl_map.h: In instantiation of 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]': a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_tree.h:1105:9: note: candidate: 'template<class _InputIterator> std::__enable_if_t<((bool)(! std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value))> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_range_unique(_InputIterator, _InputIterator) [with _Key = int; _Val = std::pair<const int, int>; _KeyOfValue = std::_Select1st<std::pair<const int, int> >; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 1105 | _M_insert_range_unique(_InputIterator __first, _InputIterator __last) | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1105:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_tree.h: In substitution of 'template<class _InputIterator> std::__enable_if_t<((bool)(! std::is_same<std::pair<const int, int>, typename std::iterator_traits< <template-parameter-1-1> >::value_type>::value)), void> std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::_M_insert_range_unique(_InputIterator, _InputIterator) [with _InputIterator = int]': /usr/include/c++/14/bits/stl_map.h:287:31: required from 'std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >]' 287 | { _M_t._M_insert_range_unique(__first, __last); } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ a.cc:10:26: required from here 10 | map<int, int> mp(9, 0); | ^ /usr/include/c++/14/bits/stl_tree.h:1104:59: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1104 | __enable_if_t<!__same_value_type<_InputIterator>::value> | ^~~~~
s228216728
p03695
C++
#include <cstdio> #include <algorithm> #define LL long long #define MOD 1000000007 using namespace std; int n, num, free; bool val[8]; int main(){ scanf("%d",&n); for(int i = 0; i < n; i++ ){ int x; scanf("%d",&x); if(x>=3200) free++; else{ if(val[x/400]) continue; val[x/400] = true; num++; } } printf("%d %d\n",num,min(num+free,8)); return 0; }
a.cc:7:13: error: 'int free' redeclared as different kind of entity 7 | int n, num, free; | ^~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/bits/stl_algo.h:71, from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/stdlib.h:687:13: note: previous declaration 'void free(void*)' 687 | extern void free (void *__ptr) __THROW; | ^~~~ a.cc: In function 'int main()': a.cc:14:29: warning: ISO C++ forbids incrementing a pointer of type 'void (*)(void*) noexcept' [-Wpointer-arith] 14 | if(x>=3200) free++; | ^~~~ a.cc:14:33: error: lvalue required as increment operand 14 | if(x>=3200) free++; | ^~ a.cc:21:37: warning: pointer to a function used in arithmetic [-Wpointer-arith] 21 | printf("%d %d\n",num,min(num+free,8)); | ~~~^~~~~ a.cc:21:33: error: no matching function for call to 'min(void (*)(void*) noexcept, int)' 21 | printf("%d %d\n",num,min(num+free,8)); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60: /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:33: note: deduced conflicting types for parameter 'const _Tp' ('void (*)(void*) noexcept' and 'int') 21 | printf("%d %d\n",num,min(num+free,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:21:33: note: mismatched types 'std::initializer_list<_Tp>' and 'void (*)(void*) noexcept' 21 | printf("%d %d\n",num,min(num+free,8)); | ~~~^~~~~~~~~~~~
s105581194
p03695
C++
// need #include <iostream> #include <algorithm> // data structure #include <bitset> //#include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> //#include <array> //#include <tuple> //#include <unordered_map> //#include <unordered_set> #include <complex> //#include <deque> #include<valarray> // stream //#include <istream> //#include <sstream> //#include <ostream> #include <fstream> // etc #include <cassert> #include <functional> #include <iomanip> //#include <typeinfo> //#include <chrono> #include <random> #include <numeric> #define INIT std::ios::sync_with_stdio(false);std::cin.tie(0); #define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__); template<typename T> void MACRO_VAR_Scan(T& t) { std::cin >> t; } template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest&...rest) { std::cin >> first; MACRO_VAR_Scan(rest...); } #define VEC_ROW(type, n, ...)std::vector<type> __VA_ARGS__;MACRO_VEC_ROW_Init(n, __VA_ARGS__); for(int i=0; i<n; ++i){MACRO_VEC_ROW_Scan(i, __VA_ARGS__);} template<typename T> void MACRO_VEC_ROW_Init(int n, T& t) { t.resize(n); } template<typename First, typename...Rest>void MACRO_VEC_ROW_Init(int n, First& first, Rest&...rest) { first.resize(n); MACRO_VEC_ROW_Init(n, rest...); } template<typename T> void MACRO_VEC_ROW_Scan(int p, T& t) { std::cin >> t[p]; } template<typename First, typename...Rest>void MACRO_VEC_ROW_Scan(int p, First& first, Rest&...rest) { std::cin >> first[p]; MACRO_VEC_ROW_Scan(p, rest...); } #define OUT(d) std::cout<<d; #define FOUT(n, d) std::cout<<std::fixed<<std::setprecision(n)<<d; #define SOUT(n, c, d) std::cout<<std::setw(n)<<std::setfill(c)<<d; #define SP std::cout<<" "; #define TAB std::cout<<"\t"; #define BR std::cout<<"\n"; #define ENDL std::cout<<std::endl; #define FLUSH std::cout<<std::flush; #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i; #define MAT(type, c, m, n) std::vector<std::vector<type>> c(m, std::vector<type>(n));for(auto& r:c)for(auto& i:r)std::cin>>i; #define ALL(a) (a).begin(),(a).end() #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i) #define REP(i, n) for(int i=0;i<int(n);++i) #define RREP(i, n) for(int i=(n)-1;i>=0;--i) #define FORLL(i, a, b) for(ll i=ll(a);i<ll(b);++i) #define RFORLL(i, a, b) for(ll i=ll(b)-1;i>=ll(a);--i) #define REPLL(i, n) for(ll i=0;i<ll(n);++i) #define RREPLL(i, n) for(ll i=ll(n)-1;i>=0;--i) #define PAIR std::pair<int, int> #define PAIRLL std::pair<ll, ll> #define IN(a, x, b) (a<=x && x<b) #define SHOW(d) {std::cerr << #d << "\t:" << d << "\n";} #define SHOWVECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";} #define SHOWVECTOR2(v) {std::cerr << #v << "\t:\n";for(const auto& xxx : v){for(const auto& yyy : xxx){std::cerr << yyy << " ";}std::cerr << "\n";}} #define SHOWPAIR(p) {std::cerr << #p << "\t:(" << p.first << ",\t" << p.second << ")\n";} #define SHOWPAIRVECTOR2(v) {std::cerr << #v << "\t:\n";for(const auto& xxx : v){for(const auto& yyy : xxx){std::cerr<<'('<<yyy.first<<", "<<yyy.second<<") ";}std::cerr << "\n";}} #define SHOWPAIRVECTOR(v) {for(const auto& xxx:v){std::cerr<<'('<<xxx.first<<", "<<xxx.second<<") ";}std::cerr<<"\n";} #define SHOWQUEUE(a) {auto tmp(a);std::cerr << #a << "\t:";while(!tmp.empty()){std::cerr << tmp.front() << " ";tmp.pop();}std::cerr << "\n";} template<typename T> inline T CHMAX(T& a, const T b) { return a = (a < b) ? b : a; } template<typename T> inline T CHMIN(T& a, const T b) { return a = (a > b) ? b : a; } #define EXCEPTION(msg) throw std::string("Exception : " msg " [ in ") + __func__ + " : " + std::to_string(__LINE__) + " lines ]" #define TRY(cond, msg) try {if (cond) EXCEPTION(msg);}catch (std::string s) {std::cerr << s << std::endl;} //void CHECKTIME(std::function<void()> f) { auto start = std::chrono::system_clock::now(); f(); auto end = std::chrono::system_clock::now(); auto res = std::chrono::duration_cast<std::chrono::nanoseconds>((end - start)).count(); std::cerr << "[Time:" << res << "ns (" << res / (1.0e9) << "s)]\n"; } #define int ll using ll = long long; using ull = unsigned long long; constexpr int INFINT = 1 << 30; // 1.07x10^ 9 constexpr int INFINT_LIM = (1LL << 31) - 1; // 2.15x10^ 9 constexpr ll INFLL = 1LL << 60; // 1.15x10^18 constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62); // 9.22x10^18 constexpr double EPS = 1e-7; constexpr int MOD = 1000000007; constexpr double PI = 3.141592653589793238462643383279; signed main() { INIT; VAR(int, n); VEC(int, a, n); std::set<int> set; int cnt = 0; REP(i, n) { int t = a[i]; if (t < 400) set.insert(1); else if (t < 800) set.insert(2); else if (t < 1200) set.insert(3); else if (t < 1600) set.insert(4); else if (t < 2000) set.insert(5); else if (t < 2400) set.insert(6); else if (t < 2800) set.insert(7); else if (t < 3200) set.insert(8); else ++cnt; } int min = std::max((int)set.size(), 1LL); int max = std::min(set.size() + cnt, 8LL); OUT(min)SP OUT(max)BR; return 0; }
a.cc: In function 'int main()': a.cc:112:27: error: no matching function for call to 'min(long long unsigned int, long long int)' 112 | int max = std::min(set.size() + cnt, 8LL); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/c++/14/bits/stl_algobase.h: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:112:27: note: deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'long long int') 112 | int max = std::min(set.size() + cnt, 8LL); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /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:112:27: note: mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int' 112 | int max = std::min(set.size() + cnt, 8LL); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~