submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s656093534
p00516
Java
import java.util.Scanner; public class Main1 { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int a[] = new int[n];//??¶???????????¨ int b[] = new int[m];//???????????? int cnt[] = new int[n];//???????????? int max = 0, idx = 0;//?...
Main.java:2: error: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ 1 error
s876884716
p00516
Java
8
Main.java:1: error: class, interface, enum, or record expected 8 ^ 1 error
s296163100
p00516
Java
import java.util.Scanner; public class AOJ0593 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] Ai = new int[N]; int[] Bi = new int[M]; int[] point = new int[N]; int res = 0; for(int i = 0; i < N; i++){ Ai[i] = sc.n...
Main.java:4: error: class AOJ0593 is public, should be declared in a file named AOJ0593.java public class AOJ0593 { ^ 1 error
s955566573
p00516
Java
mport java.util.*; public class AOJ0593{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int i,j,x,c; int max=0,maxn=0; int s=sc.nextInt(); int o=sc.nextInt(); int [][]sn = new int [s][2]; int []ol = new int [o]; for(i=0;i<s;i++){ int m=sc.nextInt(); sn[i][0]=m; ...
Main.java:1: error: class, interface, enum, or record expected mport java.util.*; ^ 1 error
s266467543
p00516
Java
mport java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int i,j,x,c; int max=0,maxn=0; int s=sc.nextInt(); int o=sc.nextInt(); int [][]sn = new int [s][2]; int []ol = new int [o]; for(i=0;i<s;i++){ int m=sc.nextInt(); sn[i][0]=m; sn...
Main.java:1: error: class, interface, enum, or record expected mport java.util.*; ^ 1 error
s569430888
p00516
Java
import java.util.Scanner; public class AOJ0593 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[][] cost = new int[n][2]; int[] std = new int[m]; for (int i=0; i<n; i++) cost[i][0] = sc.nex...
Main.java:3: error: class AOJ0593 is public, should be declared in a file named AOJ0593.java public class AOJ0593 { ^ 1 error
s511775173
p00516
Java
import java.util.*; public class AOJ_0593 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[]k = new int[n]; int[]s = new int[m]; int[]count = new int[n]; for(int i = 0; i < n; i++){ k[i] = sc.nextInt(); } for(int i = 0...
Main.java:2: error: class AOJ_0593 is public, should be declared in a file named AOJ_0593.java public class AOJ_0593 { ^ 1 error
s196211078
p00516
C
main(i,k,n,m,a[1001],c[1001]){for(scanf("%d%d",&n,&m);i<n;scanf("%d",a+i++));for(;m--;k=0){scanf("%d",&i);for(;k<n;k++)if(a[k]<=i)c[k]++,k=n;}for(;--n+1;)if(c[n]>k)k=c[n],i=n;printf("%d\n",i+1);}
main.c:1:15: error: expected ')' before '[' token 1 | main(i,k,n,m,a[1001],c[1001]){for(scanf("%d%d",&n,&m);i<n;scanf("%d",a+i++));for(;m--;k=0){scanf("%d",&i);for(;k<n;k++)if(a[k]<=i)c[k]++,k=n;}for(;--n+1;)if(c[n]>k)k=c[n],i=n;printf("%d\n",i+1);} | ^ | )
s967338056
p00516
C
#include <cstdio> int main(){ int N,M; scanf("%d %d",&N,&M); int A[1000]; int Ai; int Bj; int count[1000]; for(int i=0;i<N;i++){ scanf("%d",&Ai); A[i]=Ai; count[i]=0; } for(int j=0;j<M;j++){ scanf("%d",&Bj); for(int i=0;i<N;i++){ if(A[i]<=Bj){count[i]++;break;} } } int max_count=0; int max_ga...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s807375518
p00516
C
#include<stdio.h> int main(void){ int i,j,a[1000],b[1000],c,d=0,N,M,o; scanf("%d%d",&N,&M); for(i=0;i<N;i++){ b[i]=0; } for(i=0;i<N;i++){ scanf("%d",&a[i]); } for(i=0;i<M;i++){ scanf("%d",&c); for(j=0;j<N;j++){ if(a[j]<=c){ b[j]++; break; } } } for(i=0;i<N;i++){ if(d<b[i]){ d=b[i] o=i; } } printf("%d\n",d...
main.c: In function 'main': main.c:24:7: error: expected ';' before 'o' 24 | d=b[i] | ^ | ; 25 | o=i; | ~
s966566323
p00516
C
#include<stdio.h> int main(void){ int i,j,a[1000],b[1000],c,d,N,M,o=0; scanf("%d %d",&N,&M); for(i=0;i<N;i++){ scanf("%d",&a[i]); b[i]=0; } for(i=0;i<M;i++){ scanf("%d",&c); for(j=0;j<N;j++){ if(a[j]<=c){ b[j]++; break; } } } for(i=0;i<N;i++){ if(o<b[i]){ o=b[i] d=i+1; } } printf("%d\n",d); return 0; }
main.c: In function 'main': main.c:20:7: error: expected ';' before 'd' 20 | o=b[i] | ^ | ; 21 | d=i+1; | ~
s650701222
p00516
C
#include <stdio.h> int main() { int i, j, n, m; int game[1000], judge[1000], ticket[1000] = { 0 }; scanf("%d %d", &n, &m); for( i = 0; i < n; i++) scanf("%d", &game[i]); for( i = 0; i < m; i++) scanf("%d", &judge[1000]); for( i = 0; i < m; i++){ for( j = 0; j < n; i++) { if( game[j] <= judge[i] ) { tick...
main.c: In function 'main': main.c:18:28: error: 'max' undeclared (first use in this function) 18 | if( ticket[max] < ticket[i] ) max = i; | ^~~ main.c:18:28: note: each undeclared identifier is reported only once for each function it appears in
s281023251
p00516
C
#include <stdio.h> int main(void){ int n, m, i, j, x, A; scanf("%d %d", &n, &m); int a[n], b[m], c[n] = {0}; for(i = 0; i < n; i++) { scanf("%d", &a[i]); } for(i = 0; i < m; i++) { scanf("%d", &b[i]); } for(i = 0; i < m; i++) { x = n; for(j = 0; j < n; j++) { if(b[i] > = a[j] && x...
main.c: In function 'main': main.c:6:26: error: variable-sized object may not be initialized except with an empty initializer 6 | int a[n], b[m], c[n] = {0}; | ^ main.c:16:17: error: expected expression before '=' token 16 | if(b[i] > = a[j] && x > j){ | ...
s405736873
p00516
C
#include <stdio.h> int main(void){ int n, m, i, j, x, A; scanf("%d %d", &n, &m); int a[n], b[m], c[n] = {0}; for(i = 0; i < n; i++) { scanf("%d", &a[i]); } for(i = 0; i < m; i++) { scanf("%d", &b[i]); } for(i = 0; i < m; i++) { x = n; for(j = 0; j < n; j++) { if(b[i] > = a[j] && x...
main.c: In function 'main': main.c:6:26: error: variable-sized object may not be initialized except with an empty initializer 6 | int a[n], b[m], c[n] = {0}; | ^ main.c:16:17: error: expected expression before '=' token 16 | if(b[i] > = a[j] && x > j){ | ...
s956972140
p00516
C
/*????\¨(Vote)*/ #include <stdio.h> int main(){ int i, j, x, y, z, N, M; int A[1000] = {0}; int B[1000] = {0}; int data[1000] = {0}; scanf("%d %d", &N, &M); for (i = 1; i - 1 < N; i++) { scanf("%d", &A[i - 1]); } for (j = 1; j - 1 < M; j++) { scanf("%d", &B[j - 1]); } for (j = 1; j - 1 < M; ...
main.c: In function 'main': main.c:27:13: error: expected expression before '[' token 27 | y = [i - 1]; | ^
s026142090
p00516
C
#include <stdio.h> int main(void) { int N,M,i,j; scanf("%d %d",&N,&M); int a[N+1]; //a[]????????¢??????????????¶?????????????????????????????????????????¨??? for(i=1;i<N+1;i++)scanf("%d",&a[i]); int b[M+1],vote[M+1],max,kixyougi[N+1]; //b[]???????§????M????????????????????????kixyougi[]?????????????????¶????????...
main.c: In function 'main': main.c:19:42: error: expected ';' before 'kixyougi' 19 | vote[i]=j | ^ | ; 20 | kixyougi[j]++ | ...
s935630246
p00516
C
#include <stdio.h> int main(void){ int n,m,i,j,max; scanf("%d %d",&n,&m); int a[n],b[m],count[n]; for(i=0;i<n;i++) count[i]=0; for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<m;i++) scanf("%d",&b[i]); for(i=0;i<m;i++){ for(j=0;;j++){ if (b[i]>=a[j]) { coun...
main.c: In function 'main': main.c:23:5: error: expected declaration or statement at end of input 23 | return 0; | ^~~~~~
s136169749
p00516
C++
#include <cstdlib> #include <iostream> #include <vector> using namespace std; #define REP(i, a, b) for(int i = (a); i < (int)(b); ++i) #define rep(i, n) REP(i, 0, n) #define ALL(v) begin(v), end(v) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector<int> a(n); for(auto ...
a.cc: In function 'int main()': a.cc:33:17: error: 'max_element' was not declared in this scope 33 | cout << max_element(ALL(cnt)) - cnt.begin() + 1 << endl; | ^~~~~~~~~~~
s207652676
p00516
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int N[1000],M[1000],hyo[1000]; int n,m; cin>>n>>m; int tmp; for(int i=0;i<n;i++)cin>>N[i]; for(int i=0;i<m;i++)cin>>M[i]; for(int i=0;i<m;i++){ for(int j=0;j<n;j++){ if(M[i]>=N[j]){ hyo[j]++; break; } } } int a=...
a.cc: In function 'int main()': a.cc:21:17: error: 'ma' was not declared in this scope; did you mean 'a'? 21 | int a=0;ma=hyo[0]; | ^~ | a a.cc:26:9: error: 'else' without a previous 'if' 26 | else cout<<a<<endl; | ^~~~
s304477773
p00516
C++
#include <iostream> #include <vector> #include <Algorithm> using namespace std; int main(void){ int mem, kyogi; cin >> kyogi >> mem; int money[kyogi]; int kijun[mem]; int score[mem]; //かかる費用を入力 for(int i = 0; i < kyogi; i++){ cin >> money[i]; } //審査員の基準を入力 for(int i = 0; i < mem; i++){ cin >> kijun[i];...
a.cc:3:10: fatal error: Algorithm: No such file or directory 3 | #include <Algorithm> | ^~~~~~~~~~~ compilation terminated.
s586052447
p00516
C++
#include <cstdio> using namespace std; int cnt[1024]; int main(void) { int n, m; scanf("%d %d",&n, &m); int a[1024]; for (int i = 0; i < n; i++){ scnaf("%d", &a[i]); } int b[1024]; for (int i = 0; i < m; i++){ scanf("%d", &b[i]; } for (int j = 0; j < m; j++){ for (int i = 0; i < n; i++){ if (b[i...
a.cc: In function 'int main()': a.cc:14:17: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 14 | scnaf("%d", &a[i]); | ^~~~~ | scanf a.cc:19:34: error: expected ')' before ';' token 19 | scanf("%d", &b[i]; | ...
s645330770
p00516
C++
#include <iostream> #include <algorithm> #define rep(X, Y) for( int X = 0; X < Y; ++X ) int n, m; int N[1001], M[1001]; int cnt[1001]; int main(){ memset( cnt, 0, sizeof(cnt) ); std::cin >> n >> m; rep( i, n ) std::cin >> N[i]; rep( i, m ) std::cin >> M[i]; rep( i, m ) rep( l, n ) if( N[l] <= M[i] ){ cnt[...
a.cc: In function 'int main()': a.cc:11:9: error: 'memset' was not declared in this scope 11 | memset( cnt, 0, sizeof(cnt) ); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include...
s628649483
p00516
C++
#include <stdio.h> int main(void) { int vote[1000]; int list[1000]; int i,f; memset( vote,NULL,sizeof( vote )); int a = 0,b = 0,c = 0; scanf( "%d %d",&i,&f ); for( a = 0;a < i;a++ ){ scanf( "%d",&list[a] ); } for( a = 0;a < f;a++ ){ scanf( "%d",&c ); for( b = 0;b < i;b++ ){ if( list[b] <= c ){ vote[b...
a.cc: In function 'int main()': a.cc:7:9: error: 'memset' was not declared in this scope 7 | memset( vote,NULL,sizeof( vote )); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#includ...
s139487489
p00516
C++
#include <stdio.h> int main(void) { int vote[1000]; int list[1000]; int i,f; memset( vote,NULL,sizeof( vote )); int a = 0,b = 0,c = 0; scanf( "%d %d",&i,&f ); for( a = 0;a < i;a++ ){ scanf( "%d",&list[a] ); } for( a = 0;a < f;a++ ){ scanf( "%d",&c ); for( b = 0;b < i;b++ ){ if( list[b] < c ){ vote[b]...
a.cc: In function 'int main()': a.cc:7:9: error: 'memset' was not declared in this scope 7 | memset( vote,NULL,sizeof( vote )); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#includ...
s803676615
p00516
C++
i,k,n,m,a[1001],c[1001];main(){for(scanf("%d%d",&n,&m);i<n;scanf("%d",a+i++));for(;m--;k=0){scanf("%d",&i);for(;k<n;k++)if(a[k]<=i)c[k]++,k=n;}for(;--n+1;)if(c[n]>k)k=c[n],i=n;printf("%d\n",i+1);exit(0);}
a.cc:1:1: error: 'i' does not name a type 1 | i,k,n,m,a[1001],c[1001];main(){for(scanf("%d%d",&n,&m);i<n;scanf("%d",a+i++));for(;m--;k=0){scanf("%d",&i);for(;k<n;k++)if(a[k]<=i)c[k]++,k=n;}for(;--n+1;)if(c[n]>k)k=c[n],i=n;printf("%d\n",i+1);exit(0);} | ^ a.cc:1:25: warning: ISO C++ forbids declaration of 'mai...
s017574365
p00516
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define rep(i,a) for(int i = 0 ; i < a; i ++) int main(void){ int N,M; cin>>N>>M; vector<int> a(N); vector<int> sum(N,0); vector<int> a(M); rep(i,N)cin>>a[i]; rep(i,M)cin>>b[i]; rep(i,M) rep(j,N) if(a[j]<=b[i]){...
a.cc: In function 'int main()': a.cc:11:15: error: redeclaration of 'std::vector<int> a' 11 | vector<int> a(M); | ^ a.cc:9:15: note: 'std::vector<int> a' previously declared here 9 | vector<int> a(N); | ^ a.cc:14:16: error: 'b' was not declared in this scope 14 | ...
s785727331
p00516
C++
#include<stdio.h> int main(){ int n[1001]={}; int m[1001]={}; int m,n,x; scanf("%d %d",&n,&m); for(int i=0;i<n;i++) scanf("%d",&n[i]); for(int i=0;i<m;i++) {scanf("%d",&x); for(int j=0;j<n;j++) if(x>=n[j])m[j]++; } int t=0; for(int i=0;i<1000;i++) if(m[i]>t)t=i+1; printf("%d\n",t); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: conflicting declaration 'int m' 7 | int m,n,x; | ^ a.cc:6:5: note: previous declaration as 'int m [1001]' 6 | int m[1001]={}; | ^ a.cc:7:7: error: conflicting declaration 'int n' 7 | int m,n,x; | ^ a.cc:5:5: note: previous decl...
s846177904
p00516
C++
import java.util.Scanner; public class vote { public static void main(String[] args){ Scanner s = new Scanner(System.in); int n = s.nextInt(); int m = s.nextInt(); int[] A = new int[n]; int[] a_= new int[n]; int[] b = new int[m]; int answer = 0; for(int i = 0;i < n;i++){ A[i] = s.nextInt()...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:9: error: expected unqualified-id before 'public' 3 | public class vote { | ^~~~~~
s973121367
p00516
C++
int d[1000]; int ushi; int uma; int main(){ cin>>n>>m; for(int i;i<n;i++){ cin>>a[i];} for(int j;j<m;j++){ cin>>b[j];} for(int k=0;k<n;k++){ for(int l=0;l<m;l++){ if(d[l]==0&&a[k]<=b[l]){ c[k]++; d[l]=1; } } if(c[k]>ushi){ ushi=c[k]; uma=k; } } cout<<uma+1<<endl; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin>>n>>m; | ^~~ a.cc:5:8: error: 'n' was not declared in this scope 5 | cin>>n>>m; | ^ a.cc:5:11: error: 'm' was not declared in this scope 5 | cin>>n>>m; | ^ a.cc:7:10: erro...
s674278430
p00516
C++
#include <iostream> #include <string> #include <map> #include <algorithm> using namespace std; /* int max(map<int, int> m){ int maxkey = 0; for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) { if (maxkey < it->second) maxkey = it->first; } return maxkey; } */ int main(int argc, char const *argv[...
a.cc: In function 'int main(int, const char**)': a.cc:20:9: error: 'vector' was not declared in this scope 20 | vector<int> kyogi(n, 0); | ^~~~~~ a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 4 | #include <algorithm> ...
s706345204
p00516
C++
#include<bits/stdc++.h> using namespace std;int i,j,N,M,C[1000],K[1000],T[1000],X[2]; main(){cin>>N>>M; for(i=0;i<N;i++){cin>>C[i];} for(i=0;i<M;i++){cin>>K[i]; for(j=0;j<N;j++){if(C[j]<=K[i]){T[j] += 1;break;}}}X[0]=0; for(i=0;i<N;i++){if(T[i]>X[0]){X[0]=T[i];X[1]=i+1;}cout<<X[1]<<endl;}
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){cin>>N>>M; | ^~~~ a.cc: In function 'int main()': a.cc:7:70: error: expected '}' at end of input 7 | for(i=0;i<N;i++){if(T[i]>X[0]){X[0]=T[i];X[1]=i+1;}cout<<X[1]<<endl;} | ...
s361249188
p00516
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <functional> #include <vector> #include <string> ?? #define rep(i,n) for(int i=0;i<n;i++) using namespace std; ?? int main(){ ?? ????????int n,m,kyo,iin,de,max; ????????vector<int> a,b; ?? ????????cin >> n >> m; ?????????? ????????int res[n]; ?? ??????...
a.cc:40:7: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs] 40 | ????????//rep(i,n) cout << i+1 << "," << res[i] << endl; a.cc:52:7: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs] 52 | ????????//cout << "max:" << max << endl; a.cc:7:1: error: expected unqualified-id bef...
s176988219
p00516
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n,m; cin >> n >> m; vector<int> a(n); vector<int> b(n); vector<int> c(n); vector<bool> u(n); vector<int> ans(n); fill(u.begin(),u.end(),true); for(int i=0;i<n;i++){ cin >> a[i]; }; for(int i...
a.cc: In function 'int main()': a.cc:10:5: error: 'vector' was not declared in this scope 10 | vector<int> a(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 | ...
s175425409
p00516
C++
#include <iostream> using namespace std; int main(){ int n, m; cin >> n; cin >> m; int a[1000] = {}; int b[1000] = {}; int point[4]; int selected; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < m; i++){ cin >> b[i]; } for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ if(a[i...
a.cc: In function 'int main()': a.cc:23:34: error: expected primary-expression before '>' token 23 | if(a[i] => b[j]){ | ^
s325073880
p00516
C++
#include<stdio.h> int main(void) { int n,m,x,hi[1001],i,j,cnt[1001],temp,max=-1; scanf("%d %d",&n,&m); for(i=1;i<=n;i++){ scanf("%d",&hi[i]); cnt[i]=0; } for(i=0;i<m;i++){ scanf("%d",&x); for(j=1;j<=n;j++){ if(x>=hi[j]){ cnt[j]++; break; } } } // for(j=1;j<=n;j++){ printf(":%d\n",cnt[j])...
a.cc:22:9: error: expected unqualified-id before 'for' 22 | for(i=1;i<=n;i++) { | ^~~ a.cc:22:17: error: 'i' does not name a type 22 | for(i=1;i<=n;i++) { | ^ a.cc:22:22: error: 'i' does not name a type 22 | for(i=1;i<=n;i++) { | ...
s314670386
p00516
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(int)(b);i++) #define rep(i,n) FOR(i,0,n) #define ZERO(a) memset(a,0,sizeof(a)) #define pb push_back int rank[1020]; int main() { int n, m; ZERO(rank); cin >> n >> m; vector<int> v; rep(i,n) { int cost; scanf...
a.cc: In function 'int main()': a.cc:13:10: error: reference to 'rank' is ambiguous 13 | ZERO(rank); | ^~~~ a.cc:6:24: note: in definition of macro 'ZERO' 6 | #define ZERO(a) memset(a,0,sizeof(a)) | ^ In file included from /usr/include/c++/14/bits/stl_pair.h:60, ...
s095839743
p00516
C++
#include<stdio.h> int main(void) { int n,m,a[101],b,z[101],i,j,w,d; scanf("%d %d",&n,&m); for(i=0;i<n;i++){ scanf("%d",&a[i]); z[i]=0; } for(i=0;i<m;i++){ scanf("%d",&b); for(j=0;j<n;j++){ if(b<=a[j]){ z[i]++; break; } } } d=0; for(i=0;i<n;i++){ if(d<z[i]){ d=z[i]; w=i; } print...
a.cc: In function 'int main()': a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s504227211
p00516
C++
#include<stdio.h> int main(void) { int n,m,a[101],b,z[101],i,j,w,d; scanf("%d %d",&n,&m); for(i=0;i<n;i++){ scanf("%d",&a[i]); z[i]=0; } for(i=0;i<m;i++){ scanf("%d",&b); for(j=0;j<n;j++){ if(b<=a[j]){ z[i]++; break; } } } d=0; for(i=0;i<n;i++){ if(d<z[i]){ d=z[i]; w=i; } } p...
a.cc: In function 'int main()': a.cc:27:18: error: expected '}' at end of input 27 | return 0; | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s697176189
p00516
C++
#include<iostream> using namespace std; int n,m,a[1005],p[1005]; int main(){ cin>>n>>m;for(int i=0;i<n;i++){cin>>a[i];} for(int i=0;i<m;i++){ int b;cin>>b; for(int j=0;j<n;j++){ if(a[j]<=b){p[j]++;break;} } } int maxn=0,maxid=0; for(int i=0;i<n;i++){ if(maxn<p[j]){maxn=p[j];maxid=j;} } cout<<maxid+1<<...
a.cc: In function 'int main()': a.cc:14:27: error: 'j' was not declared in this scope 14 | if(maxn<p[j]){maxn=p[j];maxid=j;} | ^
s765451137
p00516
C++
#include<iostream> using namespace std; int Mx = 0, num; int A [1001], B[1001], K[1001; int main(){ int N, M; int i, j; cin >> N >> M; for (j=1; j<=M; j++) { K[j] = 0; } for (i=1; i<=N; i++) { cin >> A[i]; } for (j=1; j<=M; j++) { cin >> B[j]; } for (j=1; J<=M; j++) { for (i=1; i<=N;...
a.cc:4:30: error: expected ']' before ';' token 4 | int A [1001], B[1001], K[1001; | ^ | ] a.cc: In function 'int main()': a.cc:9:28: error: 'K' was not declared in this scope 9 | for (j=1; j<=M; j++) { K[j] = 0; } | ...
s161233370
p00516
C++
#include<iostream> using namespace std; int Mx = 0, num; int A [1001], B[1001], K[1001; int main(){ int N, M; int i, j; cin >> N >> M; for (j=1; j<=M; j++) { K[j] = 0; } for (i=1; i<=N; i++) { cin >> A[i]; } for (j=1; j<=M; j++) { cin >> B[j]; } for (j=1; J<=M; j++) { for (i=1; i<=N;...
a.cc:4:30: error: expected ']' before ';' token 4 | int A [1001], B[1001], K[1001; | ^ | ] a.cc: In function 'int main()': a.cc:9:28: error: 'K' was not declared in this scope 9 | for (j=1; j<=M; j++) { K[j] = 0; } | ...
s115161415
p00516
C++
#include<iostream> using namespace std; int Mx = 0, num; int A [1001], B[1001], K[1001]; int main(){ int N, M; int i, j; cin >> N >> M; for (j=1; j<=M; j++) { K[j] = 0; } for (i=1; i<=N; i++) { cin >> A[i]; } for (j=1; j<=M; j++) { cin >> B[j]; } for (j=1; J<=M; j++) { for (i=1; i<=N...
a.cc: In function 'int main()': a.cc:12:15: error: 'J' was not declared in this scope 12 | for (j=1; J<=M; j++) { | ^
s302753443
p00516
C++
#include<stdio.h> #include<iostream> #include<alorithm> using namespace std; int p[1001]={0},h[1001]={0}; int main(){ int n,m,i,j,l,k,a,b cin>>n>>m; for(i=1;i<=n;i++)cin>>h[i]; for(i=0;i<m;i++){ cin>>l; for(j=1;j<=n;j++){ if(l<=h[j])p[j]++; } } k=0; for(i=1;i<n;i++){ if(h[k]<h[i])k=i; } cout<<k<<endl; return 0; }
a.cc:3:9: fatal error: alorithm: No such file or directory 3 | #include<alorithm> | ^~~~~~~~~~ compilation terminated.
s910169418
p00516
C++
#include<stdio.h> #include<iostream> #include<alorithm> using namespace std; int p[1001]={0},h[1001]={0}; int main(){ int n,m,i,j,l,k,a,b cin>>n>>m; for(i=1;i<=n;i++)cin>>h[i]; for(i=0;i<m;i++){ cin>>l; for(j=1;j<=n;j++){ if(l<=h[j])p[j]++; } } k=0; for(i=1;i<n;i++){ if(h[k]<h[i])k=i; } cout<<k<<endl; return 0; }
a.cc:3:9: fatal error: alorithm: No such file or directory 3 | #include<alorithm> | ^~~~~~~~~~ compilation terminated.
s026963041
p00516
C++
#include<stdio.h> #include<iostream> #include<alorithm> using namespace std; int p[1001]={0},h[1001]={0}; int main(){ int n,m,i,j,l,k,a,b; cin>>n>>m; for(i=1;i<=n;i++)cin>>h[i]; for(i=0;i<m;i++){ cin>>l; for(j=1;j<=n;j++){ if(l<=h[j])p[j]++; } } k=0; for(i=1;i<n;i++){ if(h[k]<h[i])k=i; } cout<<k<<endl; return 0; ...
a.cc:3:9: fatal error: alorithm: No such file or directory 3 | #include<alorithm> | ^~~~~~~~~~ compilation terminated.
s178125464
p00516
C++
#include<stdio.h> #include <iostream> #include<string> #include<algorithm> #include<sstream> #include<math.h> #define FOR(i,a) for(int i=0;i<a;i++) using namespace std; int main() { int n, m; cin >> n >> m; int a[n]; int b[m]; int ans[n]; int maxcount = 0; FOR(i, n) { cin >> a[i]; ans[i] = 0; } FOR(i, m) {...
a.cc: In function 'int main()': a.cc:35:26: error: expected primary-expression before '<<' token 35 | cout << pos + 1; << endl; | ^~
s680997102
p00516
C++
#include<iostream> #include<string> #include<set> #include<utility> #include<vector> #include<map> #include<algorithm> using namespace std; int main(){ /* //数あて int n; cin >> n; int p[200][3]; for(int i=0;i<n;i++) { cin >> p[i][0] >> p[i][1] >> p[i][2]; } int _p; for(int k=0;k<3;k++) { for(int i=0;i<...
a.cc: In function 'int main()': a.cc:156:13: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)' 156 | sort(X.begin,X.end); | ~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from...
s104965344
p00516
C++
#include<iostream> #include<string> #include<set> #include<utility> #include<vector> #include<map> #include<algorithm> using namespace std; int main(){ /* //数あて int n; cin >> n; int p[200][3]; for(int i=0;i<n;i++) { cin >> p[i][0] >> p[i][1] >> p[i][2]; } int _p; for(int k=0;k<3;k++) { for(int i=0;i<...
In file included from /usr/include/c++/14/algorithm:61, from a.cc:7: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int (*)[2]; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /us...
s536757443
p00516
C++
#include<iostream> #include<string> #include<set> #include<utility> #include<vector> #include<map> #include<algorithm> using namespace std; int main(){ /* //数あて int n; cin >> n; int p[200][3]; for(int i=0;i<n;i++) { cin >> p[i][0] >> p[i][1] >> p[i][2]; } int _p; for(int k=0;k<3;k++) { for(int i=0;i<...
a.cc: In function 'int main()': a.cc:187:38: error: invalid types 'int[int]' for array subscript 187 | temps = temps[i]; | ^
s800771873
p00516
C++
#include<iostream> using namespace std; int main() { int n, m, x, y, z; cin >> n >> m; int A[n]; int B[m]; int C[m]; y = 0; for (int i = 0; i < n; i++) { cin >> A[i]; } for (int i = 0; i < m; i++) { cin >> B[i]; for (int j = 0; j < n; j++) { if (B[i] >= A[j]) { C[i] = j; break; } } } ...
a.cc: In function 'int main()': a.cc:25:23: error: request for member 'count' in 'C', which is of non-class type 'int [m]' 25 | x = C.count(i); | ^~~~~ a.cc:29:23: error: request for member 'count' in 'C', which is of non-class type 'int [m]' 29 | if (C....
s579538373
p00516
C++
#include<iostream> using namespace std; int main() { int n, m, x, y, z; cin >> n >> m; int A[n]; int B[m]; int C[m]; y = 0; for (int i = 0; i < n; i++) { cin >> A[i]; } for (int i = 0; i < m; i++) { cin >> B[i]; for (int j = 0; j < n; j++) { if (B[i] >= A[j]) { C[i] = j; break; } } } ...
a.cc: In function 'int main()': a.cc:25:23: error: request for member 'count' in 'C', which is of non-class type 'int [m]' 25 | x = C.count(i); | ^~~~~ a.cc:29:23: error: request for member 'count' in 'C', which is of non-class type 'int [m]' 29 | if (C....
s404464798
p00517
Java
import java.util.Scanner; public class Main2014C { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int W = sc.nextInt(); int H = sc.nextInt(); int N = sc.nextInt(); int[] X = new int[N]; int[] Y = new int[N]; int ans = 0; for(int i=0;i<N;i++) { X[i] = sc.nextI...
Main.java:2: error: class Main2014C is public, should be declared in a file named Main2014C.java public class Main2014C { ^ 1 error
s203064906
p00517
Java
import java.io.*; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); public sttic void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputSteamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty())...
Main.java:8: error: <identifier> expected public sttic void main(String[] args) throws IOException{ ^ 1 error
s772182922
p00517
Java
import java.io.*; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputSteamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()...
Main.java:9: error: cannot find symbol BufferedReader br=new BufferedReader(new InputSteamReader(System.in)); ^ symbol: class InputSteamReader location: class Main 1 error
s445310322
p00517
Java
//============================================================================ // Name : JOI.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
Main.java:9: error: illegal character: '#' #include <iostream> ^ Main.java:9: error: class, interface, enum, or record expected #include <iostream> ^ Main.java:11: error: unnamed classes are a preview feature and are disabled by default. char chr; ^ (use --enable-preview to enable unnamed classes) Main.java:...
s095598633
p00517
Java
//============================================================================ // Name : JOI.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
Main.java:9: error: illegal character: '#' #include <iostream> ^ Main.java:9: error: class, interface, enum, or record expected #include <iostream> ^ Main.java:11: error: unnamed classes are a preview feature and are disabled by default. char chr; ^ (use --enable-preview to enable unnamed classes) Main.java:...
s421744239
p00517
Java
import java.util.Scanner; public class AOJ0594 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ 1 error
s926341040
p00517
Java
public class AOJ0594 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; for(int i = 0;...
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0594 Main.java:3: error: cannot find symbol ...
s543014461
p00517
Java
public class AOJ0594 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; for(int i = 0;...
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0594 Main.java:3: error: cannot find symbol ...
s639489577
p00517
Java
public class AOJ0594 { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; ...
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ 1 error
s449044326
p00517
Java
public class AOJ0594 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; for(int i = 0; i < n; i++){ ...
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0594 Main.java:3: error: cannot find symbol Scanner sc = new Sca...
s778361586
p00517
Java
public class AOJ0594 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; for(int i = 0; i < n; i++){ ...
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0594 Main.java:3: error: cannot find symbol Scanner sc = new Sca...
s607985735
p00517
Java
public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; for(int i = 0; i < n; i++){ ...
Main.java:1: error: class main is public, should be declared in a file named main.java public class main { ^ Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System....
s138043066
p00517
Java
public class AOJ0594 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; for(int i = 0; i < n; i++){ ...
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0594 Main.java:3: error: cannot find symbol Scanner sc = new Sca...
s798435561
p00517
Java
import java.util.Scanner; public class AOJ0594 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; f...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594 { ^ 1 error
s453777963
p00517
Java
import java.util.Scanner; public class AOJ0594{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; ...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594{ ^ 1 error
s140896579
p00517
Java
import java.util.Scanner; public class AOJ0594{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; ...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594{ ^ 1 error
s285732628
p00517
Java
import java.util.Scanner; public class AOJ0594{ public static void AOJ0594(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2];...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594{ ^ 1 error
s852630666
p00517
Java
import java.util.Scanner; public class AOJ0594{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int gowhere[][] = new int[n][2...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594{ ^ 1 error
s751686836
p00517
Java
import java.util.Scanner; public class main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int gowhere[][] = new int[n][2]; ...
Main.java:3: error: class main is public, should be declared in a file named main.java public class main{ ^ 1 error
s374716793
p00517
Java
import java.util.Scanner; public class AOJ0594{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int ikisaki[][] = new int[n][...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594{ ^ 1 error
s632757107
p00517
Java
import java.util.Scanner; public class AOJ0594{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); int result,x,result2,y; int mov = 0; int go[][] = new int[n][2]; ...
Main.java:3: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java public class AOJ0594{ ^ 1 error
s901027696
p00517
C
#include<bits/stdc++.h> using namespace std; int main(){ int i; int W,H,N,sum; int x,y,dx,dy; scanf("%d %d %d",&W,&H,&N); scanf("%d %d",&x,&y); sum=0; for(i=0;i<N-1;i++){ scanf("%d %d",&dx,&dy); dx=dx-x; dy=dy-y; if(0<=dx&&0<=dy){ if(dx>dy){ sum=sum+dx; }else{ sum=sum+dy; ...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s098597453
p00517
C
#include <stdio.h> int main(void) { int W,H,N,i,j,ans; ans=0; scanf("%d %d %d",&W,&H,&N); int xs,ys,xg,yg,xnow,ynow; scanf("%d %d",&xs,&ys); for(i=1;i<N;i++){ if(i==1){ xnow=xs; ynow=ys; } else { xnow=xg; ynow=yg; } scanf("%d %d",&xg,&yg); //goal scan while(!(xnow==xg&&ynow==yg)){ if(...
main.c: In function 'main': main.c:47:25: error: expected '}' before 'else' 47 | else { | ^~~~ main.c:60:1: error: expected declaration or statement at end of input 60 | } | ^
s737202932
p00517
C
#include <stdio.h> int main(void) { int W,H,N,i,j,ans; ans=0; scanf("%d %d %d",&W,&H,&N); int xs,ys,xg,yg,xnow,ynow; scanf("%d %d",&xs,&ys); xnow=xs; ynow=ys; scanf("%d %d",&xg,&yg); //goal scan while(!(xnow==xg&&ynow==yg)){ if(xnow<xg){ if(ynow<yg){//?????? xnow++; ynow++; } el...
main.c:57:9: error: expected identifier or '(' before 'for' 57 | for(i=2;i<N;i++){ | ^~~ main.c:57:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 57 | for(i=2;i<N;i++){ | ^ main.c:57:22: error: expected '=', ',', ';', 'asm' or '__a...
s808293088
p00517
C
#include <stdio.h> int main(void) { int W,H,N,i,j,ans; ans=0; scanf("%d %d %d",&W,&H,&N); int xs,ys,xg,yg; scanf("%d %d",&xs,&ys); scanf("%d %d",&xg,&yg); //goal scan if(xs<xg&&xy<yg){ if(xg-xs<yg-ys){ ans=yg-ys; } else { ans=xg-xs; } } if(xs>xg&&xy>yg){ if(xs-xg<ys-yg){ ans=ys-yg; } ...
main.c: In function 'main': main.c:12:19: error: 'xy' undeclared (first use in this function); did you mean 'xg'? 12 | if(xs<xg&&xy<yg){ | ^~ | xg main.c:12:19: note: each undeclared identifier is reported only once for each function it appears in
s165641888
p00517
C
#include <iostream> #include <stdafx.h> #include <stdio.h> #define fo(i,a) for(i=0;i<a;i++) using namespace std; int main() { int i, n, x, y, ans, w[1000000], h[1000000]; scanf("%d", &n); fo(i, n) scanf("%d%d", &w[i], &h[i] ); fo(i, n) { if ((w[i] > w[i] && h[i] < h[i - 1]) || (w[i] < w[i - 1] && h[i] < h[i - 1]...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s693822916
p00517
C++
#include <stdio.h> #include <algorithm> int main(void) { int w, h, n, i, j, cost = 0; int sx, sy, gx, gy; scanf("%d %d %d", &w, &h, &n); scanf("%d %d", &sx, &sy); for (i = 1; i < n; i++){ scanf("%d %d", &gx, &gy); if (sx < gx && sy < gy){ if (gx - sx < gy - sy){ cost += gx - sx; sy += ...
a.cc: In function 'int main()': a.cc:41:25: error: 'max' was not declared in this scope; did you mean 'std::max'? 41 | cost += max(sx - gx, gx - sx); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, f...
s351433874
p00517
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<vector> #include<cmath> #include<cstdio> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb push_back #define mp make_pair #define it ::iterator #define all(in) in.begin(),in.end...
a.cc: In function 'int main()': a.cc:36:25: error: expected '}' at end of input 36 | cout<<sum<<endl; | ^ a.cc:19:11: note: to match this '{' 19 | int main(){ | ^
s873232021
p00517
C++
+#include <cstdio> #include <cmath> #include <algorithm> #include <iostream> using namespace std; int main(){ int w,h,n,x[20000],y[20000]; int sum=0,dis; int i,j; scanf("%d %d %d",&w,&h,&n); for(i=0;i<=n-1;i++){ scanf("%d %d",&x[i],&y[i]); } for(i=0;i<=n-2;i++){ j=i+1; if(x[i]==x[j]) {dis=abs(...
a.cc:1:2: error: stray '#' in program 1 | +#include <cstdio> | ^ a.cc:1:1: error: expected unqualified-id before '+' token 1 | +#include <cstdio> | ^ In file included from /usr/include/c++/14/cmath:45, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr con...
s087664899
p00517
C++
// JOI13-quest3.cpp : Defines the entry point for the console application. // #include <stdio.h> int absolute(int *n) { if (*n >= 0) { return *n; } else { *n *= -1; return *n; } } int big(int n, int m) { int max; absolute(&n); absolute(&m); if (n >= m) { max = n; } else { max = m; } return ...
a.cc:33:22: error: '_TCHAR' has not been declared 33 | int _tmain(int argc, _TCHAR* argv[]) | ^~~~~~
s966726559
p00517
C++
#include<bits/stdc++.h> using namespace std; int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}...
a.cc:3:33: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1...
s731691919
p00517
C++
#include<bits/stdc++.h> using namespace std; int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}...
a.cc:3:33: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1...
s817481994
p00517
C++
#include <bits/stdc++.h> using namespace std; int main() { int w, h, n; cin >> w >> h >> n; int a[10000], b[10000]; for (int i = 0, i < n; i++){ int c, d; cin >> c >> d; a[i] = c; b[i] = d; } int sum = 0; for (int i = 0, i < n - 1; i++){ if (a[...
a.cc: In function 'int main()': a.cc:11:22: error: expected ';' before '<' token 11 | for (int i = 0, i < n; i++){ | ^~ | ; a.cc:11:23: error: expected primary-expression before '<' token 11 | for (int i = 0, i < n; i++){ | ...
s557612953
p00517
C++
#include <bits/stdc++.h> using namespace std; int main() { int w, h, n; cin >> w >> h >> n; int a[10000], b[10000]; for (int i = 0, i < n; i++){ int c, d; cin >> c >> d; a[i] = c; b[i] = d; } int sum = 0; for (int i = 0, i < n - 1; i++){ if...
a.cc: In function 'int main()': a.cc:11:22: error: expected ';' before '<' token 11 | for (int i = 0, i < n; i++){ | ^~ | ; a.cc:11:23: error: expected primary-expression before '<' token 11 | for (int i = 0, i < n; i++){ | ...
s962173931
p00517
C++
//============================================================================ // Name : JOI.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
a.cc: In function 'int main()': a.cc:23:35: error: 'fabs' was not declared in this scope; did you mean 'labs'? 23 | if(X[i]==X[i+1])S=fabs(Y[i+1]-Y[i]); | ^~~~ | labs a.cc:24:35: error: 'fabs' was not declared in this sco...
s850711268
p00517
C++
#include<stdio.h> #include <iostream> #include<string> #include<algorithm> #include<sstream> #include<math.h> #define FOR(i,a) for(int i=0;i<a;i++) using namespace std; int main() { int w,h,n; cin >> w >> h >> n; int pos[n][2]; FOR(i,n) { cin >> pos[i][0] >> pos[i][1]; } int count = 0; FOR(i, n - 1) { if(pos...
a.cc: In function 'int main()': a.cc:19:137: error: expected ';' before 'else' 19 | count+= pos[i][0]-pos[i+1][0]+ pos[i][1] - pos[i+1][1]-min(pos[i + 1][0] - pos[i][0], pos[i + 1][1] - pos[i][1]) | ...
s359768233
p00517
C++
#include<stdio.h> #include <iostream> #include<string> #include<algorithm> #include<sstream> #include<math.h> #define FOR(i,a) for(int i=0;i<a;i++) using namespace std; int main() { int w,h,n; cin >> w >> h >> n; int pos[n][2]; FOR(i,n) { cin >> pos[i][0] >> pos[i][1]; } int count = 0; FOR(i, n - 1) { if (po...
a.cc: In function 'int main()': a.cc:27:23: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 27 | cout << count << end; | ~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from ...
s492449387
p00517
C++
#include "iostream" #include "stdafx.h" #include "stdio.h" #define fo(i,a) for(i=0;i<a;i++) using namespace std; int main() { int i, n, x, y, ans, w[1000000], h[1000000]; scanf("%d", &n); fo(i, n) scanf("%d%d", &w[i], &h[i] ); fo(i, n) { if ((w[i] > w[i] && h[i] < h[i - 1]) || (w[i] < w[i - 1] && h[i] < h[i - 1]...
a.cc:2:10: fatal error: stdafx.h: No such file or directory 2 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s622711836
p00517
C++
#include <iostream> #include <stdafx.h> #include <stdio.h> #define fo(i,a) for(i=0;i<a;i++) using namespace std; int main() { int i, n, x, y, ans, w[1000000], h[1000000]; scanf("%d", &n); fo(i, n) scanf("%d%d", &w[i], &h[i] ); fo(i, n) { if ((w[i] > w[i] && h[i] < h[i - 1]) || (w[i] < w[i - 1] && h[i] < h[i - 1]...
a.cc:2:10: fatal error: stdafx.h: No such file or directory 2 | #include <stdafx.h> | ^~~~~~~~~~ compilation terminated.
s380556840
p00517
C++
#include <iostream> #include <stdafx.h> #include <stdio.h> #define fo(i,a) for(i=0;i<a;i++) using namespace std; int main() { int i, n, x, y, ans, w[1000000], h[1000000]; scanf("%d", &n); fo(i, n) scanf("%d%d", &w[i], &h[i] ); fo(i, n) { if ((w[i] > w[i] && h[i] < h[i - 1]) || (w[i] < w[i - 1] && h[i] < h[i - 1]...
a.cc:2:10: fatal error: stdafx.h: No such file or directory 2 | #include <stdafx.h> | ^~~~~~~~~~ compilation terminated.
s736866090
p00517
C++
#include <iostream> #include <stdafx.h> #include <stdio.h> #define fo(i,a) for(i=0;i<a;i++) using namespace std; int main() { int i, n, x, y, ans, w[1000000], h[1000000]; scanf("%d", &n); fo(i, n) scanf("%d%d", &w[i], &h[i] ); fo(i, n) { if ((w[i] > w[i] && h[i] < h[i - 1]) || (w[i] < w[i - 1] && h[i] < h[i - 1]...
a.cc:2:10: fatal error: stdafx.h: No such file or directory 2 | #include <stdafx.h> | ^~~~~~~~~~ compilation terminated.
s423750000
p00517
C++
#include <iostream> #include <stdafx.h> #include <stdio.h> #define fo(i,a) for(i=0;i<a;i++) using namespace std; int main() { int i, n, x, y, ans, w[1000000], h[1000000]; scanf("%d", &n); fo(i, n) scanf("%d%d", &w[i], &h[i] ); fo(i, n) { if ((w[i] > w[i] && h[i] < h[i - 1]) || (w[i] < w[i - 1] && h[i] < h[i - 1]...
a.cc:2:10: fatal error: stdafx.h: No such file or directory 2 | #include <stdafx.h> | ^~~~~~~~~~ compilation terminated.
s192118434
p00517
C++
#include <iostream> #include <vector> #include <cstdlib> #include <algorithm> #define push_back pb typedef pair<int,int> iP; using namespace std; int main(){ int w,h,n; ll cnt = 0; cin >> w >> h >> n; vector<iP> v; for(int i=0;i<n;i++){ int x,y; cin >> x >> y; v.pb(iP(--x,--y)); } for(int i=0;i<n-1;i...
a.cc:6:9: error: 'pair' does not name a type 6 | typedef pair<int,int> iP; | ^~~~ a.cc: In function 'int main()': a.cc:11:3: error: 'll' was not declared in this scope 11 | ll cnt = 0; | ^~ a.cc:13:10: error: 'iP' was not declared in this scope 13 | vector<iP> v; | ^~ ...
s104922047
p00517
C++
#include <iostream> #include <vector> #include <cstdlib> #include <cmath> #include <algorithm> #define push_back pb typedef pair<int,int> iP; using namespace std; int main(){ int w,h,n; ll cnt = 0; cin >> w >> h >> n; vector<iP> v; for(int i=0;i<n;i++){ int x,y; cin >> x >> y; v.pb(iP(--x,--y)); } fo...
a.cc:7:9: error: 'pair' does not name a type 7 | typedef pair<int,int> iP; | ^~~~ a.cc: In function 'int main()': a.cc:12:3: error: 'll' was not declared in this scope 12 | ll cnt = 0; | ^~ a.cc:14:10: error: 'iP' was not declared in this scope 14 | vector<iP> v; | ^~ ...
s113341653
p00518
Java
import java.io.*; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); while((line=br.readLine())!=null&&!line.isEmpty()){ int n=Integer.parseInt(line); char[] mem={'J',...
Main.java:30: error: ';' expected dp[i][1]+=dp[i-1][1]+dp[i-1][4]+dp[i-1][6]++dp[i-1][7]; ^ Main.java:30: error: not a statement dp[i][1]+=dp[i-1][1]+dp[i-1][4]+dp[i-1][6]++dp[i-1][7]; ^ Main.java:36: error: ';' expected dp[i...
s881153766
p00518
Java
import java.io.*; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); while((line=br.readLine())!=null&&!line.isEmpty()){ int n=Integer.parseInt(line); char[] mem={'J',...
Main.java:9: error: cannot find symbol while((line=br.readLine())!=null&&!line.isEmpty()){ ^ symbol: variable line location: class Main Main.java:9: error: cannot find symbol while((line=br.readLine())!=null&&!line.isEmpty()){ ^ symbol: variable line location: class...
s678451989
p00518
Java
import java.io.*; import java.util.Arrays; class Main{ static final PrintWriter out=new PrintWriter(System.out); static final int MOD=10007; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine(...
Main.java:19: error: bad operand types for binary operator '&&' if(i>>0&1&&i>>pic[0]&1) dp[0][i]=1; ^ first type: int second type: int Main.java:24: error: bad operand types for binary operator '&&' if(j>>pic[i]&1&&k>>pic[i]&1) dp[i][k]+=dp[i-1][j]; ^ first type: int second type: int Ma...
s568720215
p00518
Java
import java.io.*; import java.util.Arrays; class Main{ static final PrintWriter out=new PrintWriter(System.out); static final int MOD=10007; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine(...
Main.java:19: error: bad operand types for binary operator '&' if(i>>(1<<0)&1==0&&i>>pic[0]&1==0) dp[0][i]=1; ^ first type: int second type: boolean Main.java:19: error: bad operand types for binary operator '&' if(i>>(1<<0)&1==0&&i>>pic[0]&1==0) dp[0][i]=1; ^ first type: ...
s242896105
p00518
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 import java.io.*; import java.util.Arrays; class Main{ static final PrintWriter out=new PrintWriter(System.out); static final int MOD=10007; public static void main(String[] args) throws IOEx...
Main.java:2: error: class, interface, enum, or record expected 1 ^ Main.java:45: error: class, interface, enum, or record expected import java.util.Arrays; ^ 2 errors