submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s527507114
p03694
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]; for(int i=0;i<n;i++){ a[i] = Integer.parseInt(scan.next()); } Arrays.sort(a); System.out.println(a[n-1]-a[0]); } }
Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:9: error: cannot find symbol Arrays.sort(a); ^ symbol: variable Arrays location: class Main 3 errors
s458297675
p03694
Java
import java.util.Scanner; import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import static java.lang.Math.*; public class main implements Runnable{ static ArrayList <Integer> adj[]; static int co=0,f=0; static void Check2(int n){ adj=new ArrayList[n+1]; for(int i=0;i<=n;i++){ adj[i]=new ArrayList<>(); } } static void add(int i,int j){ adj[i].add(j); adj[j].add(i); } public static void main(String[] args) throws Exception { new Thread(null, new main(), "Check2", 1<<26).start();// to increse stack size in java } static long mod=(long)(1e9+7); public void run(){ /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ //Scanner in=new Scanner(System.in); InputReader in=new InputReader(System.in); PrintWriter w=new PrintWriter(System.out); int n=in.nextInt(); int a[]=new int[n]; for(int i=0;i<n;i++){ a[i]=in.nextInt(); } Arrays.sort(a); w.println(a[n-1]-a[0]); w.close(); } static class pair { int x,y; pair(int c,int d){ x=c; y=d; } } static class node{ int y; int val; node(int a,int b){ y=a; val=b; } } static void rec(String s,int a,int b,int n){ if(b==n){ System.out.println(s); return ; } String p=s; if(a>b){ s=p+")" ; rec(s,a,b+1,n); } if(a<n){ s=p+"("; rec(s,a+1,b,n); } } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars==-1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if(numChars <= 0) return -1; } return buf[curChar++]; } public String nextLine() { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } public int nextInt() { int c = read(); while(isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if(c<'0'||c>'9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public double nextDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public String readString() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public String next() { return readString(); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }
Main.java:8: error: class main is public, should be declared in a file named main.java public class main implements Runnable{ ^ Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
s459972615
p03694
C++
#include<stdio.h> int max_main(int,int); int main() { int a[100]; int i,n,t; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); t=max_main(a,n); printf("%d",t); return 0; } int max_main(int a[],int n) { int max,min,m; max=min=a[0]; for(i=0;i<n;i++) { if(a[i]>max) max=a[i]; if(a[i]<min) min=a[i]; } m=max-min; return(m); }
a.cc: In function 'int main()': a.cc:10:16: error: invalid conversion from 'int*' to 'int' [-fpermissive] 10 | t=max_main(a,n); | ^ | | | int* a.cc:2:14: note: initializing argument 1 of 'int max_main(int, int)' 2 | int max_main(int,int); | ^~~ a.cc: In function 'int max_main(int*, int)': a.cc:18:9: error: 'i' was not declared in this scope 18 | for(i=0;i<n;i++) | ^
s127885218
p03694
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; vector<int> a; cin >> N; for (int i = 0; i < N; i++) { int in; cin >> in; a.push_back(in); } sort(a.begin(), a.end()); int answer = a[N-1] - a[0]; cout << answer << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(a.begin(), a.end()); | ^~~~ | short
s410321777
p03694
Java
//Do what you can't. import java.io.*; import java.util.*; import java.math.BigInteger; public class CB064C { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); int n=in.nextInt(); int mn=Integer.MAX_VALUE,mx=Integer.MIN_VALUE; for(int i=0;i<n;i++){int temp=in.nextInt(); mn=Math.min(mn,temp);mx=Math.max(mx,temp);} w.println(mx-mn); w.close(); } static class InputReader { private final InputStream stream; private final byte[] buf = new byte[8192]; private int curChar, snumChars; private SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public int snext() { if (snumChars == -1) throw new InputMismatchException(); if (curChar >= snumChars) { curChar = 0; try { snumChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (snumChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = snext(); while (isSpaceChar(c)) { c = snext(); } int sgn = 1; if (c == '-') { sgn = -1; c = snext(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = snext(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = snext(); while (isSpaceChar(c)) { c = snext(); } int sgn = 1; if (c == '-') { sgn = -1; c = snext(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = snext(); } while (!isSpaceChar(c)); return res * sgn; } public int[] nextIntArray(int n) { int a[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = nextInt(); } return a; } public String readString() { int c = snext(); while (isSpaceChar(c)) { c = snext(); } StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = snext(); } while (!isSpaceChar(c)); return res.toString(); } public String nextLine() { int c = snext(); while (isSpaceChar(c)) c = snext(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = snext(); } while (!isEndOfLine(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } private boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }
Main.java:6: error: class CB064C is public, should be declared in a file named CB064C.java public class CB064C { ^ 1 error
s350042276
p03694
Java
//Do what you can't. import java.io.*; import java.util.*; import java.math.BigInteger; public class CB064C { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); int n=in.nextInt(); int mn=Integer.MAX_VALUE,mx=Integer.MIN_VALUE; for(int i=0;i<n;i++){int temp=in.nextInt(); mn=Math.min(mn,temp);mx=Math.max(mx,temp)} w.println(mx-mn) w.close(); } static class InputReader { private final InputStream stream; private final byte[] buf = new byte[8192]; private int curChar, snumChars; private SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public int snext() { if (snumChars == -1) throw new InputMismatchException(); if (curChar >= snumChars) { curChar = 0; try { snumChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (snumChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = snext(); while (isSpaceChar(c)) { c = snext(); } int sgn = 1; if (c == '-') { sgn = -1; c = snext(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = snext(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = snext(); while (isSpaceChar(c)) { c = snext(); } int sgn = 1; if (c == '-') { sgn = -1; c = snext(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = snext(); } while (!isSpaceChar(c)); return res * sgn; } public int[] nextIntArray(int n) { int a[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = nextInt(); } return a; } public String readString() { int c = snext(); while (isSpaceChar(c)) { c = snext(); } StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = snext(); } while (!isSpaceChar(c)); return res.toString(); } public String nextLine() { int c = snext(); while (isSpaceChar(c)) c = snext(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = snext(); } while (!isEndOfLine(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } private boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }
Main.java:12: error: ';' expected for(int i=0;i<n;i++){int temp=in.nextInt(); mn=Math.min(mn,temp);mx=Math.max(mx,temp)} ^ Main.java:13: error: ';' expected w.println(mx-mn) ^ 2 errors
s851777153
p03694
C++
N = input() a = map(int, raw_input().split()) a.sort() print a[-1] - a[0]
a.cc:1:1: error: 'N' does not name a type 1 | N = input() | ^
s970371633
p03694
C++
#include<stdio.h> #include<conio.h> int a[100]; int main() { int i, n, mx,mn; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &a[i]); } mx= a[0]; mn = a[0]; for (i = 1; i < n; i++) { if (mn > a[i])mn = a[i]; if (mx < a[i])mx = a[i]; } int res=0; res=mx-mn; printf("%d",res); return 0; }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s455177241
p03694
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> a(N); for (int i = 0; i < N; ++i) cin >> a[i]; cout << *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end()) << endl; int sum = accumulate(v.begin(), v.end(), 0); return 0; }
a.cc: In function 'int main()': a.cc:18:26: error: 'v' was not declared in this scope 18 | int sum = accumulate(v.begin(), v.end(), 0); | ^
s390743365
p03694
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <utility> #include <sys/time.h> using namespace std; void solve(vector<int> coo) { int maxcoo = max_element(coo.begin(), coo.end()); int mincoo = min_element(coo.begin(), coo.end()); std::cout << maxcoo - mincoo << std::endl; } int main() { struct timeval start,end; long long span; int t; gettimeofday(&start,NULL); std::cin >> t; vector<int> coo(t); for (int i = 0; i < t; i++) { std::cin >> coo[i]; } solve(coo); gettimeofday(&end,NULL); span = (end.tv_sec -start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec); std::cerr << "--Total Time: " << span/1000 << "ms" << endl; return 0; }
a.cc: In function 'void solve(std::vector<int>)': a.cc:12:29: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization 12 | int maxcoo = max_element(coo.begin(), coo.end()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ | | | __gnu_cxx::__normal_iterator<int*, std::vector<int> > a.cc:13:29: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization 13 | int mincoo = min_element(coo.begin(), coo.end()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ | | | __gnu_cxx::__normal_iterator<int*, std::vector<int> >
s847534877
p03694
C++
input() coordinates = tuple(map(int, input().split())) print(max(coordinates) - min(coordinates))
a.cc:2:1: error: expected constructor, destructor, or type conversion before 'coordinates' 2 | coordinates = tuple(map(int, input().split())) | ^~~~~~~~~~~
s579069293
p03694
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> a(N); for (int i = 0; i < N; ++i) cin >> v[i]; cout << *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end()) << endl; int sum = accumulate(v.begin(), v.end(), 0); return 0; }
a.cc: In function 'int main()': a.cc:15:40: error: 'v' was not declared in this scope 15 | for (int i = 0; i < N; ++i) cin >> v[i]; | ^ a.cc:18:26: error: 'v' was not declared in this scope 18 | int sum = accumulate(v.begin(), v.end(), 0); | ^
s902090926
p03694
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; int t = N -1; int a[t]; for(int c = 0; c < N;c++){ cin >> a[c]; } sort(a); cout << a[t] - a[0] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:17:7: error: no matching function for call to 'sort(int [t])' 17 | sort(a); | ~~~~^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
s788166607
p03694
C
#include <iostream> #include <vector> using namespace std; int main() { vector<int> houses; int n, m; cin >> n; for(int i =0; i < n; ++i){ cin >> m; houses.push_back(m); } sort(houses.begin(), houses.end()); cout << houses[n - 1] - houses[0] << endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s526582490
p03694
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <utility> #include <sys/time.h> using namespace std; void solve(vector<int> coo) { maxcoo = max_element(coo.begin(), coo.end()); mincoo = min_element(coo.begin(), coo.end()); std::cout << maxcoo - mincoo << std::endl; } int main() { struct timeval start,end; long long span; int t; gettimeofday(&start,NULL); std::cin >> t; vector<int> coo(t); for (int i = 0; i < t; i++) { std::cin >> coo[i]; } solve(coo); gettimeofday(&end,NULL); span = (end.tv_sec -start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec); std::cerr << "--Total Time: " << span/1000 << "ms" << endl; return 0; }
a.cc: In function 'void solve(std::vector<int>)': a.cc:12:5: error: 'maxcoo' was not declared in this scope 12 | maxcoo = max_element(coo.begin(), coo.end()); | ^~~~~~ a.cc:13:5: error: 'mincoo' was not declared in this scope 13 | mincoo = min_element(coo.begin(), coo.end()); | ^~~~~~
s237679226
p03694
C++
#include <iostream> #include <vector> using namespace std; int main() { vector<int> houses; int n, m; cin >> n; for(int i =0; i < n; ++i){ cin >> m; houses.push_back(m); } sort(houses.begin(), houses.end()); cout << houses[n - 1] - houses[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(houses.begin(), houses.end()); | ^~~~ | short
s145876788
p03694
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; int t = N -1; int a[t]; for(int c = 0; c < N;c++){ cin >> a[c]; } sort(a.begin(),a.end()); cout << a[t] - a[0] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:17:10: error: request for member 'begin' in 'a', which is of non-class type 'int [t]' 17 | sort(a.begin(),a.end()); | ^~~~~ a.cc:17:20: error: request for member 'end' in 'a', which is of non-class type 'int [t]' 17 | sort(a.begin(),a.end()); | ^~~
s507872144
p03694
C++
#include<cstdio> #include<algorithm> using namespace std; int main() { int t; int arr[101]; scanf("%d",&t); for(int i=0;i<t;i++) { scanf("%d",&arr[i]); } sort(arr); printf("%d\n",arr[t-1]-arr[0]); }
a.cc: In function 'int main()': a.cc:13:5: error: no matching function for call to 'sort(int [101])' 13 | sort(arr); | ~~~~^~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
s028223303
p03694
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; int t = N -1; int a[t]; for(int c = 0; c < N;c++){ cin >> a[c]; } sort(a[0],[t]); cout << a[N -1] - a[0] << "\n"; return 0; }
a.cc: In lambda function: a.cc:17:16: error: expected '{' before ')' token 17 | sort(a[0],[t]); | ^ a.cc: In function 'int main()': a.cc:17:7: error: no matching function for call to 'sort(int&, main()::<lambda()>)' 17 | sort(a[0],[t]); | ~~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed: a.cc:17:7: note: deduced conflicting types for parameter '_RAIter' ('int' and 'main()::<lambda()>') 17 | sort(a[0],[t]); | ~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
s304032982
p03694
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; int t = N -1; int a[t]; for(int c = 0; c < N;c++){ cin >> a[c]; } sort(a.begin(),a.end()); cout << a[N -1] - a[0] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:17:10: error: request for member 'begin' in 'a', which is of non-class type 'int [t]' 17 | sort(a.begin(),a.end()); | ^~~~~ a.cc:17:20: error: request for member 'end' in 'a', which is of non-class type 'int [t]' 17 | sort(a.begin(),a.end()); | ^~~
s417304620
p03694
C++
#include<bits/stdc++.h> using namespace std; int main() { int t; int arr[101]; scanf("%d",&t); for(int i=0;i<t;i++) { scanf("%d",&arr[i]); } sort(arr); printf("%d\n",arr[t-1]-arr[0]); }
a.cc: In function 'int main()': a.cc:12:5: error: no matching function for call to 'sort(int [101])' 12 | sort(arr); | ~~~~^~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
s784198886
p03694
C++
#include <iostream> #include <vector> using namespace std; int main() { vector<int> houses; int n, m; cin >> n; for(int i =0; i < n; ++i){ cin >> m; houses.push_back(m); } sort(houses.begin(), houses.end()); cout << houses[n - 1] - houses[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(houses.begin(), houses.end()); | ^~~~ | short
s015844087
p03694
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; int a[N - 1]; for(int c = 0; c < N,c++){ cin >> a[c]; } sort(a.begin(),a.end()); cout << a[N -1] - a[0] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:13:27: error: expected ';' before ')' token 13 | for(int c = 0; c < N,c++){ | ^ | ; a.cc:17:10: error: request for member 'begin' in 'a', which is of non-class type 'int [(N + -1)]' 17 | sort(a.begin(),a.end()); | ^~~~~ a.cc:17:20: error: request for member 'end' in 'a', which is of non-class type 'int [(N + -1)]' 17 | sort(a.begin(),a.end()); | ^~~
s806547893
p03694
C++
#include<iostream> using namespace std; int main(void){ int n; int a[1001]; int ans; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); ans=a[n-1]-a[0]; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(a,a+n); | ^~~~ | short
s392383048
p03694
C++
#include<bits/stdc++.h> int main() { int t; int arr[101]; scanf("%d",&t); for(int i=0;i<t;i++) { scanf("%d",&arr[i]); } sort(arr); printf("%d\n",arr[t-1]-arr[0]); }
a.cc: In function 'int main()': a.cc:11:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 11 | sort(arr); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~
s359524015
p03694
C++
#include <stdio.h> int main(){ int n; scanf("%d",&n): int min=1001,max=-1,t; while(n--){ scanf("%d",&t); if(t<min) min=t; if(t>max) max=t; } printf("%d\n",max-min); return 0; }
a.cc: In function 'int main()': a.cc:5:19: error: expected ';' before ':' token 5 | scanf("%d",&n): | ^ | ; a.cc:8:21: error: 't' was not declared in this scope 8 | scanf("%d",&t); | ^ a.cc:9:14: error: 'min' was not declared in this scope; did you mean 'main'? 9 | if(t<min) min=t; | ^~~ | main a.cc:10:14: error: 'max' was not declared in this scope 10 | if(t>max) max=t; | ^~~ a.cc:12:19: error: 'max' was not declared in this scope 12 | printf("%d\n",max-min); | ^~~ a.cc:12:23: error: 'min' was not declared in this scope; did you mean 'main'? 12 | printf("%d\n",max-min); | ^~~ | main
s465573887
p03694
C++
#include <stdio.h> int main(){ int n; scanf("%d",&n): int min=1001,max=-1,t; while(n--){ scanf("%d",&t); if(t<min) min=t; if(t>max) max=t; } printf("%d\n",max-min); return 0; }
a.cc: In function 'int main()': a.cc:5:19: error: expected ';' before ':' token 5 | scanf("%d",&n): | ^ | ; a.cc:8:21: error: 't' was not declared in this scope 8 | scanf("%d",&t); | ^ a.cc:9:14: error: 'min' was not declared in this scope; did you mean 'main'? 9 | if(t<min) min=t; | ^~~ | main a.cc:10:14: error: 'max' was not declared in this scope 10 | if(t>max) max=t; | ^~~ a.cc:12:19: error: 'max' was not declared in this scope 12 | printf("%d\n",max-min); | ^~~ a.cc:12:23: error: 'min' was not declared in this scope; did you mean 'main'? 12 | printf("%d\n",max-min); | ^~~ | main
s776611697
p03694
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; int main(void) { int min = INT_MAX, max = 0, n, t; cin >> n; for (int i = 0; i < n; i++) { cin >> t; if (t < min) min = t; if (t > max) max = t; } cout << max - min << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: 'INT_MAX' was not declared in this scope 9 | int min = INT_MAX, max = 0, n, t; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <vector> +++ |+#include <climits> 5 | a.cc:10:16: error: 'n' was not declared in this scope 10 | cin >> n; | ^ a.cc:12:24: error: 't' was not declared in this scope 12 | cin >> t; | ^ a.cc:17:21: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-' 17 | cout << max - min << endl; | ~~~~^~~~~
s696518311
p03694
C++
In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows: 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 Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not. Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of ai. Find the minimum and maximum possible numbers of different colors of the users.
a.cc:1:105: warning: missing terminating ' character 1 | In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows: | ^ a.cc:1:105: error: missing terminating ' character 1 | In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows: | ^~~~~~~~~~~~~~~~~~~~~ a.cc:1:1: error: 'In' does not name a type 1 | In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows: | ^~
s323183340
p03694
C++
#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <set> #include <map> #include <list> #include <queue> #include <stack> #include <deque> #include <vector> #include <bitset> #include <cmath> #include <utility> #define Maxn 100005 #define Maxm 1000005 #define lowbit(x) x&(-x) #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define PI acos(-1.0) #define LL long long #define Inf (1LL<<62) #define inf 0x3f3f3f3f #define input freopen("input.txt","r",stdin) #define output freopen("output.txt","w",stdout) using namespace std; int main() { int arr[1005]; while(cin>>n) { int _min=inf,_max=-1; for(int i=0;i<n;i++) { cin>>arr[i]; _min=min(_min,arr[i]); _max=max(_max,arr[i]); } cout<<_max-_min<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:31:20: error: 'n' was not declared in this scope; did you mean 'yn'? 31 | while(cin>>n) | ^ | yn
s190366402
p03694
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector num; int n; cin>>n; for(int i=0;i<n;i++){ int p; cin>>p; num.push_back(p); } sort(num.begin(),num.end()); cout<<num.back()-num.front(); }
a.cc: In function 'int main()': a.cc:6:9: error: class template argument deduction failed: 6 | vector num; | ^~~ a.cc:6:9: error: no matching function for call to 'vector()' In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: template argument deduction/substitution failed: a.cc:6:9: note: couldn't deduce template parameter '_Tp' 6 | vector num; | ^~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>' 2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 0 provided
s552802394
p03694
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector<int> num; int n; cin>>n; for(int i=0;i<n;i++){ int p; cin>>p; num.push_back(p); } sort(n.begin(),n.end()); cout<<num.back()-num.front(); }
a.cc: In function 'int main()': a.cc:14:9: error: request for member 'begin' in 'n', which is of non-class type 'int' 14 | sort(n.begin(),n.end()); | ^~~~~ a.cc:14:19: error: request for member 'end' in 'n', which is of non-class type 'int' 14 | sort(n.begin(),n.end()); | ^~~
s068517626
p03694
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n;cin>>n; int up=0;low=1001; for(int i=0;i<n;i++){ int t;cin>>t; up=max(up,t); low=min(low,t); } cout<<up-low<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: 'low' was not declared in this scope 8 | int up=0;low=1001; | ^~~
s615119979
p03694
C++
#include <cstdio> #include <algorithm> #include <vector> #include <queue> #include <deque> #include <list> #include <map> #include <set> #include <cmath> #include <cstring> #include <string> #include <bitset> #include <fstream> #include <iomanip> using namespace std; typedef long long ll; typedef double db; typedef vector<int> vi; typedef vector<long long> vll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<double,double> pdd; typedef vector<pii> vii; #define INF 1000000007ll #define PB push_back #define MP make_pair #define X first #define Y second #define Min(a,b) (((a) < (b))?(a):(b)) #define Max(a,b) (((a) > (b))?(a):(b)) #define Abs(a) (((a) > 0)?(a):(-1)*(a)) #define cil(a,b) ( ((a)%(b) == 0)?((a)/(b)):((a)/(b)+1) ) #define SIZE 0 int main() { int n, mn = INF, mx = 0, a; cin >> n; for (int i = 0 ; i < n ; ++i) { cin >> a; mn = Min (mn, a); mx = Max(mx, a); } cout << mx - mn << endl; return 0; }
a.cc: In function 'int main()': a.cc:40:4: error: 'cin' was not declared in this scope 40 | cin >> n; | ^~~ a.cc:15:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 14 | #include <iomanip> +++ |+#include <iostream> 15 | a.cc:46:4: error: 'cout' was not declared in this scope 46 | cout << mx - mn << endl; | ^~~~ a.cc:46:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s315638283
p03694
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector num; int n; cin>>n; for(int i=0;i<n;i++){ int p; cin>>p; num.push_back(p); } sort(n.begin(),n.end()); cout<<num.back()-num.front(); }
a.cc: In function 'int main()': a.cc:6:9: error: class template argument deduction failed: 6 | vector num; | ^~~ a.cc:6:9: error: no matching function for call to 'vector()' In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 0 provided /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: template argument deduction/substitution failed: a.cc:6:9: note: couldn't deduce template parameter '_Tp' 6 | vector num; | ^~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>' 2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 0 provided a.cc:14:9: error: request for member 'begin' in 'n', which is of non-class type 'int' 14 | sort(n.begin(),n.end()); | ^~~~~ a.cc:14:19: error: request for member 'end' in 'n', which is of non-class type 'int' 14 | sort(n.begin(),n.end()); | ^~~
s852844211
p03694
C++
#include <iostream> using namespace std; int main() { int n; cin>>n; int maxi=0,mini=1e9; for(int i=0;i<n;i++) { int a; cin>>a; maxi=max(maxi,a); mini=min(mini,a)); } cout<<maxi-mini<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: expected ';' before ')' token 13 | mini=min(mini,a)); | ^ | ;
s054819543
p03694
C++
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> vec; for (int i = 0; i < N; i++) { int tmp; cin >> tmp; vec.push_back(tmp); } sort(vec.begin(), vec.end()); cout << *max_element(vec.begin(), vec.end()) - *min_element(vec.begin(), vec.end()) << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(vec.begin(), vec.end()); | ^~~~ | short a.cc:16:14: error: 'max_element' was not declared in this scope 16 | cout << *max_element(vec.begin(), vec.end()) - | ^~~~~~~~~~~ a.cc:17:18: error: 'min_element' was not declared in this scope 17 | *min_element(vec.begin(), vec.end()) | ^~~~~~~~~~~
s178169198
p03694
C++
#include <iostream> using namespace std; int main() { int n; cin>>n; int maxi=0,mini=1e9; for(int i=0;i<n;i++) { int a; cin>>a; maxi=max(maxi,a; mini=min(mini,a)); } cout<<maxi-mini<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: expected ')' before ';' token 12 | maxi=max(maxi,a; | ~ ^ | ) a.cc:13:17: error: expected ';' before ')' token 13 | mini=min(mini,a)); | ^ | ;
s201782729
p03694
C++
n = gets.to_i a = gets.split(' ').map(&:to_i) puts a.max - a.min
a.cc:1:1: error: 'n' does not name a type 1 | n = gets.to_i | ^
s418553712
p03694
C++
#include <iostream> #include <vector> #include <cstring> #include <algorithm> using namespace std; int a,b,c; int main() { cin>>n; maxi=0; mini=1001; for(i=1;i<=n;i++) { cin>>x; if(x>maxi) maxi=x; if(x<mini) mini=x; } cout<<maxi-mini<<'\n'; return 0; }
a.cc: In function 'int main()': a.cc:11:10: error: 'n' was not declared in this scope 11 | cin>>n; | ^ a.cc:12:5: error: 'maxi' was not declared in this scope 12 | maxi=0; mini=1001; | ^~~~ a.cc:12:13: error: 'mini' was not declared in this scope 12 | maxi=0; mini=1001; | ^~~~ a.cc:13:9: error: 'i' was not declared in this scope 13 | for(i=1;i<=n;i++) | ^ a.cc:15:14: error: 'x' was not declared in this scope 15 | cin>>x; | ^
s943763078
p03694
C
#include <stdio.h> int main(void){ int min,max; min=10000; max=-1: int kari; int N; scanf("%d",&N); for(int i=0;i<N;i++){ scanf("%d",&kari); if(min>kari)min=kari; if(max<kari)max=kari; } printf("%d",max-min); return 0; }
main.c: In function 'main': main.c:6:11: error: expected ';' before ':' token 6 | max=-1: | ^ | ; main.c:12:21: error: 'kari' undeclared (first use in this function) 12 | scanf("%d",&kari); | ^~~~ main.c:12:21: note: each undeclared identifier is reported only once for each function it appears in
s133546732
p03694
C++
#include <iostream> #include <vector> #include <map> #include <unordered_map> #define ll long long using namespace std; int A[1111]; int main() { int N; cin>>N; for(int i=0;i<N;i++) cin>>A[i]; sort(A,A+N); cout << A[N-1]-A[0] << endl; }
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(A,A+N); | ^~~~ | short
s148057399
p03694
C++
8 3 1 4 1 5 9 2 6
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 8 | ^
s843394966
p03694
C++
#include <iostream> #include <cstdio> #include <vector> using namespace std; const int MAXN = 2e5; const int INF = 1e9 + 7; /* void init(int x, int l, int r) { if (l == r) { tree[x] = INF; } else { int mid = (l + r) / 2; init(x + x, l, mid); init(x+x+1, mid + 1, r); tree[x] = min(tree[x + x], tree[x + x + 1]); } } int get(int x, int l, int r, int tl, int tr) { if (r < tl || tr < l) { return INF; } if (tl <= l && r <= tr) { return tree[x]; } int mid = (l + r) / 2; return min(get(x + x, l, mid, tl, tr), get(x+x+1, mid + 1, r, tl, tr)); } void upd(int x, int l, int r, int pos, int val) { if (l == r) { tree[x] = min(tree[x], val); } else { int mid = (l + r) / 2; if (pos <= mid) { upd(x + x, l, mid, pos, val); } else { upd(x+x+1, mid + 1, r, pos, val); } tree[x ] =min(tree[x + x], tree[x + x +1]); } } */ int main() { int n; scanf("%d", &n); vector<int> v; for (int i = 1; i<= n; i++) { int x; scanf("%d", &x); v.push_back(x); } sort(v.begin(), v.end()); long long ans = 0; for (int i = 1; i < v.size(); i++) { ans += 1ll * (v[i] - v[i - 1]); } cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:52:5: error: 'sort' was not declared in this scope; did you mean 'short'? 52 | sort(v.begin(), v.end()); | ^~~~ | short
s841633241
p03695
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define reps(i,n) for(int i=1;i<(int)(n);i++) typedef long long ll; using namespace std; int main() { ll n,a[110]; cin>>n; rep(i,n)cin>>a[i]; ll cnt[9]={0}; rep(i,n){ if(a[i]>=1&&a[i]<400){ cnt[0]++; }else if(a[i]>=400&&a[i]<800){ cnt[1]++; }else if(a[i]>=800&&a[i]<1200){ cnt[2]++; }else if(a[i]>=1200&&a[i]<1600){ cnt[3]++; }else if(a[i]>=1600&&a[i]<2000){ cnt[4]++; }else if(a[i]>=2000&&a[i]<2400){ cnt[5]++; }else if(a[i]>=2400&&a[i]<2800){ cnt[6]++; }else if(a[i]>=2800&&a[i]<3200){ cnt[7]++; }else if(a[i]>=3200){ cnt[8]++; } } ll m=0; rep(i,8){ if(cnt[i]>0)m++; } cout<<max(1,m)<<" "<<m+cnt[8]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:39:12: error: no matching function for call to 'max(int, ll&)' 39 | cout<<max(1,m)<<" "<<m+cnt[8]<<endl; | ~~~^~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:39:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 39 | cout<<max(1,m)<<" "<<m+cnt[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:39:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 39 | cout<<max(1,m)<<" "<<m+cnt[8]<<endl; | ~~~^~~~~
s300745587
p03695
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = 1; i < (int)(n+1); i++) int main(){ int N; cin>>N; int ans=0; vector<int>A(N); vector<int>B(8); int S=0; rep(i,8){ B[i]=0; } rep(i,N){ cin>>A[i]; if(3200<=A[i]){ S++; } else{ B[A[i]/400]++; } } rep(i,8){ if(B[i]!=0){ ans++; } } cout<<max(ans,1)<<" "<<ans+p<<endl; }
a.cc: In function 'int main()': a.cc:31:32: error: 'p' was not declared in this scope 31 | cout<<max(ans,1)<<" "<<ans+p<<endl; | ^
s441913204
p03695
C++
v#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n-1; i >= 0; i--) #define all(x) x.begin(), x.end() using ll = long long; using pii = pair<int, int>; const int mod = 1e9+7; int main() { int n; cin >> n; int a[n]; set<int> s; int red = 0; rep(i, n) { cin >> a[i]; if (a[i] < 3200) s.insert(a[i] / 400); else red++; } int MIN = min((int)s.size(), 1); int MAX = (int)s.size() + red; printf("%d %d\n", MIN, MAX); }
a.cc:1:2: error: stray '#' in program 1 | v#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include <bits/stdc++.h> | ^ a.cc:7:13: error: 'pair' does not name a type 7 | using pii = pair<int, int>; | ^~~~ a.cc: In function 'int main()': a.cc:12:5: error: 'cin' was not declared in this scope 12 | cin >> n; | ^~~ a.cc:14:5: error: 'set' was not declared in this scope 14 | set<int> s; | ^~~ a.cc:14:9: error: expected primary-expression before 'int' 14 | set<int> s; | ^~~ a.cc:18:26: error: 's' was not declared in this scope 18 | if (a[i] < 3200) s.insert(a[i] / 400); | ^ a.cc:21:24: error: 's' was not declared in this scope 21 | int MIN = min((int)s.size(), 1); | ^ a.cc:21:15: error: 'min' was not declared in this scope; did you mean 'main'? 21 | int MIN = min((int)s.size(), 1); | ^~~ | main a.cc:23:5: error: 'printf' was not declared in this scope 23 | printf("%d %d\n", MIN, MAX); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | v#include <bits/stdc++.h>
s889939138
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; long long a[n], c[9], t = 0; for (long long i = 0; i < 9; i++) c[i] = 0; for (long long i = 0; i < n; i++) { cin >> a[i]; if (a[i] >= 3200) c[8]++; else c[a[i] / 400]++; } for (long long i = 0; i < 8; i++) if (c[i] > 0) t++; cout << max(t, 1) << ' ' << t + c[8]; }
a.cc: In function 'int main()': a.cc:16:16: error: no matching function for call to 'max(long long int&, int)' 16 | cout << max(t, 1) << ' ' << t + c[8]; | ~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:16:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 16 | cout << max(t, 1) << ' ' << t + c[8]; | ~~~^~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:16:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 16 | cout << max(t, 1) << ' ' << t + c[8]; | ~~~^~~~~~
s903565827
p03695
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(ll i=0;i<n;++i) #define ocut cout #define ouct cout #define itn int struct Union{ vector<ll> par; Union(ll a){ par=vector<ll>(a,-1); } ll find(ll a){ if(par[a]<0){ return a; } else{ return par[a]=find(par[a]); } } bool same(ll a,ll b){ return (find(a)==find(b)); } ll size(ll a){ return -par[find(a)]; } void unite(ll a,ll b){ ll c=find(a),d=find(b); if(c==d) return; if(size(c)<size(d)){ swap(c,d); } par[c]+=par[d]; par[d]=c; } }; ll euclidean_gcd(ll a, ll b) { if(a < b) return euclidean_gcd(b, a); ll r; while ((r=a%b)) { a = b; b = r; } return b; } ll euclidean_lcm(ll a, ll b) { return a/euclidean_gcd(a,b)*b; } ll binary(ll bina){ ll ans = 0; for (ll i = 0; bina>0 ; i++) { ans += bina%2; bina = bina/2; } return ans; } void revStr(char* str){ int size = strlen(str); int i,j; char tmp = {0}; for(i = 0, j = size - 1; i < size / 2; i++, j--){ tmp = str[i]; str[i] = str[j]; str[j] = tmp; } return; } int main(void){ ll n; cin >> n; ll a[n],b[13]; rep(i,13){ b[i]=0; } rep(i,n){ cin >> a[i]; b[a[i]/400]++; } ll ans=0; rep(i,8){ if(b[i]>0)ans++; } cout << max(1,ans) << " "; ans=ans+b[8]+b[9]+b[10]+b[11]+b[12]; cout << ans; }
a.cc: In function 'int main()': a.cc:89:14: error: no matching function for call to 'max(int, ll&)' 89 | cout << max(1,ans) << " "; | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:89:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 89 | cout << max(1,ans) << " "; | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:89:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 89 | cout << max(1,ans) << " "; | ~~~^~~~~~~
s773120996
p03695
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N, ans = 0; cin >> N; vector<int> a(N); for(auto& x: a) cin >> x; unordered_map<string,int> mp; for(int i = 0; i < N; ++i){ if ( 1 <= a[i] && a[i] <= 399) ++mp["gray"]; else if( 400 <= a[i] && a[i] <= 799) ++mp["brown"]; else if( 800 <= a[i] && a[i] <= 1199) ++mp["green"]; else if(1200 <= a[i] && a[i] <= 1599) ++mp["mizu"]; else if(1600 <= a[i] && a[i] <= 1999) ++mp["blue"]; else if(2000 <= a[i] && a[i] <= 2399) ++mp["yellow"]; else if(2400 <= a[i] && a[i] <= 2799) ++mp["orange"]; else if(2800 <= a[i] && a[i] <= 3199) ++mp["red"]; else ++mp["over"]; } for(auto x: mp){ if(x.first != "over") ++ans; } if(mp["over"] != 0){ else cout << max(ans,1) << " " << ans + mp["over"] << endl; } else cout << ans << " " << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:25:9: error: expected '}' before 'else' 25 | else cout << max(ans,1) << " " << ans + mp["over"] << endl; | ^~~~ a.cc:24:24: note: to match this '{' 24 | if(mp["over"] != 0){ | ^ a.cc: At global scope: a.cc:27:5: error: expected unqualified-id before 'else' 27 | else cout << ans << " " << ans << endl; | ^~~~ a.cc:28:5: error: expected unqualified-id before 'return' 28 | return 0; | ^~~~~~ a.cc:29:1: error: expected declaration before '}' token 29 | } | ^
s581658965
p03695
C++
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> #define rep(i, f, n) for (int i = (f); i < (int)(n); i++) #define repe(i, f, n) for (int i = (f); i <= (int)(n); i++) #define accum(x) accumulate((x).begin(), (x).end(), 0) using namespace std; using ll = long long; using pint = pair<int, int>; const int COLORS = 8; int main() { int n, a, free = 0; cin >> n; vector<int> v(COLORS); rep(i, 0, n) { cin >> a; int color; if (1 <= a && a <= 399) color = 0; else if (400 <= a && a <= 799) 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 ifggV (2800 <= a && a <= 3199) color = 7; else if (3200 <= a) free++; v[color]++; } int ma = accum(v); int mi = 0; rep(i, 0, COLORS) mi += v[i]; if (free == n) cout << 1 << " " << ma << endl; else cout << mi << " " << ma << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:10: error: 'ifggV' was not declared in this scope 39 | else ifggV (2800 <= a && a <= 3199) | ^~~~~ a.cc:41:5: error: 'else' without a previous 'if' 41 | else if (3200 <= a) | ^~~~
s190424733
p03695
C++
#include<iostream> #include<vector> #include <cmath> #include <map> #include <set> #include <algorithm> #include <string> #define rep(i,n) for (int i= 0;i<(n);++i) using namespace std; typedef long long ll; #define MOD 1000000007 int main() { ll N ; cin >> N ; ll a[N] ; ll lv[9] ; for(ll j = 0 ; j < 9 ; j++ ){ lv[j] = 0 ; } for(ll i = 0 ; i < N ; i++){ cin >> a[i] ; if(a[i] < 400 ) lv[0]++ ; else if(a[i] < 800) lv[1]++ ; else if(a[i] < 1200) lv[2]++ ; else if(a[i] < 1600) lv[3]++ ; else if(a[i] < 2000) lv[4]++ ; else if(a[i] < 2400) lv[5]++ ; else if(a[i] < 2800) lv[6]++ ; else if(a[i] < 3200) lv[7]++ ; else lv[8]++ ; } ll ans = 0 ; for(ll j = 0 ; j < 8 ; j++){ //cout << lv[j] << endl; if(lv[j] > 0){ ans++ ; } } if(ans == 0{ cout << 1 <<" "<< endl; }else{ cout << ans << " " ; } ans += lv[8] ; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:41:16: error: expected ';' before '{' token 41 | if(ans == 0{ | ^ | ; a.cc:43:6: error: expected primary-expression before 'else' 43 | }else{ | ^~~~ a.cc:43:6: error: expected ')' before 'else' 43 | }else{ | ^~~~ | ) a.cc:41:7: note: to match this '(' 41 | if(ans == 0{ | ^
s032673064
p03695
Java
import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); Main m = new Main5(sc); m.solve(); m.show(); sc.close(); } //フィールド Scanner sc; int N; int[] a; int max; int min; //入力 Main(Scanner sc) { this.sc = sc; this.N = sc.nextInt(); a = new int[N]; for (int i=0; i<N; i++) { a[i] = sc.nextInt(); } } //解答処理 private void solve() { HashMap<String,Integer> map = new HashMap<String,Integer>(); for (int i=0; i<N; i++) { int count = 1; String tmp = color(a[i]); if (map.containsKey(tmp)) { count += map.get(tmp); } map.put(tmp, count); } if (!map.containsKey("colorless")) { min = map.size(); max = map.size(); } else { min = map.size()-1; max = min + map.get("colorless"); if (map.size() == 1) { //全員が3200以上の場合 min = map.size(); } } } //a[i]のレートの色を判別するメソッド private String color(int a) { String color = "colorless"; if (1<=a && a<400) { color = "gray"; } else if (400<=a && a<800) { color = "brown"; } else if (800<= a && a<1200) { color ="green"; } else if (1200<=a && a<1600) { color = "ligthBlue"; } else if (1600<=a && a<2000) { color = "blue"; } else if (2000<=a && a<2400) { color = "yellow"; } else if (2400<=a && a<2800) { color = "orange"; } else if (2800<=a && a<3200) { color = "red"; } return color; } //出力 public void show() { System.out.print(min); System.out.print(" "); System.out.print(max); } }
Main.java:7: error: cannot find symbol Main m = new Main5(sc); ^ symbol: class Main5 location: class Main 1 error
s859531000
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n); ++i) int main(void) { int n,c=0; cin>>n; vector<int> color(9,0); rep(i,n){ ll a; cin>>a; if(a<3200) color[a/400]++; else color[8]++; } rep(i,8) if(color[i]) c++; if(c) cout << c; else cout << 1; cout << " " << c+color[8] << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'll' was not declared in this scope 10 | ll a; cin>>a; | ^~ a.cc:10:20: error: 'a' was not declared in this scope 10 | ll a; cin>>a; | ^
s322762648
p03695
C++
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数 int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数 int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗 int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗 int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和 int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和? int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和 //以下long long ver long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} //double double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} typedef pair<int, int> ii; typedef long long ll; typedef vector<ll> vll; typedef pair<ll,ll> pll; #define forr(i,a,b) ; for(int i=(a); i<(b); i++) #define clean(arr,val) memset(arr,val,sizeof(arr)) #define forn(i,n) forr(i,0,n) #define PB push_back typedef vector<int> vi; typedef vector<ii> vii; typedef vector<pll> vpll; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; bool is_prime (int x){ if (x<=1) return false ; for (int i=2 ; i*i<=x ; i++){ if (x%i==0) return false ; } return true; } string alpha = "abcdefghijklmnopqrstuvwxyz" ; string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; bool chmin (int a,int b){ if ( a > b ){ a = b; return true ; } return false ; } bool chmax (int a,int b){ if ( a < b ){ a = b; return true ; } return false ; } #define SORT(c) sort((c).begin(),(c).end()); #define ANS(ans) cout<<(ans)<<endl; string split (string s , ll n , char x){ // n文字目は前の文字列 string a ,b,c,d; a = s; b = s; if ( x == 'f'){ return c = a.erase(n) ; }else if ( x == 'l'){ return d = b.substr(n) ; } } /*CODE START HERE*/ int main() { vector<int> v(9,0); int n; cin >> n; forn(i,n){ int a; cin >> a; if( a/400 >= 8){ v.at(8) ++ ; }else { v.at(a/400) ++ ; } } int ans=0; forn(i,8){ if(v.at(i)>0){ ans ++ ; } } int ans_max = ans + v.at(8) ; SORT(v); if ( v.at(0) >= 3200 ){ ans= 1 } cout << ans << ' ' << ans_max << endl; }
a.cc: In function 'int main()': a.cc:117:11: error: expected ';' before '}' token 117 | ans= 1 | ^ | ; 118 | } | ~ a.cc: In function 'std::string split(std::string, ll, char)': a.cc:93:2: warning: control reaches end of non-void function [-Wreturn-type] 93 | } | ^
s893408030
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define rep(i, a, b) for (int i = a; i < (b); ++i) #define repd(i, a, b) for (int i = a; i >= (b); --i) #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() typedef long long ll; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; int main() { int n; cin >> n; map<int, int> mp; rep(i, 0, n) { int t; cin >> t; mp[t / 400]++; } int min = 0, mmax = 0; rep(i, 0, 9) { if (i == 8) { if (min == 0) { mmax++; min++; } else { mmax += mp[8]; mmax = min(8, mmax); } } else if (mp[i] > 0) { min++; mmax++; } } cout << min << " " << mmax << endl; }
a.cc: In function 'int main()': a.cc:40:27: error: 'min' cannot be used as a function 40 | mmax = min(8, mmax); | ~~~^~~~~~~~~
s477493319
p03695
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <queue> #include <iomanip> #include <map> #include <stack> using namespace std; int main() { int n, num, mi = 0, max = 0; cin >> n; vector <int> a(8); for (int i = 0; i < n; i++) { cin >> num; } for (int i = 0; i < n; i++) { if (num / 400 < 8) { a[num / 400]++; } else { max++; } for (int i = 0; i < 8; i++) { if (a[i] > 0) { mi++; } } if (mi != 0) { cout << mi << " " << mi + max << endl; } else { cout << min(mi, max) << " " << mi + max << endl; } return 0; }
a.cc: In function 'int main()': a.cc:37:2: error: expected '}' at end of input 37 | } | ^ a.cc:11:12: note: to match this '{' 11 | int main() { | ^
s889516866
p03695
C++
#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> #define pi 3.14159265358979323846264338327950L using namespace std; int main() { int N, hai=0, cha=0, midori=0, mizu=0, ao=0, ki=0, daidai=0, aka=0, kin=0, c=0; cin >> N; for (int i=0; i<N; i++) { cin >> a[i]; if (a[i]<400) { hai=hai+1; } else if (a[i]<800) { cha=cha+1; } else if (a[i]<1200) { midori=midori+1; } else if (a[i]<1600) { mizu=mizu+1; } else if (a[i]<2000) { ao=ao+1; } else if (a[i]<2400) { ki=ki+1; } else if (a[i]<2800) { daidai=daidai+1; } else if (a[i]<3200) { aka=aka+1; } else { kin=kin+1; } } if (hai>0) { c=c+1; } if (cha>0) { c=c+1; } if (midori>0) { c=c+1; } if (mizu>0) { c=c+1; } if (ao>0) { c=c+1; } if (ki>0) { c=c+1; } if (daidai>0) { c=c+1; } if (aka>0) { c=c+1; } cout << c << " " << min((c+kin),8) << endl; }
a.cc: In function 'int main()': a.cc:24:12: error: 'a' was not declared in this scope 24 | cin >> a[i]; | ^
s044515179
p03695
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>; template<class T,class U> using umap = unordered_map<T,U>; template<class T> using uset = unordered_set<T>; template<class T> bool ChangeMax(T&a,const T&b){ if(a >= b) return false; a = b; return true; } template<class T> bool ChangeMin(T&a,const T&b){ if(a <= b) return false; a = b; return true; } template<class T, size_t N, class U> void Fill(T (&a)[N], const U&v){ fill((U*)a,(U*)(a+N),v); } template<class T> istream& operator >> (istream&is, vector<T>&v){ for(auto&e:v)is >> e; return is; } int main(){ int n; cin >> n; map<int,int> mp; for(int i = 0; i < n; ++i){ int x; cin >> x; mp[min(x/400,8)]++; } int x = mp.count(8); cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; }
a.cc: In function 'int main()': a.cc:47:14: error: no matching function for call to 'max(std::map<int, int>::size_type, int)' 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:47:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:47:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~ a.cc:47:54: error: no matching function for call to 'min(std::map<int, int>::size_type, int)' 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << 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:47:54: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << 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:47:54: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; | ~~~^~~~~~~~~~~~~~~~~
s527283054
p03695
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>; template<class T,class U> using umap = unordered_map<T,U>; template<class T> using uset = unordered_set<T>; template<class T> bool ChangeMax(T&a,const T&b){ if(a >= b) return false; a = b; return true; } template<class T> bool ChangeMin(T&a,const T&b){ if(a <= b) return false; a = b; return true; } template<class T, size_t N, class U> void Fill(T (&a)[N], const U&v){ fill((U*)a,(U*)(a+N),v); } template<class T> istream& operator >> (istream&is, vector<T>&v){ for(auto&e:v)is >> e; return is; } int main(){ int n; cin >> n; map<int> mp; for(int i = 0; i < n; ++i){ int x; cin >> x; mp[min(x/400,8)]++; } int x = mp.count(8); cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; }
a.cc: In function 'int main()': a.cc:41:10: error: wrong number of template arguments (1, should be at least 2) 41 | map<int> mp; | ^ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:44:7: error: invalid types 'int[const int]' for array subscript 44 | mp[min(x/400,8)]++; | ^ a.cc:46:14: error: request for member 'count' in 'mp', which is of non-class type 'int' 46 | int x = mp.count(8); | ^~~~~ a.cc:47:18: error: request for member 'size' in 'mp', which is of non-class type 'int' 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; | ^~~~ a.cc:47:58: error: request for member 'size' in 'mp', which is of non-class type 'int' 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; | ^~~~ a.cc:47:77: error: request for member 'size' in 'mp', which is of non-class type 'int' 47 | cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl; | ^~~~
s708224352
p03695
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int[] a = new int[n]; for(int i=0; i<a.length; i++){ a[i] = scn.nextInt(); } int gra = 0; int bro = 0; int gre = 0; int ligh = 0; int blu = 0; int yel = 0; int ora = 0; int red = 0; int xxx = 0; int count = 0; for(int i=0; i<a.length; i++){ if(a[i]>0 || a[i]<400){ gra++; if(gra==1) count++; } if(a[i]>=400 || a[i]<800){ bro++; if(bro==1) count++; } if(a[i]>=800 || a[i]<1200){ gre++; if(gre==1) count++; } if(a[i]>=1200 || a[i]<1600){ lith++; if(lith==1) count++; } if(a[i]>=1600 || a[i]<2000){ blu++; if(blu==1) count++; } if(a[i]>=2000 || a[i]<2400){ yel++; if(yel==1) count++; } if(a[i]>=2400 || a[i]<2800){ ora++; if(ora==1) count++; } if(a[i]>=2800 || a[i]<3200){ red++; if(red==1) count++; } if(a[i]>=3200) xxx++; } System.out.println(count,count+xxx); } }
Main.java:35: error: cannot find symbol lith++; ^ symbol: variable lith location: class Main Main.java:36: error: cannot find symbol if(lith==1) count++; ^ symbol: variable lith location: class Main Main.java:56: error: no suitable method found for println(int,int) System.out.println(count,count+xxx); ^ method PrintStream.println() is not applicable (actual and formal argument lists differ in length) method PrintStream.println(boolean) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(char) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(int) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(long) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(float) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(double) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(char[]) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(String) is not applicable (actual and formal argument lists differ in length) method PrintStream.println(Object) is not applicable (actual and formal argument lists differ in length) 3 errors
s667369231
p03695
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int,int> #define fi first #define sc second #define all(x) (x).begin(),(x).end() int color(int n) { if (n < 400) return 1; else if (n < 800) return 2; else if (n < 1200) return 3; else if (n < 1600) return 4; else if (n < 2000) return 5; else if (n < 2400) return 6; else if (n < 2800) return 7; else if (n < 3200) return 8; else return 0; } signed main() { #ifdef _DEBUG // freopen("in" , "r", stdin ); // freopen("out", "w", stdout); #endif ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; set<int> s; int c = 0; for (int i = 1; i <= n; i++) { int t; cin >> t; t = color(t); if (t) s.insert(t); else c++; } cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n'; }
a.cc: In function 'int main()': a.cc:41:14: error: no matching function for call to 'max(long long int, int)' 41 | cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n'; | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:41:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 41 | cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n'; | ~~~^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:41:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 41 | cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n'; | ~~~^~~~~~~~~~~~~~~~~~~
s124269554
p03695
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int,int> #define fi first #define sc second #define all(x) (x).begin(),(x).end() int color(int n) { if (n < 400) return 1; else if (n < 800) return 2; else if (n < 1200) return 3; else if (n < 1600) return 4; else if (n < 2000) return 5; else if (n < 2400) return 6; else if (n < 2800) return 7; else if (n < 3200) return 8; else return 0; } signed main() { #ifdef _DEBUG // freopen("in" , "r", stdin ); // freopen("out", "w", stdout); #endif ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; set<int> s; int c = 0; for (int i = 1; i <= n; i++) { int t; cin >> t; t = color(t); if (t) s.insert(t); else c++; } cout << max(s.size(), 1) << ' ' << s.size() + c << '\n'; }
a.cc: In function 'int main()': a.cc:41:14: error: no matching function for call to 'max(std::set<long long int>::size_type, int)' 41 | cout << max(s.size(), 1) << ' ' << s.size() + c << '\n'; | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: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:41:14: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 41 | cout << max(s.size(), 1) << ' ' << s.size() + c << '\n'; | ~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:41:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 41 | cout << max(s.size(), 1) << ' ' << s.size() + c << '\n'; | ~~~^~~~~~~~~~~~~
s278718981
p03695
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int,int> #define fi first #define sc second #define all(x) (x).begin(),(x).end() int color(int n) { if (n < 400) return 1; else if (n < 800) return 2; else if (n < 1200) return 3; else if (n < 1600) return 4; else if (n < 2000) return 5; else if (n < 2400) return 6; else if (n < 2800) return 7; else if (n < 3200) return 8; else return 0; } signed main() { #ifdef _DEBUG // freopen("in" , "r", stdin ); // freopen("out", "w", stdout); #endif ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; set<int> s; int c = 0; for (int i = 1; i <= n; i++) { int t; cin >> t; t = color(t); if (t) s.insert(t); else c++; } cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n'; }
a.cc: In function 'int main()': a.cc:41:33: error: no matching function for call to 'min(long long unsigned int, long long int)' 41 | cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n'; | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:41:33: note: deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'long long int') 41 | cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n'; | ~~~^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:41:33: note: mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int' 41 | cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n'; | ~~~^~~~~~~~~~~~~~~~~~~
s042707282
p03695
C++
/** * author: FromDihPout * created: 2020-07-29 **/ #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); vector<int> range = {3200, 2800, 2400, 2000, 1600, 1200, 800, 400, 1}; const int COLS = range.size(); int n; cin >> n; vector<int> cnt(COLS); for (int i = 0; i < n; i++) { int x; cin >> x; for (int j = 0; j < COLS; j++) { if (x >= range[j]) { cnt[j]++; break; } } } int unique = 0; for (int i = 1; i < COLS; i++) { unique += cnt[i] > 0; } cout << cnt << endl; cout << max(unique, 1) << ' ' << unique + cnt[0] << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:35:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>') 35 | cout << cnt << endl; | ~~~~ ^~ ~~~ | | | | | std::vector<int> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:6: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<int>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::nullptr_t' 306 | operator<<(nullptr_t) |
s646192953
p03695
C++
#include<bits/stdc++.h> using namespace std; ///Welcome to Nasif's Code #define bug printf("bug\n"); #define bug2(var) cout<<#var<<" "<<var<<endl; #define co(q) cout<<q<<endl; #define all(q) (q).begin(),(q).end() typedef long long int ll; typedef unsigned long long int ull; const int MOD = (int)1e9+7; const int MAX = 1e6; #define pi acos(-1) #define inf 1000000000000000LL #define FastRead ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int main() { FastRead //freopen("output.txt", "w", stdout); int n,ex=0; cin>>n; vector<int>v; for(int i=0; i<n; i++) { int a; cin>>a; v.push_back(a); } set<pair<int,int> >s; sort(v.begin(),v.end()); for(int i=0; i<n; i++) { if(v[i]>=1 && v[i]<=399) { s.insert({1,399}); } if(v[i]>=400 && v[i]<=799) { s.insert({400,799}); } if(v[i]>=800 && v[i]<=1199) { s.insert({800,1199}); } if(v[i]>=1200 && v[i]<=1599) { s.insert({1200,1599}); } if(v[i]>=1600 && v[i]<=1999) { s.insert({1600,1999}); } if(v[i]>=2000 && v[i]<=2399) { s.insert({2000,2399}); } if(v[i]>=2400 && v[i]<=2799) { s.insert({2400,2799}); } if(v[i]>=2800 && v[i]<=3199) { s.insert({2800,3199}); } if(v[i]>=3200) ex++; } int mn,mx; mn=s.size(); mx=s.size(); if(mn==0) mn=1; mx+=ex cout<<mn<<" " <<mx<<endl; return 0; }
a.cc: In function 'int main()': a.cc:73:11: error: expected ';' before 'cout' 73 | mx+=ex | ^ | ; 74 | cout<<mn<<" " <<mx<<endl; | ~~~~
s723810236
p03695
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int r; vector<bool> memo(8); for (int i = 0; i < N; i++) { int a; cin >> a; if (a >= 3200) { r++; } else { int c = 0; while (true) { a -= 400; if (a < 0) { break; } c++; } memo.at(c) = true; } } int ans = 0; for (int i = 0; i < 8; i++) { if (mmeo.at(i)) { ans++; } } cout << ans << endl; if (ans + r >= 8) { cout << 8 << endl; } else { cout << ans + r << endl; } }
a.cc: In function 'int main()': a.cc:29:9: error: 'mmeo' was not declared in this scope; did you mean 'memo'? 29 | if (mmeo.at(i)) { | ^~~~ | memo
s838507093
p03695
C++
#include <iostream> #include <cstdlib> #include <time.h> #include <algorithm> #include <map> #include <queue> #include <stack> #include <vector> #include <array> #include <string> #include <iomanip> #include <cstring> #include <cmath> #include <cstdio> #include <cstdlib> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define mp make_pair #define eb emplace_back #define F first #define S second using namespace std; using namespace __gnu_pbds; typedef long long int ll; typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ost; const ll maxN = 1e7; const ll INF = 1e17; const ll MOD = 1e9 + 7; ll xs[] = {-1, 1, 0, 0, -1, 1, 1, -1}; ll ys[] = {0, 0, -1, 1, -1, 1, -1, 1}; ll segtree[maxN << 2]; ll lazy[maxN << 2]; ll A[maxN]; inline ll left(ll x){ return x << 1; } inline ll right(ll x){ return (x<<1) + 1; } void build(ll node, ll start, ll end){ if(start == end) segtree[node] = A[start]; else{ ll mid = (start + end)/2; build(left(node), start, mid); build(right(node), mid+1, end); segtree[node] = segtree[left(node)] + segtree[right(node)]; } } void update(ll node, ll start, ll end, ll l, ll r, ll val){ if(lazy[node] != 0){ segtree[node] += (end-start+1)*lazy[node]; if(start != end){ lazy[left(node)] += lazy[node]; lazy[right(node)] += lazy[node]; } lazy[node] = 0; } if(start > end or l > start or r < end) return ; else if(start >= l and r >= end){ segtree[node] += val; if(start != end){ lazy[left(node)] += val; lazy[right(node)] += val; } } else{ ll mid=(start + end)/2; update(left(node), start, mid, l, r, val); update(right(node), mid+1, end, l, r, val); segtree[node] = segtree[left(node)] + segtree[right(node)]; } } ll sums(ll node, ll start, ll end, ll l, ll r){ if(lazy[node] != 0){ segtree[node] += (end-start+1)*lazy[node]; if(start != end){ lazy[left(node)] += lazy[node]; lazy[right(node)] += lazy[node]; } lazy[node] = 0; } if(l > end or r < start or start > end) return 0; if(l <= start and r >= end) return segtree[node]; ll mid = (start+end)/2; return sums(left(node), start, mid, l , r) + sums(right(node), mid + 1, end, l , r); } int main(){ cin.sync_with_stdio(false); cin.tie(0); set<ll> ans; ll n; ll k; cin >> n; ll cur = 0; for(ll i=0; i<n;i++){ cin >> k; if(k >= 1 and k<=399) ans.insert(1); else if(k>=400 and k<=799) ans.insert(2); else if(k>799 and k<=1199) ans.insert(3); else if(k>1199 and k<=1599) ans.insert(4); else if(k>1599 and k<=1999) ans.insert(5); else if(k>1999 and k<=2399) ans.insert(6); else if(k>1999 and k<=2799) ans.insert(7); else if(k>=2800 and k<=3199) ans.insert(8); else if(k == 0 or k <= ) cur++; } cout << (ans.size() == 0 ? 1 : ans.size()) << " " << ans.size()+cur; return 0; }
a.cc: In function 'int main()': a.cc:127:40: error: expected primary-expression before ')' token 127 | else if(k == 0 or k <= ) | ^
s409951684
p03695
C++
#include<iostream> #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <iomanip>//setprecision #include<math.h> #include <functional> #include<climits> using namespace std; #define ll long long #define rep(i, n) for(ll i=0; i<(ll)(n); ++i) #define mod 1000000007 vector<ll>to[1000005]; ll dp[2000000]; int gcd(int a, int b) { if (a%b == 0) { return(b); } else { return(gcd(b,a%b)); } } int main(){ ll a,b,d=0,e=0;cin>>a; vector<ll>c(14,0); rep(i,a){ cin>>b; c[b/400]++; } rep(i,8)if(c[i]!=0)d++; rep(i,6)e+=c[i+8]; cout<<max(d,1)<<" "<<d+e; }
a.cc: In function 'int main()': a.cc:48:12: error: no matching function for call to 'max(long long int&, int)' 48 | cout<<max(d,1)<<" "<<d+e; | ~~~^~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:48:12: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 48 | cout<<max(d,1)<<" "<<d+e; | ~~~^~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:4: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:48:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 48 | cout<<max(d,1)<<" "<<d+e; | ~~~^~~~~
s003402532
p03695
C++
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include "bits/stdc++.h" #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update #include <ext/pb_ds/detail/standard_policies.hpp> using namespace std; using namespace __gnu_pbds; #define sim template < class c #define int long long #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...); struct debug { #ifdef LOCAL ~debug() { cerr << '\n'; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; } #else sim dor(const c&) { ris; } #endif }; #define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] " #define fastio ios_base::sync_with_stdio(false);cin.tie(0); typedef tree< pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set; typedef long long ll; const ll MOD = 1e9 + 7 ; const ll N = 2e5 + 10 ; const ll INF = 1e18 + 10 ; signed main(){ fastio int n ; cin >> n ; map<string,int> mp ; int fre = 0 ; for(int i = 0; i < n; i++){ int x ; cin >> x ; if ( x < 400 ){ mp["gray"]++; } else if ( x < 800 ) { mp["brown"]++; } else if ( x < 1200 ) { mp["green"]++; } else if ( x < 1600 ) { mp["cyan"]++; } else if ( x < 2000 ) { mp["blue"]++; } else if ( x < 2400 ) { mp["yellow"]++; } else if ( x < 2800 ) { mp["orange"]++; } else if ( x < 3200 ) { mp["red"]++; } else { fre++ ; } } if ( fre == n ) { cout << 1 << ' ' << min(8LL, fre) << endl; } else{ cout << mp.size() << ' ' << min(8LL, fre + mp.size()) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:86:40: error: no matching function for call to 'min(long long int, long long unsigned int)' 86 | cout << mp.size() << ' ' << min(8LL, fre + mp.size()) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:4: /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:86:40: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int') 86 | cout << mp.size() << ' ' << min(8LL, fre + mp.size()) << 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:86:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 86 | cout << mp.size() << ' ' << min(8LL, fre + mp.size()) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~
s607577343
p03695
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int,int>; int main() { int n; cin >> n; vector<int> rate(8); int red=0; rep(i,n) { int ibuff; cin >> ibuff; if (ibuff<=399) rate.at(0)++; else if (ibuff<=799) rate.at(1)++; else if (ibuff<=1199) rate.at(2)++; else if (ibuff<=1599) rate.at(3)++; else if (ibuff<=1999) rate.at(4)++; else if (ibuff<=2399) rate.at(5)++; else if (ibuff<=2799) rate.at(6)++; else if (ibuff<=3199) rate.at(7)++; else red++; } int zeroCnt=0; int minValue=0, maxValue=0; //ゼロの数を数える rep(i,rate.size()) { if (rate.at(i)==0) zeroCnt++; }  //最小値は現在使用している色の数 if (zeroCnt==rate.size()) { minValue = 1; } else { minValue = rate.size()-zeroCnt; } //最大値は赤色を最大限ちりばめる if (zeroCnt >= red) { if (zeroCnt==8) maxValue = red; else maxValue = minValue + red; } else if (zeroCnt < red) maxValue = 8; cout << minValue << " " << maxValue << endl; return 0; }
a.cc:34:3: error: extended character   is not valid in an identifier 34 |  //最小値は現在使用している色の数 | ^ a.cc: In function 'int main()': a.cc:34:3: error: '\U00003000' was not declared in this scope 34 |  //最小値は現在使用している色の数 | ^~ a.cc:37:7: error: 'else' without a previous 'if' 37 | } else { | ^~~~
s681406817
p03695
C++
#include <bits/stdc++.h> using namespace std; int give_numbers(int x){ int res = 0; while(x >= 0){ res += 1; x -= 400; } return res; } int main(){ int n; cin >> n; vector<int>arr(n); for(int i = 0; i < n; i++){ cin >> arr[i]; } set<int>s; int out_3200 = 0; for(int i = 0; i < n; i++){ if(arr[i] < 3200){ s.insert(give_numbers(arr[i])); }else{ out_3200 += 1; } } int mn = min(8, (int)s.size()); int mx = mn + out_3200 cout << mn << " " << mx << endl; }
a.cc: In function 'int main()': a.cc:41:5: error: expected ',' or ';' before 'cout' 41 | cout << mn << " " << mx << endl; | ^~~~
s421333145
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string,int>; const double PI = acos(-1); string iro(int x){ string color; if(x >= 3200) color = "ziyu"; else if(x >= 2800) color = "aka"; else if(x >= 2400) color = "daidai"; else if(x >= 2000) color = "ki"; else if(x >= 1600) color = "ao"; else if(x >= 1200) color = "mizu"; else if(x >= 800) color = "midori"; else if(x >= 400) color = "tya"; else color = "hai"; return color; } int main() { int n; cin >> n; vector<int> a(n); rep(i,n) cin >> a.at(i); map<string,int> mp; rep(i,n) mp[iro(a.at(i))]++; int max,min; if(mp.count("ziyu")){ if(9-mp.size() >= mp["ziyu"]) max = mp.size()+mp.at["ziyu"]-1; else max = 8; if(mp.size() > 1) min = mp.size()-1; else min = 1; } else{ max = mp.size(); min = mp.size(); } cout << min <<" " << max << endl; }
a.cc: In function 'int main()': a.cc:29:55: error: invalid types '<unresolved overloaded function type>[const char [5]]' for array subscript 29 | if(9-mp.size() >= mp["ziyu"]) max = mp.size()+mp.at["ziyu"]-1; | ^
s960516447
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string,int>; const double PI = acos(-1); string iro(int x){ string color; if(x >= 3200) color = "ziyu"; else if(x >= 2800) color = "aka"; else if(x >= 2400) color = "daidai"; else if(x >= 2000) color = "ki"; else if(x >= 1600) color = "ao"; else if(x >= 1200) color = "mizu"; else if(x >= 800) color = "midori"; else if(x >= 400) color = "tya"; else color = "hai"; return color; } int main() { int n; cin >> n; vector<int> a(n); rep(i,n) cin >> a.at(i); map<string,int> mp; rep(i,n) mp[a.at(i)]++; int max,min; if(mp.count("ziyu")){ if(mp.size() -1 + mp["ziyu"] <= 8) max = mp.size()+mp["ziyu"]-1; else max = 8; if(mp.size() > 1) min = mp.size()-1; else min = 1; } else{ max = mp.size(); min = mp.size(); } cout << min << max << endl; }
a.cc: In function 'int main()': a.cc:26:13: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 26 | rep(i,n) mp[a.at(i)]++; | ^ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~
s413590248
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string,int>; const double PI = acos(-1); string iro(int x){ string color; if(x >= 3200) color = "ziyu"; else if(x >= 2800) color = "aka"; else if(x >= 2400) color = "daidai"; else if(x >= 2000) color = "ki"; else if(x >= 1600) color = "ao"; else if(x >= 1200) color = "mizu"; else if(x >= 800) color = "midori"; else if(x >= 400) color = "tya"; else color = "hai"; return color; } int main() { int n; cin >> n; vector<int> a(n); rep(i,n) cin >> a.at(i); map<string,int> mp; rep(i,n) mp[iro(a.at(i))]++; int max,min; if(mp.count("ziyu")){ if(7-mp.size() >= mp["ziyu"]) max = mp.size()+mp.at["ziyu"]-1; else max = 8; if(mp.size() > 1) min = mp.size()-1; else min = 1; } else{ max = mp.size(); min = mp.size(); } cout << min <<" " << max << endl; }
a.cc: In function 'int main()': a.cc:29:55: error: invalid types '<unresolved overloaded function type>[const char [5]]' for array subscript 29 | if(7-mp.size() >= mp["ziyu"]) max = mp.size()+mp.at["ziyu"]-1; | ^
s502860488
p03695
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string,int>; const double PI = acos(-1); string iro(int x){ string color; if(x >= 3200) color = "ziyu"; else if(x >= 2800) color = "aka"; else if(x >= 2400) color = "daidai"; else if(x >= 2000) color = "ki"; else if(x >= 1600) color = "ao"; else if(x >= 1200) color = "mizu"; else if(x >= 800) color = "midori"; else if(x >= 400) color = "tya"; else color = "hai"; return color; } int main() { int n; cin >> n; vector<int> a(n); rep(i,n) cin >> a.at(i); map<string,int> mp; rep(i,n) mp[a.at(i)]++; int max,min; if(mp.count("ziyu")){ if(7-mp.size() >= mp["ziyu"]) max = mp.size()+mp["ziyu"]-1; else max = 8; if(mp.size() > 1) min = mp.size()-1; else min = 1; } else{ max = mp.size(); min = mp.size(); } cout << min << max << endl; }
a.cc: In function 'int main()': a.cc:26:13: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 26 | rep(i,n) mp[a.at(i)]++; | ^ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:504:34: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'} 504 | operator[](const key_type& __k) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]' 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:524:29: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~
s953157043
p03695
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using ll=long long; using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF=1LL<<60; int n; vector<int> a(110); set<string> rate; int main(){ int free=0; cin>>n; rep(i,n){ cin>>a[i]; if(a[i]<400) rate.insert("gray"); else if(a[i]<800) rate.insert("brown"); else if(a[i]<1200) rate.insert("green"); else if(a[i]<1600) rate.insert("lblue"); else if(a[i]<2000) rate.insert("blue"); else if(a[i]<2400) rate.insert("yellow"); else if(a[i]<2800) rate.insert("orange"); else if(a[i]<3200) rate.insert("red"); else free++; } int minv=max(1,rate.size()); int maxv=minv+free; cout<<minv<<" "<<maxv<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:29:17: error: no matching function for call to 'max(int, std::set<std::__cxx11::basic_string<char> >::size_type)' 29 | int minv=max(1,rate.size()); | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:29:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}) 29 | int minv=max(1,rate.size()); | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:29:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 29 | int minv=max(1,rate.size()); | ~~~^~~~~~~~~~~~~~~
s942882385
p03695
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using ll=long long; using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF=1LL<<60; int n; vector<int> a(110); set<string> rate; int main(){ int free=0; cin>>n; rep(i,n){ cin>>a[i]; if(a[i]<400) rate.insert("gray"); else if(a[i]<800) rate.insert("brown"); else if(a[i]<1200) rate.insert("green"); else if(a[i]<1600) rate.insert("lblue"); else if(a[i]<2000) rate.insert("blue"); else if(a[i]<2400) rate.insert("yellow"); else if(a[i]<2800) rate.insert("orange"); else if(a[i]<3200) rate.insert("red"); else free++; } int minv=max(1,arate.size()); int maxv=minv+free; cout<<minv<<" "<<maxv<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:29:20: error: 'arate' was not declared in this scope; did you mean 'rate'? 29 | int minv=max(1,arate.size()); | ^~~~~ | rate
s229877193
p03695
C++
/** * created: 07.07.2020 18:55:08 **/ #define _GLIBCXX_DEBUG #include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> // using bint = boost::multiprecision::cpp_int; using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define pcnt(bit) __builtin_popcountll(bit) template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;} template<class T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;} const long double pi = acos(-1.0); const int MAX = 1000010; const int INF = 1LL << 60; const int MOD = 1000000007; // const int MOD = 998244353; signed main() { cin.tie(0); ios_base::sync_with_stdio(false); int n; cin >> n; map<int,int> mp; rep(i,n) { int a; cin >> a; if (1 <= a and a < 400) mp[0]++; else if (400 <= a and a < 800) mp[1]++; else if (800 <= a and a < 1200) mp[2]++; else if (1200 <= a and a < 1600) mp[3]++; else if (1600 <= a and a < 2000) mp[4]++; else if (2000 <= a and a < 2400) mp[5]++; else if (2400 <= a and a < 2800) mp[6]++; else if (2800 <= a and a < 3200) mp[7]++; else mp[8]++; } if (!mp.count(8)) cout << mp.size() << " " << mp.size() << endl; else cout << max(mp.size()-1,1) << " " << min(8ll, (int)mp.size() - 1ll + mp[8]) << endl; return 0; }
a.cc: In function 'int main()': a.cc:45:21: error: no matching function for call to 'max(std::__cxx1998::map<long long int, long long int, std::less<long long int>, std::allocator<std::pair<const long long int, long long int> > >::size_type, int)' 45 | else cout << max(mp.size()-1,1) << " " << min(8ll, (int)mp.size() - 1ll + mp[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:5: /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:45:21: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 45 | else cout << max(mp.size()-1,1) << " " << min(8ll, (int)mp.size() - 1ll + mp[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:45:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 45 | else cout << max(mp.size()-1,1) << " " << min(8ll, (int)mp.size() - 1ll + mp[8]) << endl; | ~~~^~~~~~~~~~~~~~~
s540644429
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { const int p = 8; int n; cin >> n; vector<int> num(p + 1, 0); int free = 0; for (int i = 0; i < n; i++) { int a; cin >> a; for (int j = 1; j <= p; j++) { if (400 * (j - 1) <= a && a < 400 * j) { num[j] = 1; } } if (400 * p <= a) free++; } int ans = 0; for (int i = 0; i < p + 1; i++) { if (1 == num[i]) ans++; } cout << ans << " " << ans + free << endl; return 0; }#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { const int p = 8; int n; cin >> n; vector<int> num(p + 1, 0); int free = 0; for (int i = 0; i < n; i++) { int a; cin >> a; for (int j = 1; j <= p; j++) { if (400 * (j - 1) <= a && a < 400 * j) { num[j] = 1; } } if (400 * p <= a) free++; } int ans = 0; for (int i = 0; i < p + 1; i++) { if (1 == num[i]) ans++; } cout << ans << " " << ans + free << endl; return 0; }
a.cc:26:2: error: stray '#' in program 26 | }#include <bits/stdc++.h> | ^ a.cc:26:3: error: 'include' does not name a type 26 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:30:5: error: redefinition of 'int main()' 30 | int main() { | ^~~~ a.cc:5:5: note: 'int main()' previously defined here 5 | int main() { | ^~~~
s458774889
p03695
C++
#include <bits/stdc++.h> using namespace std; int getMin(int min, int &wild){ if (min == 0){ wild--; return 1; }else{ return min; } } int getMax(int min, int wild){ int max = 0; // if (min + wild >= 8){ // max = 8; // }else{ // max = min + wild; // } max = min + wild return max; } int main(){ int n; cin >> n; vector<bool> colors(8, false); int wild = 0; for (int i = 0; i<n; i++){ int a; cin >> a; if (a >= 3200){ wild++; continue; } colors.at(a/400) = true; } int min = 0; int max = 0; for (bool i: colors){ if (i){ min++; } } min = getMin(min, wild); max = getMax(min, wild); cout << min << " " << max << endl; return 0; }
a.cc: In function 'int getMax(int, int)': a.cc:21:21: error: expected ';' before 'return' 21 | max = min + wild | ^ | ; 22 | 23 | return max; | ~~~~~~ a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type] 24 | } | ^
s283485765
p03695
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; using P = pair<int,int>; int main(){ int n; cin >> n; const int NUM_RATE = 9;//レート帯の数 //レートからレート帯の番号を返す関数 auto rate_to_idx = [&](int r){ vector<P> edges; edges.push_back(make_pair(1,399)); edges.push_back(make_pair(400,799)); edges.push_back(make_pair(800,1199)); edges.push_back(make_pair(1200,1599)); edges.push_back(make_pair(1600,1999)); edges.push_back(make_pair(2000,2399)); edges.push_back(make_pair(2400,2799)); edges.push_back(make_pair(2800,3199)); edges.push_back(make_pair(3200,4800)); rep(i,NUM_RATE){ int lower = edges[i].first; int upper = edges[i].second; if(lower<=r&&r<=upper) return i; } }; vector<int> p(NUM_RATE,0);//各レート帯の人数 rep(i,n){ int a; cin >> a; p[rate_to_idx(a)]++; } int zeros = 0;//人がいない色固定レート帯の数 int exist_cols = 0;//人がいる色固定レート帯の数 int strong = p[NUM_RATE-1];//色フリー帯にいる人数 rep(i,NUM_RATE-1){ if(p[i]==0) zeros++; else exist_cols++; } int ans_min = max(exist_cols,1); int ans_max = exist_cols + min(zeros,strong); int ans_max = min(exist_cols + strong,8); printf("%d %d\n",ans_min,ans_max); return 0; }
a.cc: In function 'int main()': a.cc:53:7: error: redeclaration of 'int ans_max' 53 | int ans_max = min(exist_cols + strong,8); | ^~~~~~~ a.cc:52:7: note: 'int ans_max' previously declared here 52 | int ans_max = exist_cols + min(zeros,strong); | ^~~~~~~ a.cc: In lambda function: a.cc:32:3: warning: control reaches end of non-void function [-Wreturn-type] 32 | }; | ^
s598376536
p03695
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-i); } return res;} int main() { cout << fixed << setprecision(10); ll n; cin>>n; ll s[10]={}; ll a; ll ca=0; for(ll i=0; i<n; i++){ cin>>a; if(0<=a&&a<400){ s[0]++;} else if(400<=a&&a<800){ s[1]++;} else if(800<=a&&a<1200){ s[2]++;} else if(1200<=a&&a<1600){ s[3]++;} else if(1600<=a&&a<2000){ s[4]++;} else if(2000<=a&&a<2400){ s[5]++;} else if(2400<=a&&a<2800){ s[6]++;} else if(2800<=a&&a<3200){ s[7]++;} else s[8]++;} for(ll i=0; i<=7; i++){ if(s[i]>0){ ca++;}} cout<<ca<<" "<<min(8,ca+(int)s[8])<<endl;}
a.cc: In function 'int main()': a.cc:49:19: error: no matching function for call to 'min(int, ll)' 49 | cout<<ca<<" "<<min(8,ca+(int)s[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:49:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 49 | cout<<ca<<" "<<min(8,ca+(int)s[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:49:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 49 | cout<<ca<<" "<<min(8,ca+(int)s[8])<<endl;} | ~~~^~~~~~~~~~~~~~~~
s758061018
p03695
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-i); } return res;} int main() { cout << fixed << setprecision(10); ll n; cin>>n; ll s[10]={}; ll a; ll ca=0; for(ll i=0; i<n; i++){ cin>>a; if(0<=a&&a<400){ s[0]++;} else if(400<=a&&a<800){ s[1]++;} else if(800<=a&&a<1200){ s[2]++;} else if(1200<=a&&a<1600){ s[3]++;} else if(1600<=a&&a<2000){ s[4]++;} else if(2000<=a&&a<2400){ s[5]++;} else if(2400<=a&&a<2800){ s[6]++;} else if(2800<=a&&a<3200){ s[7]++;} else s[8]++;} for(ll i=0; i<=7; i++){ if(s[i]>0){ ca++;}} cout<<ca<<" "<<min(8,ca+s[8])<<endl;}
a.cc: In function 'int main()': a.cc:49:19: error: no matching function for call to 'min(int, ll)' 49 | cout<<ca<<" "<<min(8,ca+s[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:49:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 49 | cout<<ca<<" "<<min(8,ca+s[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:49:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 49 | cout<<ca<<" "<<min(8,ca+s[8])<<endl;} | ~~~^~~~~~~~~~~
s153402011
p03695
C++
#include <bits/stdc++.h> using namespace std; #define sws ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define ll long long #define vi vector<int> #define pb push_back #define pii pair<int, int> #define mp make_pair #define ff first #define ss second #define vvi vector<vi> #define all(x) x.begin(), x.end() #define fo(i, n) for( int i = 0; i < n; i++ ) const int INF = 1e9; const ll INFLL = 0x3f3f3f3f3f3f3f3f; const int MOD = 1e9 + 7; int main() { int n; cin >> n; set<string> cores; int cont3200 = 0; vector<string> ratings = {"green", "brown", "green", "cyan", "blue", "yellow", "orange", "red"}; fo(i, n) { int a; cin >> a; a /= 400; if ( a >= 3200 / 400 ) cont3200++; else cores.insert(ratings[a]); } cout << max(1, cores.size()) << " " << min((int) ratings.size(), (int) cores.size() + cont3200) << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:16: error: no matching function for call to 'max(int, std::set<std::__cxx11::basic_string<char> >::size_type)' 37 | cout << max(1, cores.size()) << " " << min((int) ratings.size(), (int) cores.size() + cont3200) << 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:37:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}) 37 | cout << max(1, cores.size()) << " " << min((int) ratings.size(), (int) cores.size() + cont3200) << 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:37:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | cout << max(1, cores.size()) << " " << min((int) ratings.size(), (int) cores.size() + cont3200) << endl; | ~~~^~~~~~~~~~~~~~~~~
s554688842
p03695
C++
#include<bits/stdc++.h> using namespace std; #define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<fixed; cout<<setprecision(12); #define randomINT mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); #define newl cout<<"\n" #define DISP(as) for(auto it : as) cout<<it<<" ";newl; #define all(x) (x).begin(),(x).end() #define mset(x,val) memset(x,val,sizeof(x)) #define newl cout<<"\n" #define pb push_back #define mp make_pair #define f first #define s second #define dline cerr<<"///REACHED///\n"; #define deb1(x) cerr<<#x<<" = "<<x<<'\n'; #define deb2(x,y) cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n'; #define deb3(x,y,z) cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n'; typedef long long ll; typedef long double ld; typedef vector<ll> vll; typedef pair<ll , ll> pll; typedef pair<ld, ld> pld; typedef unordered_map<ll, ll> um; typedef vector<pll> vpll; const ll MAX5 = 1e+5 + 7; const ll MAX7 = 1e+7 + 7; const ll MAXN = MAX7; const ll INF = 0x7f7f7f7f7f7f7f7f; const int INFi = 0x7f7f7f7f; const ll MOD = 1e9 + 7; // <------------- Declare Variables Here ------------> // ll T = 1; ll n, x, k, p; string s, t; ld w; // <------------- Implement Functions Here ----------> // // <------------- Start of main() -------------------> // void MAIN() { cin>>n; vll color(9,0); for(ll i=0;i<n;i++) { cin>>p; if(p <= 399) color[0] = 1; else if(p <= 799) color[1] = 1; else if(p <= 1199) color[2] = 1; else if(p <= 1599) color[3] = 1; else if(p <= 1999) color[4] = 1; else if(p <= 2399) color[5] = 1; else if(p <= 2799) color[6] = 1; else if(p <= 3199) color[7] = 1; else color[8]++; } ll mini = max(min(color[8],1ll),accumulate(color.begin(),color.begin()+8,0)); ll maxi = accumulate(color.begin(),color.begin()+8,0) + color[8]; cout<<mini<<" "<<maxi; } int main() { fastio; randomINT; //cin >> T; while (T--) { MAIN(); } return 0; }
a.cc: In function 'void MAIN()': a.cc:64:22: error: no matching function for call to 'max(const long long int&, int)' 64 | ll mini = max(min(color[8],1ll),accumulate(color.begin(),color.begin()+8,0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:64:22: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 64 | ll mini = max(min(color[8],1ll),accumulate(color.begin(),color.begin()+8,0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /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:64:22: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 64 | ll mini = max(min(color[8],1ll),accumulate(color.begin(),color.begin()+8,0)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s852981867
p03695
C++
#include <bits/std++.h> using namespace std; int rate(int x){ if(x>=1 && x<=399){ return 0; }else if(x>=400 && x<=799){ return 1; }else if(x>=800 && x<=1199){ return 2; }else if(x>=1200 &&x<=1599){ return 3; }else if(x>=1600 && x<=1999){ return 4; }else if(x>=2000 && x<=2399){ return 5; }else if(x>=2400 && x<=2799){ return 6; }else if(x>=2800 && x<=3199){ return 7; }else{ return 8; } } int main() { int N; cin >> N; vector<int> count(9,0); vector<int> a(N); for(int i=0; i<N; i++){ cin >> a[i]; int color; color=rate(a[i]); count[color]++; } int answer=0; for(int i=0; i<8;i++){ if(count[i]!=0){ answer++; } } cout << answer<<" "; cout <<answer+count[8] << endl; }
a.cc:1:10: fatal error: bits/std++.h: No such file or directory 1 | #include <bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s668959197
p03695
Java
import java.util.Scanner; public class ColorfulLeaderBoard { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc=new Scanner(System.in); //コンテストの参加人数 int N=sc.nextInt(); //各参加者のレート数配列 int[] a=new int[N]; //色を数えるための配列 int[] colorCount=new int[8]; //合計色のカウント int sumColor=0; int max=0; int min=0; //自由に色を変更可能な人数をカウント int freeColor=0; //各参加者のレート数と色のカウント for(int i=0;i<N;i++) { a[i]=sc.nextInt(); if(1<=a[i]&&a[i]<399) { //灰色 colorCount[0]=1; }else if(400<=a[i]&&a[i]<=799) { //茶色 colorCount[1]=1; }else if(800<=a[i]&&a[i]<=1199) { //緑色 colorCount[2]=1; }else if(1200<=a[i]&&a[i]<=1599) { //水色 colorCount[3]=1; }else if(1600<=a[i]&&a[i]<=1999) { //青色 colorCount[4]=1; }else if(2000<=a[i]&&a[i]<=2399) { //黄色 colorCount[5]=1; }else if(2400<=a[i]&&a[i]<=2799) { //橙色 colorCount[6]=1; }else if(2800<=a[i]&&a[i]<=3199) { //赤色 colorCount[7]=1; }else if(3200<=a[i]) { //色自由の人 freeColor += 1; } } //何色あるかカウント for(int count:colorCount) { sumColor +=count; } //最大値・最小値を出力 if(freeColor == 0) { System.out.println(sumColor+" "+sumColor); }else { //最小値出力 min = 1; if(sumColor != 0) { min = sumColor; } //最大値出力 sumColor += freeColor; if(sumColor >= 8){ max = 8; }else{ max = sumColor; } System.out.println(min+" "+max); } } }
Main.java:3: error: class ColorfulLeaderBoard is public, should be declared in a file named ColorfulLeaderBoard.java public class ColorfulLeaderBoard { ^ 1 error
s841498234
p03695
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc=new Scanner(System.in); //コンテストの参加人数 int N=sc.nextInt(); //各参加者のレート数配列 int[] a=new int[N]; //色を数えるための配列 int[] colorCount=new int[7]; //合計色のカウント int sumColor=0; int max=0; int min=0; //自由に色を変更可能な人数をカウント int freeColor=0; //各参加者のレート数と色のカウント for(int i=0;i<N;i++) { a[i]=sc.nextInt(); if(1<=a[i]&&a[i]<399) { //灰色 colorCount[0]=1; }else if(400<=a[i]&&a[i]<=799) { //茶色 colorCount[1]=1; }else if(800<=a[i]&&a[i]<=1199) { //緑色 colorCount[2]=1; }else if(1200<=a[i]&&a[i]<=1599) { //水色 colorCount[3]=1; }else if(1600<=a[i]&&a[i]<=1999) { //青色 colorCount[4]=1; }else if(2000<=a[i]&&a[i]<=2399) { //黄色 colorCount[5]=1; }else if(2400<=a[i]&&a[i]<=2799) { //橙色 colorCount[6]=1; }else if(2800<=a[i]&&a[i]<=3199) { //赤色 colorCount[7]=1; }else if(3200<=a[i]) { //色自由の人 freeColor += 1 } } //最大値・最小値を出力 if(freeColor == 0) { System.out.println(sumColor+" "+sumColor); }else { //最小値出力 if(freeColor == 0) { min = 1; }else { min = sumColor; } //最大値出力 if(freeColor+sumColor <= 8){ sumColor += freeColor; } if(sumColor >= 8){ max = 8; }else{ max = sumColor; } System.out.println(min+" "+max); } } }
Main.java:56: error: ';' expected freeColor += 1 ^ 1 error
s909125888
p03695
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> col(9, 0); for(int i = 0; i < n; i++){ int a; cin >> a; col[max(a/400, 8)]++; } int ans = 0; for(int i = 0; i < 8; i++){ if(col[i] != 0) ans++; } int ma = ans + col[8]; ma = min(ma, 8); int mi = max(ans, col[8]); int mi = min(mi, 8); cout << mi << ' ' << ma << endl; }
a.cc: In function 'int main()': a.cc:21:9: error: redeclaration of 'int mi' 21 | int mi = min(mi, 8); | ^~ a.cc:20:9: note: 'int mi' previously declared here 20 | int mi = max(ans, col[8]); | ^~
s611573995
p03695
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; int gy = 0, br = 0, gr = 0, cy = 0, bl = 0, yl = 0, org = 0, r = 0, h = 0; for (int i = 0; i < n; i++) { int x; cin >> x; if(x >= 0 && x <= 399) { gy = 1; } else if(x >= 400 && x <= 799) { br = 1; } else if(x >= 800 && x <= 1199) { gr = 1; } else if(x >= 1200 && x <= 1599) { cy = 1; } else if(x >= 1600 && x <= 1999) { bl = 1; } else if(x >= 2000 && x <= 2399) { yl = 1; } else if(x >= 2400 && x <= 2799) { org = 1; } else if(x >= 2800 && x <= 3199) { r = 1; } else { h++; } } // int y = min(8, h); cout << gy + br + gr + cy + bl + yl + org + r << " " << gy + br + gr + cy + bl + yl + org + r + y << endl; return 0; }
a.cc: In function 'int main()': a.cc:46:101: error: 'y' was not declared in this scope 46 | cout << gy + br + gr + cy + bl + yl + org + r << " " << gy + br + gr + cy + bl + yl + org + r + y << endl; | ^
s076554345
p03695
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> ii; typedef vector<int> vi; typedef vector<ii> vii; #define f first #define s second #define sz(x) (int)x.size() #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define pb push_back #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define F0R(i, a) FOR(i, 0, a) #define ROF(i, a, b) for (int i = (b); i >= (a); i--) #define R0F(i, a) ROF(i, 0, a-1) #define trav(x, a) for (auto& x: a) const int MX = 2e5+5; const int MOD = 1e9+7; const ll INF = 1061109567; // 4557430888798830399LL const ld EPS = 1e-9; const ld PI = acos(-1); ll v[20]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N; cin >> N; F0R(i,N) { ll x; cin >> x; if (x <= 399) v[1]++; else if (x <= 799) v[2]++; else if (x <= 1199) v[3]++; else if (x <= 1599) v[4]++; else if (x <= 1999) v[5]++; else if (x <= 2399) v[6]++; else if (x <= 2799) v[7]++; else if (x <= 3199) v[8]++; else v[10]++; } ii res = {0,0}; FOR(i,1,9) { if (v[i]) res.f++; } res.s = min(8,res.f+v[10]); cout << res.f << " " << res.s << "\n"; }
a.cc: In function 'int main()': a.cc:58:16: error: no matching function for call to 'min(int, ll)' 58 | res.s = min(8,res.f+v[10]); | ~~~^~~~~~~~~~~~~~~ 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:58:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 58 | res.s = min(8,res.f+v[10]); | ~~~^~~~~~~~~~~~~~~ /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:58:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 58 | res.s = min(8,res.f+v[10]); | ~~~^~~~~~~~~~~~~~~
s480681516
p03695
C++
#include <iostream> using names #include <iostream> using namespace std; int main() { int colo[9]={}; int n; cin>>n; int arr[n]; for (int i=0; i<n; i++){ cin >> arr[i]; } for (int i=0; i<n; i++){ for(int j = 0; j <=7;j++){ if(400 * j <=arr[i] && arr[i] < 400 * (j + 1))colo[j]++; } if(arr[i] > 3200)colo[8]++; } int total=0; for (int i=0; i<8; i++){ if (colo[i]>0) total++; } if ( total>0 ) cout << total << ' ' << total+colo[8] << endl; else cout << 1 << ' ' << colo[8] << endl; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'names' 2 | using names | ^~~~~ a.cc: In function 'int main()': a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:25:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 25 | if ( total>0 ) cout << total << ' ' << total+colo[8] << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:25:59: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 25 | if ( total>0 ) cout << total << ' ' << total+colo[8] << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:26:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 26 | else cout << 1 << ' ' << colo[8] << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:26:39: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 26 | else cout << 1 << ' ' << colo[8] << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s403971283
p03695
C++
#ifdef DEBUG #else # pragma GCC optimize("O3,no-stack-protector") # pragma GCC optimize("unroll-loops") # if __cplusplus < 201703L # pragma GCC target("avx") # else # pragma GCC target("avx2") # endif #endif // 実数の場合 // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define _USE_MATH_DEFINES #include <bits/stdc++.h> #define dump(x) cout << x << endl typedef int64_t Int; typedef long double Ld; using namespace std; using Graph = vector<vector<Int>>; const double pi = M_PI; const Int MOD = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); vector<int> c(9); int n; cin >> n; for (int i = 0; i < n; i++) { int a; cin >> a; if (a <= 399) { c[0]++; } else if (a <= 799) { c[1]++; } else if (a <= 1199) { c[2]++; } else if (a <= 1599) { c[3]++; } else if (a <= 1999) { c[4]++; } else if (a <= 2399) { c[5]++; } else if (a <= 2799) { c[6]++; } else if (a <= 3199) { c[7]++; } else { c[8]++; } } int ansmin = 0, ansmax = 0; for (int i = 0; i < 8; i++) { if (c[i] != 0) { ansmin++; } } ansmax += ansmin; if (c[8] != 0) { ansmax += min(8 - ansmin, c[8], 8); } cout << ansmin << ' ' << ansmax << endl; return 0; }
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:19: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:70:22: required from here 70 | ansmax += min(8 - ansmin, c[8], 8); | ~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s710281846
p03695
C++
#include"bits/stdc++.h" #define rep(i, N) for(int i = 0;i < N;i++) typedef long long ll; const int mod = 1e9 + 7; using namespace std; int main(void) { int N; cin >> N; vector<int> a(N); rep(i, N)cin >> a[i]; set<int> s; int x = 0; rep(i, N) { if (a[i] < 399)s.insert(0); else if (a[i] < 799)s.insert(1); else if (a[i] < 1199)s.insert(2); else if (a[i] < 1599)s.insert(3); else if (a[i] < 1999)s.insert(4); else if (a[i] < 2399)s.insert(5); else if (a[i] < 2799)s.insert(6); else if (a[i] < 3199)s.insert(7); else x++; } cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 8) << endl; return 0; }
a.cc: In function 'int main()': a.cc:29:55: error: no matching function for call to 'min(std::set<int>::size_type, int)' 29 | cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 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:29:55: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int') 29 | cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 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:29:55: note: mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int' 29 | cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 8) << endl; | ~~~^~~~~~~~~~~~~~~
s933047444
p03695
C++
#include<bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int>a(N); set<int,int>Set; int ans = 0; for(int i = 0; i < N; i++) { cin >> a[i]; if(a[i]/400 >= 8) { ans++; } else { Set.insert(a[i]/400); } } cout << ans+Set.size() << endl; }
In file included from /usr/include/c++/14/map:62, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = int; _Alloc = std::allocator<int>; key_type = int]': /usr/include/c++/14/bits/stl_tree.h:2169:4: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = int; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = int; _Alloc = std::allocator<int>]' 2169 | = _M_get_insert_unique_pos(_KeyOfValue()(__v)); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = int; _Compare = int; _Alloc = std::allocator<int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<int, int, std::_Identity<int>, int, std::allocator<int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<int>, int>::rebind<int>; typename _Alloc::value_type = int; value_type = int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400); | ~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:2116:42: error: expression cannot be used as a function 2116 | __comp = _M_impl._M_key_compare(__k, _S_key(__x)); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:2127:33: error: expression cannot be used as a function 2127 | if (_M_impl._M_key_compare(_S_key(__j._M_node), __k)) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(_Base_ptr, _Base_ptr, _Arg&&, _NodeGen&) [with _Arg = int; _NodeGen = std::_Rb_tree<int, int, std::_Identity<int>, int, std::allocator<int> >::_Alloc_node; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = int; _Alloc = std::allocator<int>; iterator = std::_Rb_tree<int, int, std::_Identity<int>, int, std::allocator<int> >::iterator; _Base_ptr = std::_Rb_tree_node_base*]': /usr/include/c++/14/bits/stl_tree.h:2174:26: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = int; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = int; _Alloc = std::allocator<int>]' 2174 | return _Res(_M_insert_(__res.first, __res.second, | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ 2175 | _GLIBCXX_FORWARD(_Arg, __v), __an), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = int; _Compare = int; _Alloc = std::allocator<int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<int, int, std::_Identity<int>, int, std::allocator<int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<int>, int>::rebind<int>; typename _Alloc::value_type = int; value_type = int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400); | ~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1824:56: error: expression cannot be used as a function 1824 | || _M_impl._M_key_compare(_KeyOfValue()(__v), | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ 1825 | _S_key(__p))); | ~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(_Const_Link_type) [with _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = int; _Alloc = std::allocator<int>; _Const_Link_type = const std::_Rb_tree_node<int>*]': /usr/include/c++/14/bits/stl_tree.h:2116:47: required from 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = int; _Alloc = std::allocator<int>; key_type = int]' 2116 | __comp = _M_impl._M_key_compare(__k, _S_key(__x)); | ~~~~~~^~~~~ /usr/include/c++/14/bits/stl_tree.h:2169:4: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = int; _Key = int; _Val = int; _KeyOfValue = std::_Identity<int>; _Compare = int; _Alloc = std::allocator<int>]' 2169 | = _M_get_insert_unique_pos(_KeyOfValue()(__v)); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = int; _Compare = int; _Alloc = std::allocator<int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<int, int, std::_Identity<int>, int, std::allocator<int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<int>, int>::rebind<int>; typename _Alloc::value_type = int; value_type = int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400); | ~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:760:23: error: static assertion failed: comparison object must be invocable with two arguments of key type 760 | static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{}, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:760:23: note: 'std::__is_invocable<int&, const int&, const int&>()' evaluates to false
s813186573
p03695
C++
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int N; cin >> N; vector<int>a(N); set<int,int>Set; int ans = 0; for(int i = 0; i < N; i++) { cin >> a[i]; if(a[i]/400LL >= 8LL) { ans++; } else { Set.insert(a[i]/400LL); } } cout << ans+Set.size() << endl; }
In file included from /usr/include/c++/14/map:62, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; key_type = long long int]': /usr/include/c++/14/bits/stl_tree.h:2169:4: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = long long int; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>]' 2169 | = _M_get_insert_unique_pos(_KeyOfValue()(__v)); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = long long int; _Compare = long long int; _Alloc = std::allocator<long long int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<long long int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::rebind<long long int>; typename _Alloc::value_type = long long int; value_type = long long int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400LL); | ~~~~~~~~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:2116:42: error: expression cannot be used as a function 2116 | __comp = _M_impl._M_key_compare(__k, _S_key(__x)); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:2127:33: error: expression cannot be used as a function 2127 | if (_M_impl._M_key_compare(_S_key(__j._M_node), __k)) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(_Base_ptr, _Base_ptr, _Arg&&, _NodeGen&) [with _Arg = long long int; _NodeGen = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::_Alloc_node; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::iterator; _Base_ptr = std::_Rb_tree_node_base*]': /usr/include/c++/14/bits/stl_tree.h:2174:26: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = long long int; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>]' 2174 | return _Res(_M_insert_(__res.first, __res.second, | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ 2175 | _GLIBCXX_FORWARD(_Arg, __v), __an), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = long long int; _Compare = long long int; _Alloc = std::allocator<long long int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<long long int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::rebind<long long int>; typename _Alloc::value_type = long long int; value_type = long long int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400LL); | ~~~~~~~~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1824:56: error: expression cannot be used as a function 1824 | || _M_impl._M_key_compare(_KeyOfValue()(__v), | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ 1825 | _S_key(__p))); | ~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(_Const_Link_type) [with _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; _Const_Link_type = const std::_Rb_tree_node<long long int>*]': /usr/include/c++/14/bits/stl_tree.h:2116:47: required from 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; key_type = long long int]' 2116 | __comp = _M_impl._M_key_compare(__k, _S_key(__x)); | ~~~~~~^~~~~ /usr/include/c++/14/bits/stl_tree.h:2169:4: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = long long int; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>]' 2169 | = _M_get_insert_unique_pos(_KeyOfValue()(__v)); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = long long int; _Compare = long long int; _Alloc = std::allocator<long long int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<long long int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::rebind<long long int>; typename _Alloc::value_type = long long int; value_type = long long int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400LL); | ~~~~~~~~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:760:23: error: static assertion failed: comparison object must be invocable with two arguments of key type 760 | static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{}, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:760:23: note: 'std::__is_invocable<long long int&, const long long int&, const long long int&>()' evaluates to false
s035913406
p03695
C++
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int N; cin >> N; vector<int>a(N); set<int,int>Set; int ans = 0; for(int i = 0; i < N; i++) { cin >> a[i]; if(a[i]/400 >= 8) { ans++; } else { Set.insert(a[i]/400); } } cout << ans+Set.size() << endl; }
In file included from /usr/include/c++/14/map:62, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; key_type = long long int]': /usr/include/c++/14/bits/stl_tree.h:2169:4: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = long long int; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>]' 2169 | = _M_get_insert_unique_pos(_KeyOfValue()(__v)); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = long long int; _Compare = long long int; _Alloc = std::allocator<long long int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<long long int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::rebind<long long int>; typename _Alloc::value_type = long long int; value_type = long long int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400); | ~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:2116:42: error: expression cannot be used as a function 2116 | __comp = _M_impl._M_key_compare(__k, _S_key(__x)); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:2127:33: error: expression cannot be used as a function 2127 | if (_M_impl._M_key_compare(_S_key(__j._M_node), __k)) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(_Base_ptr, _Base_ptr, _Arg&&, _NodeGen&) [with _Arg = long long int; _NodeGen = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::_Alloc_node; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::iterator; _Base_ptr = std::_Rb_tree_node_base*]': /usr/include/c++/14/bits/stl_tree.h:2174:26: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = long long int; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>]' 2174 | return _Res(_M_insert_(__res.first, __res.second, | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ 2175 | _GLIBCXX_FORWARD(_Arg, __v), __an), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = long long int; _Compare = long long int; _Alloc = std::allocator<long long int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<long long int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::rebind<long long int>; typename _Alloc::value_type = long long int; value_type = long long int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400); | ~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1824:56: error: expression cannot be used as a function 1824 | || _M_impl._M_key_compare(_KeyOfValue()(__v), | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ 1825 | _S_key(__p))); | ~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(_Const_Link_type) [with _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; _Const_Link_type = const std::_Rb_tree_node<long long int>*]': /usr/include/c++/14/bits/stl_tree.h:2116:47: required from 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>; key_type = long long int]' 2116 | __comp = _M_impl._M_key_compare(__k, _S_key(__x)); | ~~~~~~^~~~~ /usr/include/c++/14/bits/stl_tree.h:2169:4: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = long long int; _Key = long long int; _Val = long long int; _KeyOfValue = std::_Identity<long long int>; _Compare = long long int; _Alloc = std::allocator<long long int>]' 2169 | = _M_get_insert_unique_pos(_KeyOfValue()(__v)); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_set.h:523:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = long long int; _Compare = long long int; _Alloc = std::allocator<long long int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, long long int, std::allocator<long long int> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<long long int>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::rebind<long long int>; typename _Alloc::value_type = long long int; value_type = long long int]' 523 | _M_t._M_insert_unique(std::move(__x)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ a.cc:16:23: required from here 16 | Set.insert(a[i]/400); | ~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:760:23: error: static assertion failed: comparison object must be invocable with two arguments of key type 760 | static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{}, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:760:23: note: 'std::__is_invocable<long long int&, const long long int&, const long long int&>()' evaluates to false
s954848442
p03695
C++
using namespace std; using ll = long long int; using pii = pair<int, int>; #define _GLIBCXX_DEBUG #define rep(i,n) for(int i=0; i<(int)(n); i++) ll GCD(ll c, ll d){ if(c<d)swap(c,d); if(c%d==0)return d; else{return GCD(c%d,d);} } int main() { int n;cin>>n; vector<int> v(n); rep(i,n){ cin>>v.at(i); v.at(i)/=400; } set<int> s; int c=0; rep(i,n){ if(v.at(i)==8){c++;} else{s.insert(v.at(i));} } int count=s.size(); cout<<max(c,count)<<" "<<min(count+c,8); }
a.cc:3:13: error: 'pair' does not name a type 3 | using pii = pair<int, int>; | ^~~~ a.cc: In function 'll GCD(ll, ll)': a.cc:8:10: error: 'swap' was not declared in this scope 8 | if(c<d)swap(c,d); | ^~~~ a.cc: In function 'int main()': a.cc:14:9: error: 'cin' was not declared in this scope 14 | int n;cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:15:3: error: 'vector' was not declared in this scope 15 | vector<int> v(n); | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | using namespace std; a.cc:15:10: error: expected primary-expression before 'int' 15 | vector<int> v(n); | ^~~ a.cc:18:10: error: 'v' was not declared in this scope 18 | cin>>v.at(i); | ^ a.cc:22:3: error: 'set' was not declared in this scope 22 | set<int> s; | ^~~ a.cc:1:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>' +++ |+#include <set> 1 | using namespace std; a.cc:22:7: error: expected primary-expression before 'int' 22 | set<int> s; | ^~~ a.cc:25:8: error: 'v' was not declared in this scope 25 | if(v.at(i)==8){c++;} | ^ a.cc:26:10: error: 's' was not declared in this scope 26 | else{s.insert(v.at(i));} | ^ a.cc:28:13: error: 's' was not declared in this scope 28 | int count=s.size(); | ^ a.cc:29:3: error: 'cout' was not declared in this scope 29 | cout<<max(c,count)<<" "<<min(count+c,8); | ^~~~ a.cc:29:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:29:9: error: 'max' was not declared in this scope 29 | cout<<max(c,count)<<" "<<min(count+c,8); | ^~~ a.cc:29:28: error: 'min' was not declared in this scope; did you mean 'main'? 29 | cout<<max(c,count)<<" "<<min(count+c,8); | ^~~ | main
s180662168
p03695
C++
// https://ei1333.github.io/luzhiled/ // http://beet-aizu.hatenablog.com/entry/2017/01/04/113233 // http://www.prefield.com/algorithm/ #include <bits/stdc++.h> constexpr char bn = '\n'; using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vd = vector<ld>; using vs = vector<string>; using vb = vector<bool>; using vvl = vector<vector<ll>>; using vvd = vector<vector<ld>>; using vvs = vector<vector<string>>; using vvb = vector<vector<bool>>; #define pb push_back #define eb emplace_back #define fi first #define se second template<class T> using vc = vector<T>; template<class T> using vvc = vector<vector<T>>; using Graph = vector<vector<ll>>; const ll INF = 1LL << 60; void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);} const ll tl= 1000000007; #define REP(i, n) for (ll i = 0; i < n; i++) #define REREP(i, n) for (ll i = n; i >= 0; i--) #define FOR(i, a, n) for (ll i = a; i < n; i++) #define REFOR(i, n, a) for (ll i = n; i >= a; i--) #define CLR(mat,f) memset(mat, f, sizeof(mat)) #define IN(a, b, x) (a<=x&&x<=b) #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除 #define debug cout << "line : " << __LINE__ << " debug" << endl; #define ini(...) int __VA_ARGS__; in(__VA_ARGS__) #define inl(...) long long __VA_ARGS__; in(__VA_ARGS__) #define ind(...) long double __VA_ARGS__; in(__VA_ARGS__) #define ins(...) string __VA_ARGS__; in(__VA_ARGS__) #define inc(...) char __VA_ARGS__; in(__VA_ARGS__) void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);} void out(){cout << endl;} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);} template<typename T>void die(T x){out(x); exit(0);} #define in1(A) REP(i,A.size()) in(A[i]); #define in2(A,B) REP(i,A.size()) in(A[i],B[i]); #define in3(s,t,u) REP(i,sz(s)){in(s[i] , t[i] , u[i]);} #define in4(s,t,u,v) REP(i,sz(s)){in(s[i] , t[i] , u[i] , v[i]);} #define each(x,v) for(auto& x : v) #define all(v) (v).begin(),(v).end() #define sz(v) ((int)(v).size()) struct Point{ ld x,y; }; ld dist(Point a, Point b){return sqrt(abs(a.x-b.x)*abs(a.x-b.x)+abs(a.y-b.y)*abs(a.y-b.y));} // 2点間の距離 ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; } ll lcm(ll a,ll b){ return a / gcd(a,b) * b;} ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } ll fact(ll n){ if(n < 2) return 1; return (n * fact(n-1))%tl; } //階乗 inline ll updiv(ll a,ll b){ return (a + b - 1) / b; } //切り上げ template<typename T,typename U>ll ceil(T a,U b){return (a + b - 1) / b;} template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } #define YES(n) ((n) ? "YES" : "NO" ) #define Yes(n) ((n) ? "Yes" : "No" ) #define yes(n) ((n) ? "yes" : "no" ) //------------------------------------------------------------------------------------------------- int main(){ init(); ll ans= 0; ll ad=0; inl(n); vl A(n); in1(A); map<ll,ll>T; T[9]=1; REP(i,n){ if(IN(1,399,A[i])){ T[1]++; }else if(IN(400,799,A[i])){ T[2]++; }else if(IN(800,1199,A[i])){ T[3]++; }else if(IN(1200,1599,A[i])){ T[4]++; }else if(IN(1600,1999,A[i])){ T[5]++; }else if(IN(2000,2399,A[i])){ T[6]++; }else if(IN(2400,2799,A[i])){ T[7]++; }else if(IN(2800,3199,A[i])){ T[8]++; }else { T[9]++; } } ans= T.size()-1; ad= T[9]-1; out(max(ans,1ll),ans+ad)); }
a.cc: In function 'int main()': a.cc:104:29: error: expected ';' before ')' token 104 | out(max(ans,1ll),ans+ad)); | ^ | ;