submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s158169519
p00043
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int[] n=new int[10]; for(int i=0;i<13;i++){ n[(int)(line.charAt(i)-'1'+1)]++; } for(int i=1;i<=9;i++){ if(n...
Main.java:27: error: cannot find symbol it min=0; ^ symbol: class it location: class Main 1 error
s736547517
p00043
Java
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class AOJ0043 { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String in; try { while ((in = sc.nextLine()) != null) { ArrayList<Integer> ans = new ArrayList<Integer>(); for (int ...
Main.java:5: error: class AOJ0043 is public, should be declared in a file named AOJ0043.java public class AOJ0043 { ^ 1 error
s864140996
p00043
Java
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class AOJ0043 { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String in; try { while ((in = sc.nextLine()) != null) { ArrayList<Integer> ans = new ArrayList<Integer>(); for (int ...
Main.java:5: error: class AOJ0043 is public, should be declared in a file named AOJ0043.java public class AOJ0043 { ^ 1 error
s740416203
p00043
C
char t1[12]; int f(int x){ char t2[12]; int i,c=4; memcpy(t2,t1,12); t2[x]-=2; for(i=1;i<=9;){ if(t2[i]){ if(t2[i]>2)t2[i]-=3; else if(t2[i+1]&&t2[i+2]){ --t2[i];--t2[i+1];--t2[i+2]; } else return 0; if(!--c)return 1; } if(!t2[i])++i; } return 0; } int main(void){ char s[16]; int i,j...
main.c: In function 'f': main.c:6:9: error: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration] 6 | memcpy(t2,t1,12); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memcpy' +++ |+#include <string.h> 1 | char t1[12]; main.c:6:9: warnin...
s552006918
p00043
C
t1[12],t2[12],i,j,k,z,c,r;f(x){r=0;c=4;memcpy(t2,t1,48);t2[x]-=2;for(k=1;k<=9;){t2[k]--?t2[k]>1?t2[k]-=2,r=!--c:t2[k+1]&&t2[k+2]?--t2[k+1],--t2[k+2],r=!--c:0:0;t2[k]||++k;}}main(){char s[16];for(;~scanf(" %s",s);){memset(t1,0,48);for(z=i=0;i<13;)++t1[s[i++]-'0'];for(i=1;i<=9;i++){if(t1[i]<4){++t1[i];for(r=0,j=1;j<=9&&!...
main.c:1:1: warning: data definition has no type or storage class 1 | t1[12],t2[12],i,j,k,z,c,r;f(x){r=0;c=4;memcpy(t2,t1,48);t2[x]-=2;for(k=1;k<=9;){t2[k]--?t2[k]>1?t2[k]-=2,r=!--c:t2[k+1]&&t2[k+2]?--t2[k+1],--t2[k+2],r=!--c:0:0;t2[k]||++k;}}main(){char s[16];for(;~scanf(" %s",s);){memset(t1,0,48);for(z=i=0;i<13;)...
s349199598
p00043
C
t1[12],t2[12],i,j,k,z,r,c; f(x){ r=c=4; memcpy(t2,t1,48); t2[x]-=2; for(k=1;k<=9;){ t2[k]--?t2[k]>1?t2[k]-=2,r=--c:t2[k+1]&&t2[k+2]?--t2[k+1],--t2[k+2],r=--c:0:0; t2[k]<1&&++i; } main(){ char s[16]; for(;scanf(" %d",s);){ memset(t1,0,48); for(z=i=0;i<13;)++t1[s[i++]-'0']; for(i=1;i<=9;i++){ if(t1[i...
main.c:1:1: warning: data definition has no type or storage class 1 | t1[12],t2[12],i,j,k,z,r,c; | ^~ main.c:1:1: error: type defaults to 'int' in declaration of 't1' [-Wimplicit-int] main.c:1:8: error: type defaults to 'int' in declaration of 't2' [-Wimplicit-int] 1 | t1[12],t2[12],i,j,k,z,r,c; | ...
s246477432
p00043
C
#include <iostream> #include <vector> using namespace std; //#pragma comment(linker, "/STACK:400000000") #define rep(i,n) rep2(i,0,n) #define rep2(i,m,n) for(int i=m;i<n;i++) #define pb push_back #define sz size() #define vi vector<int> string in; vi a; int dfs(vi v,int rest){ if(rest==0)return 1; if(rest==...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s818896451
p00043
C
#include<stdio.h> #include<string> #include<stdlib.h> int m[14],w[10],w2[10],a[9]; void f0(int *ws,int *k) { int j; for(j=1;ws[j]==0;j++); if(ws[j]>2) { ws[j]-=3; (*k)++; } } void f1(int *ws,int *k) { int j; for(j=1;j<8;) { if(ws[j]>0&&ws[j+1]>0&&ws[j+2]>0) { ws[j]--;ws[j+1]--;ws[j+2]--;(*k)++; ...
main.c:2:9: fatal error: string: No such file or directory 2 | #include<string> | ^~~~~~~~ compilation terminated.
s573719275
p00043
C++
#include <iostream> #include <string> #include <string.h> #include <vector> #include <algorithm> #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) #define pb push_back using namespace std; int ans[10]; void solve(vector<int> a,int n) { int count = 0; rep(i,a.size()) count += a[i]; if...
a.cc: In function 'int main()': a.cc:70:46: error: 'j' was not declared in this scope 70 | if(a[j] >= 2) | ^
s342548302
p00043
C++
#include <iostream> #include <string> #include <algorithm> #include <map> #include <vector> using namespace std; string str; bool c (map<char,int> m) { for (auto i = m.begin(); i != m.end(); i++) { if (i->second != 0) return false; } return true; } bool dfs(map<char,int> m) { if (c(m)) retur...
a.cc: In function 'int main()': a.cc:63:9: error: expected '}' before 'else' 63 | else cout << 0; | ^~~~ a.cc:60:25: note: to match this '{' 60 | if (res.size()) { | ^
s761389682
p00043
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <cmath> using namespace std; #define rep2(x,from,to) for(int x = (from); x < (to); ++(x)) #define rep(x,to) rep2(x,0,to) int* minus(int a, vector<int> v1, vector<int> v2, int (&n)[10]) { int x; if(v1.size() > a) { x = v1[a]; n[x]--...
a.cc: In function 'bool judge(int, int, int, int, std::vector<int>, std::vector<int>, int*)': a.cc:26:9: error: reference to 'minus' is ambiguous 26 | minus(j,v1,v2, nn); | ^~~~~ In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bits/locale_classes.h...
s853072910
p00043
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> using namespace std; #define rep2(x,from,to) for(int x = (from); x < (to); ++(x)) #define rep(x,to) rep2(x,0,to) int* minus(int a, vector<int> v1, vector<int> v2, int (&n)[10]) { int x; if(v1.size() > a) { x = v1[a]; n[x]--, n[x+1]--, n[x+...
a.cc: In function 'bool judge(int, int, int, int, std::vector<int>, std::vector<int>, int*)': a.cc:26:9: error: reference to 'minus' is ambiguous 26 | minus(j,v1,v2, nn); | ^~~~~ In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bits/locale_classes.h...
s279982909
p00043
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; int tmp[10]; bool solve(int n, int f) { bool judge = false; if (f == 4) { for (int i = 1; i < 10; i++) { if (tmp[i] == 2) { return true; } } return false; } if (tmp[n] >= 3) { tmp[n] -= 3; judge ...
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/includ...
s266204472
p00043
C++
#include <bits/stdc++.h> using namespace std; using db = double; using ll = long long; using vi = vector <int>; #define op operator #define pb push_back const int N = 15; int c[N]; bool ans; void dfs(int a, int b) { if(!a && !b) { ans = 1; return; } int i = find_if(c, c + N, [](int i) { return i > 0; }) - c; ...
a.cc: In function 'int main()': a.cc:59:41: error: 'x' was not declared in this scope 59 | cout << x << (i + 1 == v.size() ? '\n' : ' '); | ^
s067440631
p00043
C++
#include<iostream> using namespace std; const int MAX_LINELEN = 14; const int DIGIT_NUM = 10; int puzzleCheck(int [], int, int, int *); void checkNum(char *, int []); int main(void) { while( true ){ int i; int isThisLineClear = 0; char lineData[MAX_LINELEN] = ""; scanf("%s", lineData); if( strlen( lin...
a.cc: In function 'int main()': a.cc:19:21: error: 'strlen' was not declared in this scope 19 | if( strlen( lineData ) < 13){ | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream...
s039763106
p00043
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include<vector> using namespace std; int x[14]; bool r[14][100]; bool tempai(int num, int jan, int chou, bool make){ for(int i=0; i<14; i++){ if(!r[i][num]){ if(jan == 1 && i<13){ if(x[i] == x[i+1] && !(r[i+1][num])){ for(int j=0;...
a.cc: In function 'int main()': a.cc:66:5: error: jump to label 'jump' 66 | jump:; | ^~~~ a.cc:62:26: note: from here 62 | if(cou > 4){goto jump;} | ^~~~ a.cc:64:12: note: crosses initialization of 'bool f' 64 | bool f = tempai(0,1,4,false); ...
s788981116
p00043
C++
import java.util.Scanner; public class Main { public static void main(String arg[]) { Scanner in = new Scanner(System.in); while(in.hasNext()) { String str=in.next(); int a[]=new int[10]; for(int i=0;i<str.length();i++) a[str.charAt(i)-'0']++; int ans[]=new int[10]; for(int i=1;i<=9;i++) {...
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:2:1: error: expected unqualified-id before 'public' 2 | public class Main | ^~~~~~
s802952253
p00043
C++
#include <stdio.h> #include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; #define REP(i,n) for(int i=0; i<n; ++i) #define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it) bool judgeTriple(int tmp2[], int count){ if(count==4) return true; ...
a.cc: In function 'int main()': a.cc:59:5: error: 'memset' was not declared in this scope 59 | memset(nums, 0, sizeof(nums)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <vector> +++ |+#include <cstring> ...
s546984054
p00043
C++
#include <stdio.h> #include <stdlib.h> #include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; #define REP(i,n) for(int i=0; i<n; ++i) #define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it) bool judgeTriple(int tmp2[], int count){ if(count==4...
a.cc: In function 'int main()': a.cc:60:5: error: 'memset' was not declared in this scope 60 | memset(nums, 0, sizeof(nums)); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <vector> +++ |+#include <cstring> ...
s699432685
p00043
C++
#include<cstring> #include<vector> using namespace std; bool slove(int tmp[]) { for(int i=1;i<10;i++) { while(tmp[i]!=0) { if(tmp[i]>=3) { tmp[i]-=3; // cout<<i<<":3set"<<endl; } else if(i<8&&tmp[i]>0&&tmp[i+1]>0&&tmp[i+2]>0) { tmp[i]--; tmp[i+1]--; ...
a.cc: In function 'int main()': a.cc:36:3: error: 'string' was not declared in this scope 36 | string str; | ^~~~~~ a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 2 | #include<vector> +++ |+#include <string> 3 | a.cc:37:8: er...
s957801320
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.mth.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int ...
Main.java:4: error: package java.mth does not exist import java.mth.BigInteger; ^ Main.java:12: error: cannot find symbol BigInteger x=new BigInteger(a); ^ symbol: class BigInteger location: class Main Main.java:12: error: cannot find symbol BigInteger x=new BigInteger(a); ^ symb...
s285627452
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int...
Main.java:12: error: no suitable constructor found for BigInteger(int) BigInteger x=new BigInteger(a); ^ constructor BigInteger.BigInteger(byte[]) is not applicable (argument mismatch; int cannot be converted to byte[]) constructor BigInteger.BigInteger(int[]) is not applicable (argumen...
s409723069
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int...
Main.java:12: error: no suitable constructor found for BigInteger(int) BigInteger x=new BigInteger(a); ^ constructor BigInteger.BigInteger(byte[]) is not applicable (argument mismatch; int cannot be converted to byte[]) constructor BigInteger.BigInteger(int[]) is not applicable (argumen...
s238570078
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int...
Main.java:12: error: no suitable constructor found for BigInteger(int) BigInteger x=new BigInteger(a); ^ constructor BigInteger.BigInteger(byte[]) is not applicable (argument mismatch; int cannot be converted to byte[]) constructor BigInteger.BigInteger(int[]) is not applicable (argumen...
s371812297
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int...
Main.java:12: error: no suitable constructor found for BigInteger(long) BigInteger x=new BigInteger((long)a); ^ constructor BigInteger.BigInteger(byte[]) is not applicable (argument mismatch; long cannot be converted to byte[]) constructor BigInteger.BigInteger(int[]) is not applicable ...
s531277101
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int...
Main.java:20: error: method isProbablePrime in class BigInteger cannot be applied to given types; if(y.isProbablePrime()){ ^ required: int found: no arguments reason: actual and formal argument lists differ in length 1 error
s502856937
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int...
Main.java:18: error: no suitable method found for valueOf(String) y=y.subtract(BigInteger.valueOf("1")); ^ method BigInteger.valueOf(long) is not applicable (argument mismatch; String cannot be converted to long) method BigInteger.valueOf(int[]) is not applicable (argument mis...
s450951047
p00044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class PrimeNumber2_0044 { public static void main(String[] args) { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); ArrayList<Integer> inputList = new...
Main.java:7: error: class PrimeNumber2_0044 is public, should be declared in a file named PrimeNumber2_0044.java public class PrimeNumber2_0044 ^ 1 error
s097266884
p00044
Java
import java.util.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class Main { void run(){ Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int n =sc.nextInt(); int min, max; for(max=p-1;!isP(max);max--); for(min=p+1;!isP(min);min++); System.out.println(max + " ...
Main.java:11: error: cannot find symbol for(max=p-1;!isP(max);max--); ^ symbol: variable p location: class Main Main.java:12: error: cannot find symbol for(min=p+1;!isP(min);min++); ^ symbol: variable p location: class Main 2 errors
s636016509
p00044
Java
import java.util.Scanner; public class Proc{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int[] v = new int[25025]; for(int i = 0;i < 25025;i++){ v[i] = 1; } int p = 3; while(true){ if(p*p > 50050){ break; }else{ if(v[(p-1)/2] == 0){ p += 2; }els...
Main.java:3: error: class Proc is public, should be declared in a file named Proc.java public class Proc{ ^ 1 error
s476427521
p00044
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; class Main { static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws Exception{ int N = 50022; int[] primes = new int...
Main.java:42: error: reached end of file while parsing System.out.println(prime_seq[in-1] + " " + prime_seq[in+1]) ^ 1 error
s657082387
p00044
C
#include<stdio.h> #define M 51000 int main(){ int i,j,p[M]={1,1}; for(i=2;i*i<M;i++){ if(p[i])continue; for(j=i*i;j<M;j+=i)p[j]=1; } while(~scanf("%d",&i)){ for(j=i-1;p[j];j--x); printf("%d ",j); for(j=i+1;p[j];j++); printf("%d\n",j); } return 0; }
main.c: In function 'main': main.c:10:23: error: expected ')' before 'x' 10 | for(j=i-1;p[j];j--x); | ~ ^ | )
s929890607
p00044
C
#include<stdio.h> int main(void){ int n, i, k, key1, key2, s[100000], l; for ( i = 1; i <= 100000; i++ ) { s[i] = 0; } for ( k = 2; k <= 100000; k++ ){ if (s[k] == 0) { for ( l = 2; l <= 100000 / k; l++ ) { s[k * l] = 1; } } } while ( scanf("%d", &n) !=...
main.c: In function 'main': main.c:29:4: error: expected declaration or statement at end of input 29 | return 0; | ^~~~~~
s546221507
p00044
C
int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
main.c: In function 'main': main.c:1:32: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i...
s700258941
p00044
C
#include <stdio.h>int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto r;} x=0;} r:; }return 0;}
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include <stdio.h>int j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto q;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==...
s776475014
p00044
C
#include <stdio.h> #define DATANUM 60000 int maxarray(int va[], int std1); int minarray(int vb[], int std2); int main(void) { int num[DATANUM] = {0}; int i, j, std; num[0] = 1; num[1] = 1; for(i = 2; i < DATANUM; i++) { if(i != 2 && i % 2 == 0) num[i] = 1; if(i != 3 && i ...
main.c:61:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 61 | ; i < DATANUM; i++) { | ^ main.c:61:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 61 | ; i < DATANUM; i++) { | ^~ main.c:68:5: error: expected identifier or '(...
s330575561
p00044
C
#include<iostream> #include<cstdio> int main() { int a[50001]={0}; int i,j; int n,c; a[2]=1; for(i=3;i<=50001;i+=2){ if(a[i]==2) continue; else if(a[i]==0){ a[i]=1; for(j=i*2;j<=50001;j+=i) a[j]=2; } } while(scanf("%d",&n)!=EOF){ for(i=n-1;i>1;i--){ if(a[i]==1){ printf("%d ",i); ...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s606471436
p00044
C
#include <stdio.h> #include <stdlib.h> #include <math.h> #define PI 3.14159265358979323 //void quick(int *,long long,long long); int main(){ int a,i,j,flag; char s[60000]; for(i=2;i<60000;i++) s[i]=1; i=2; while(i*i<60000){ j=i; while(i*j<60000){ s[i*j]=0; j++; } i++; while(s[i]==0) i+...
main.c:32:1: error: unterminated comment 32 | /*void qu | ^
s005518363
p00044
C++
#include <iostream> #include <algorithm> #include <math.h> using namespace std; bool isPrime(int num); int main(){ int n; while(cin >> n, n){ int prev = 0, next = 0; for(int i = num-2; i >= 3; i -= 2){ if(isPrime(i))( prev = i; break; } } for(int i = num+2; i <= 50000; i += 2){ if(isP...
a.cc: In function 'int main()': a.cc:13:29: error: 'num' was not declared in this scope; did you mean 'enum'? 13 | for(int i = num-2; i >= 3; i -= 2){ | ^~~ | enum a.cc:15:41: error: expected ')' before ';' token 15 | ...
s324164893
p00044
C++
#include<iostream> using namespace std; int main(){ int table[80000]={}; for(int i=2; i*i80000; ++i){ if(!table[i]){ for(int j=i*2; j<=80000; j+=i){ table[j]=1; } } } int n; while(cin >> n,n){ int i; for(i=n-1; table[i]; --i); cout << i << " "; for(i=n+1; table[...
a.cc: In function 'int main()': a.cc:6:18: error: 'i80000' was not declared in this scope 6 | for(int i=2; i*i80000; ++i){ | ^~~~~~
s421442959
p00044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int ans_ma; int ma_n = n + 1; int c_ma = 0; if(ma_n % 2 == 0){ ++ma_n; } for(int i = ma_n; ;i = i + 2){ int q = sqrt(i); if(q < 3){ ans_ma = q; break; } ...
a.cc: In function 'int main()': a.cc:51:27: error: expected primary-expression before '>' token 51 | for(int i = mi_n;i => 3;i = i - 2){ | ^
s214720145
p00044
C++
const int MAX_NUM = 100000000; bool prime_number[MAX_NUM]; void prime_create() { fill(prime_number, prime_number + MAX_NUM, true); prime_number[0] = prime_number[1] = false; for(int i = 2; i < MAX_NUM; i++) { if(prime_number[i]) for(int j = 2; i*j < MAX_NUM; j++) { prime_numb...
a.cc: In function 'void prime_create()': a.cc:5:5: error: 'fill' was not declared in this scope 5 | fill(prime_number, prime_number + MAX_NUM, true); | ^~~~
s324493588
p00044
C++
const int MAX_NUM = 100000000; bool prime_number[MAX_NUM]; void prime_create() { fill(prime_number, prime_number + MAX_NUM, true); prime_number[0] = prime_number[1] = false; for(int i = 2; i < MAX_NUM; i++) { if(prime_number[i]) for(int j = 2; i*j < MAX_NUM; j++) { prime_numb...
a.cc: In function 'void prime_create()': a.cc:5:5: error: 'fill' was not declared in this scope 5 | fill(prime_number, prime_number + MAX_NUM, true); | ^~~~
s509959633
p00044
C++
19 3517
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 19 | ^~
s601231541
p00044
C++
def create_prime(n): prime = [1] * (n + 1) prime[:2] = [0, 0] for i in range(len(prime)): if prime[i]: for j in range(2 * i, len(prime), i): prime[j] = 0 return prime def under(prime, n): for i in range(n - 1, -1, -1): if prime[i]: return i de...
a.cc:1:1: error: 'def' does not name a type 1 | def create_prime(n): | ^~~
s953910277
p00044
C++
require 'prime' while str=gets s=str.to_i low = -((1-s)..(-3)).find{|i| (i).prime? } high = ((s+1)..50000).find{|i| i.prime? } puts "#{low} #{high}" end
a.cc:1:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 1 | require 'prime' | ^~~~~~~ a.cc:1:1: error: 'require' does not name a type 1 | require 'prime' | ^~~~~~~ a.cc:5:5: error: 'high' does not name a type 5 | high = ((s+1)..50000).find{|i| i.pri...
s464372116
p00044
C++
#include <iostream> using namespace std; /*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/ const int MAX = 1000100; bool prime[MAX]; void sieve(){ fill(prime, prime+MAX, true); prime[0] = prime[1] = false; for(int i=2; i*i < MAX; i++){ if(!prime[i]) continue; for(int j=i*i; j < MAX; j += i) prime[j] = false; } } int main(){ in...
a.cc:5:1: error: unterminated comment 5 | /*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/ | ^
s097108153
p00044
C++
#include <iostream> using namespace std; /*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/ const int MAX = 1000100; bool prime[MAX]; void sieve(){ fill(prime, prime+MAX, true); prime[0] = prime[1] = false; for(int i=2; i*i < MAX; i++){ if(!prime[i]) continue; for(int j=i*i; j < MAX; j += i) prime[j] = false; } } int main(){ int ...
a.cc:5:1: error: unterminated comment 5 | /*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/ | ^
s979397878
p00044
C++
#include<vector> #include<cmath> #include<map> #include<cstdio> using namespace std; #define rep(i,a) for(int i = 0 ; i < a; i ++) #define loop(i,b,a) for(int i = b ; i < a; i ++) const int MAX = 50000; bool p[MAX]; void isPrime(){ fill(p,p + MAX,true); p[0] = p[1] = false; rep(i,MAX){ if(p[i]){ for(in...
a.cc: In function 'int main()': a.cc:25:9: error: 'cin' was not declared in this scope 25 | while(cin>>n){ | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include<cstdio> +++ |+#include <iostream> 6 | using na...
s757409437
p00044
C++
#include<iostream> using namespace std; #define rep(i,a) for(int i = 0 ; i < a ; i ++) #define loop(i,a,b) for(int i = a ; i < b ; i ++) const int M = (1e6); int p[M]; void isPrime(){ rep(i,M)p[i] = true; p[0] = p[1] = false; loop(i,2,M){ if(p[i]) for(int j = i + i ; j < M ; j += i) p[j] = false; } }...
a.cc: In function 'int main()': a.cc:21:12: error: 'prime' was not declared in this scope 21 | while(!prime[i]);cout<<i<<" "; | ^~~~~ a.cc:23:12: error: 'prime' was not declared in this scope 23 | while(!prime[i]);cout<<i<<endl; | ^~~~~
s514248716
p00044
C++
#include<iostream> using namespace std; #define rep(i,a) for(int i = 0 ; i < a ; i ++) #define loop(i,a,b) for(int i = a ; i < b ; i ++) const int M = (1e6); int p[M]; void isPrime(){ rep(i,M)p[i] = true; p[0] = p[1] = false; loop(i,2,M){ if(p[i]) for(int j = i + i ; j < M ; j += i) p[j] = false; } }...
a.cc: In function 'int main()': a.cc:21:12: error: 'prime' was not declared in this scope 21 | while(!prime[i]);cout<<i<<" "; | ^~~~~ a.cc:23:12: error: 'prime' was not declared in this scope 23 | while(!prime[i]);cout<<i<<endl; | ^~~~~
s458696823
p00044
C++
#include<iostream> using namespace std; #define rep(i,a) for(int i = 0 ; i < a ; i ++) #define loop(i,a,b) for(int i = a ; i < b ; i ++) const int M = (1e6); int p[M]; void isPrime(){ rep(i,M)p[i] = true; p[0] = p[1] = false; loop(i,2,M){ if(p[i]) for(int j = i + i ; j < M ; j += i) p[j] = false; } }...
a.cc: In function 'int main()': a.cc:21:12: error: 'prime' was not declared in this scope 21 | while(!prime[i]);cout<<i<<" "; | ^~~~~ a.cc:23:12: error: 'prime' was not declared in this scope 23 | while(!prime[i]);cout<<i<<endl; | ^~~~~
s404707126
p00044
C++
#include<iostream> using namespace std; #define rep(i,a) for(int i = 0 ; i < a ; i ++) #define loop(i,a,b) for(int i = a ; i < b ; i ++) const int M = (1e6); int p[M]; void isPrime(){ rep(i,M)p[i] = true; p[0] = p[1] = false; loop(i,2,M){ if(p[i]) for(int j = i + i ; j < M ; j += i) p[j] = false; } }...
a.cc: In function 'int main()': a.cc:21:12: error: 'prime' was not declared in this scope 21 | while(!prime[i]);cout<<i<<" "; | ^~~~~ a.cc:23:12: error: 'prime' was not declared in this scope 23 | while(!prime[i]);cout<<i<<endl; | ^~~~~
s083560169
p00044
C++
#include<iostream> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (scanf_s("%d",&n) != EOF) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int m) { int result = 0; while (true) { for (int i = m; ; i--) { for (int j = sqrt(i)+1;; j-...
a.cc: In function 'int main()': a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | while (scanf_s("%d",&n) != EOF) { | ^~~~~~~ | scanf a.cc: In function 'int primemax(int)': a.cc:18:38: error: 'sqrt' was not declared in this scope ...
s013562903
p00044
C++
#include<iostream> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (scanf("%d",&n) != EOF) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int m) { int result = 0; while (true) { for (int i = m; ; i--) { for (int j = sqrt(i)+1;; j--)...
a.cc: In function 'int primemax(int)': a.cc:18:38: error: 'sqrt' was not declared in this scope 18 | for (int j = sqrt(i)+1;; j--) { | ^~~~ a.cc: In function 'int primemin(int)': a.cc:31:46: error: 'sqrt' was not declared in this scope 31 | ...
s087006919
p00044
C++
#include<iostream> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (cin << n) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int m) { int result = 0; while (true) { for (int i = m; ; i--) { for (int j = sqrt(i)+1;; j--) { if ((i...
a.cc: In function 'int main()': a.cc:9:20: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 9 | while (cin << n) { | ~~~ ^~ ~ | | | | | int | std::istre...
s865437231
p00044
C++
#include<iostream> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (cin << n) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int m) { int result = 0; while (true) { for (int i = m; ; i--) { for (int j = sqrt(i)+1;; j--) { if ((i...
a.cc: In function 'int main()': a.cc:9:20: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 9 | while (cin << n) { | ~~~ ^~ ~ | | | | | int | std::istre...
s239503319
p00044
C++
#include<iostream> #include<math> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (scanf("%d",&n) != EOF) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int m) { int result = 0; while (true) { for (int i = m; ; i--) { for (int j = s...
a.cc:2:9: fatal error: math: No such file or directory 2 | #include<math> | ^~~~~~ compilation terminated.
s315928264
p00044
C++
#include<iostream> #include<math> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (cin >> n) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int m) { int result = 0; while (true) { for (int i = m; ; i--) { for (int j = sqrt(i)+1;; j-...
a.cc:2:9: fatal error: math: No such file or directory 2 | #include<math> | ^~~~~~ compilation terminated.
s196954626
p00044
C++
#include<iostream> #include<stdio.h> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (scanf("%d",&n) != EOF) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int m) { int result = 0; while (true) { for (int i = m; ; i--) { for (int j ...
a.cc: In function 'int primemax(int)': a.cc:19:38: error: 'sqrt' was not declared in this scope 19 | for (int j = sqrt(i)+1;; j--) { | ^~~~ a.cc: In function 'int primemin(int)': a.cc:32:46: error: 'sqrt' was not declared in this scope 32 | ...
s140749107
p00044
C++
#include<iostream> #include<stdio.h> using namespace std; int primemax(int m); int primemin(int m); int main() { int n; while (scanf_s("%d",&n) != EOF) { cout << primemax(n - 1) << " " << primemin(n + 1) << endl; } } int primemax(int n) { int t; for (n;; n--) { for (t = 2; t <= n; t++) { if (t == n) ...
a.cc: In function 'int main()': a.cc:10:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 10 | while (scanf_s("%d",&n) != EOF) { | ^~~~~~~ | scanf
s921383747
p00044
C++
#include <iostream> #include <string> #include <vector> #include <cstring> #include <climits> #include <algorithm> #include <map> using namespace std; bool is_prime(int p) { for (int i=2; i*i<=p; i++) { if (p % i == 0) return false; } return true; } int main() { int N; while (cin >> N) { ...
a.cc: In function 'int main()': a.cc:27:17: error: 'p1' was not declared in this scope 27 | cout << p1 << " " << p2 << endl; | ^~ a.cc:27:30: error: 'p2' was not declared in this scope 27 | cout << p1 << " " << p2 << endl; | ^~
s129706944
p00044
C++
#include <iostream> #include <string> #include <vector> #include <cstring> #include <climits> #include <algorithm> #include <map> using namespace std; bool is_prime(int p) { for (int i=2; i*i<=p; i++) { if (p % i == 0) return false; } return true; } int main() { int N; while (cin >> N) { ...
a.cc: In function 'int main()': a.cc:27:17: error: 'p1' was not declared in this scope 27 | cout << p1 << " " << p2 << endl; | ^~ a.cc:27:30: error: 'p2' was not declared in this scope 27 | cout << p1 << " " << p2 << endl; | ^~
s313742950
p00044
C++
asdf
a.cc:1:1: error: 'asdf' does not name a type 1 | asdf | ^~~~
s439286632
p00044
C++
from itertools import takewhile, dropwhile pn, tmp = [], [i for i in range(2, 50000)] while tmp[0] < 224: v = tmp.pop(0) pn.append(v) tmp = list(filter(lambda x: x%v!=0, tmp)) for t in tmp: pn.append(t) while True: try: n = int(input()) except: break print(list(takewhile(lambda x...
a.cc:1:1: error: 'from' does not name a type 1 | from itertools import takewhile, dropwhile | ^~~~
s112676915
p00044
C++
#include<iostream> using namespace std; bool isprime(int n) { if (n == 2)return true; if (n % 2 == 0)return false; for (int i = 3; i <= sqrt(n); i += 2) if (n%i == 0)return false; return true; } int main() { int n; while (cin >> n){ for (int i = n - 1; ; i--){ if (isprime(i)) { cout << i << ' '; brea...
a.cc: In function 'bool isprime(int)': a.cc:6:30: error: 'sqrt' was not declared in this scope 6 | for (int i = 3; i <= sqrt(n); i += 2) if (n%i == 0)return false; | ^~~~
s255876770
p00044
C++
#include <iostream>; using namespace std; int a[100000]; void sosuu() { a[0] = 2; int k, z = 1; for (int i = 3; i<100000; i++) { k = 0; for (int j = 0; a[j] <= sqrt(i); j++) { if (i%a[j] == 0) { k++; break; } } if (k == 0) { a[z] = i; z++; } } } int nibun(int n, int s, int e){ if (...
a.cc:1:20: warning: extra tokens at end of #include directive 1 | #include <iostream>; | ^ a.cc: In function 'void sosuu()': a.cc:11:41: error: 'sqrt' was not declared in this scope 11 | for (int j = 0; a[j] <= sqrt(i); j++) { | ...
s864026603
p00044
C++
#include <iostream>; using namespace std; int a[100000]; void sosuu() { a[0] = 2; int k, z = 1; for (int i = 3; i<100000; i++) { k = 0; for (int j = 0; a[j] <= sqrt(i); j++) { if (i%a[j] == 0) { k++; break; } } if (k == 0) { a[z] = i; z++; } } return; } int nibun(int n, int s, int ...
a.cc:1:20: warning: extra tokens at end of #include directive 1 | #include <iostream>; | ^ a.cc: In function 'void sosuu()': a.cc:11:41: error: 'sqrt' was not declared in this scope 11 | for (int j = 0; a[j] <= sqrt(i); j++) { | ...
s305481159
p00044
C++
#include <iostream>; using namespace std; int a[100000]; void sosuu() { a[0] = 2; int k, z = 1; for (int i = 3; i<100000; i++) { k = 0; for (int j = 0; a[j] <= sqrt(i); j++) { if (i%a[j] == 0) { k++; break; } } if (k == 0) { a[z] = i; z++; } } return; } int nibun(int n, int s, int ...
a.cc:1:20: warning: extra tokens at end of #include directive 1 | #include <iostream>; | ^ a.cc: In function 'void sosuu()': a.cc:11:41: error: 'sqrt' was not declared in this scope 11 | for (int j = 0; a[j] <= sqrt(i); j++) { | ...
s991484159
p00044
C++
#include <iostream> using namespace std; int prime[60000]; void sieve(){ memset(prime, 1, sizeof prime); int i; for(i = 2;i*i <= 60000;i++){ if(prime[i]){ for(int j = 2;i*j <= 60000;j++){ prime[i*j] = 0; } } } } int main(){ int n; sieve(); while (cin >> n){ for(int i = n-1;;i--){ if(prim...
a.cc: In function 'void sieve()': a.cc:9:9: error: 'memset' was not declared in this scope 9 | memset(prime, 1, sizeof prime); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#includ...
s628830083
p00044
C++
MAX = 60000 lst = [i for i in range(MAX)] lst[0] = lst[1] = 0 for i in range(MAX): if lst[i] != 0: for j in range(i * 2, MAX, i): lst[j] = 0 while 0 == 0: try: n = int(input()) i = n - 1 j = n + 1 while lst[i] == 0: i -= 1 while lst[j] == 0: j += 1 print(lst[i],lst[j]) ...
a.cc:1:1: error: 'MAX' does not name a type 1 | MAX = 60000 | ^~~
s738432022
p00044
C++
#include<iostream> using namespace std; int main() { bool prime[55001] = { false }; for (int i = 2; i <= sqrt(55000); i++) { if (!prime[i]) { for (int j = 2; i*j <= 55000; j++) { prime[i*j] = true; } } } int n; while (cin >> n) { for (int i = n-1;; i--) { if (!prime[i]) { cout << i << " "; ...
a.cc: In function 'int main()': a.cc:6:30: error: 'sqrt' was not declared in this scope 6 | for (int i = 2; i <= sqrt(55000); i++) { | ^~~~
s730501093
p00044
C++
#include<iostream> #include<vector> #define MAX 1000000 using namespace std; int main(){ vector<bool> v(MAX); for(int i = 0;i<MAX;i++) v[i]=true; v[0]=v[1]=false; for(int i = 2;i<1000;i++){ if(v[i]){ for(int j=i*i;j<MAX;j+=i){ v[j]=false; } } } while(...
a.cc: In function 'int main()': a.cc:22:13: error: 'i' was not declared in this scope 22 | while(i=n-1){ | ^ a.cc:22:15: error: 'n' was not declared in this scope 22 | while(i=n-1){ | ^ a.cc:29:11: error: 'i' was not declared in this scope 29 | while(i=n+1)...
s586562742
p00044
C++
#include <iostream> using namespace std; #define N 50000 int main(){ int n; bool is_prime[N]; is_prime[0] = is_prime[1] = false; for(int i=2; i<N;i++){ is_prime[i] = true; } for(int i=2; i*i<N; i++){ if(is_prime[i]){ for(int j=i*i;j<N; j+=i){ is_prime[j] = false...
a.cc: In function 'int main()': a.cc:39:7: error: 'retrurn' was not declared in this scope 39 | retrurn 0; | ^~~~~~~
s019179862
p00044
C++
#include <iostream> using namespace std; int main(){ bool is_prime[50001]; is_prime[0]=is_prime[1]=false; for(int i=2;i<50001;i++){ is_prime[i] = true; } for(int i=2;i*i<50001;i++){ if(is_prime[i]){ for(int j=i*i;j<50001;j=j+i){ is_prime[j] = false; } } } int n_prime[50...
a.cc: In function 'int main()': a.cc:23:28: error: expected primary-expression before '<' token 23 | for(int i=0;i<50001;i++){<50001 | ^
s697192308
p00044
C++
#include<iostream> #include<vector> int main() { std::vector<bool>is_prime(50020, true); const int root = static_cast<int>(floor(sqrt(50021))); for (int i = 0; i <= root - 2; i++) { if (is_prime[i]) { for (int j = i + 2; (i + 2) * j < 50021; j++) { is_prime[(i + 2) * j - 2] = false; } } } for (...
a.cc: In function 'int main()': a.cc:6:49: error: 'sqrt' was not declared in this scope 6 | const int root = static_cast<int>(floor(sqrt(50021))); | ^~~~ a.cc:6:43: error: 'floor' was not declared in this scope 6 | const int root = static_cas...
s705542412
p00044
C++
j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto qq;} x=0;}q:for(i=n+1;;i++){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d\n",i); goto rr;} x=0;} r:; }return 0;}
a.cc:1:1: error: 'j' does not name a type 1 | j,i,n,x=0;int main(){while(scanf("%d",&n)!=EOF){for(i=n-1;;i--){for(j=2;j*j<=i;j++){ if(j!=i){if(i%j==0){x=1;}}}if(x==0) {printf("%d ",i); goto qq;} | ^ a.cc: In function 'int main()': a.cc:1:40: error: 'n' was not declared in this scope 1 | j,i,n,x=0;int m...
s755678997
p00044
C++
#include <iostream> using namespace std; #define MAX 1000000 int prime[MAX]; void is_prime(){ for(int i = 0 ; i < MAX ; i++) prime[i] = 1; prime[0] = prime[1] = 0; for(int i = 2 ; i*i < MAX ; i++){ if(prime[i] = 1){ for(int j = 2*i ; j < MAX ; j += i){ prime[j] = 0; } } } } int...
a.cc: In function 'int main()': a.cc:27:13: error: 'i' was not declared in this scope 27 | cout << i << ' '; | ^
s928295153
p00044
C++
#include <iostream> using namespace std; #define MAX 1000000 int prime[MAX]; void is_prime(){ for(int i = 0 ; i < MAX ; i++) prime[i] = 1; prime[0] = prime[1] = 0; for(int i = 2 ; i*i < MAX ; i++){ if(prime[i] = 1){ for(int j = 2*i ; j < MAX ; j += i){ prime[j] = 0; } } } } int...
a.cc: In function 'int main()': a.cc:27:13: error: 'i' was not declared in this scope 27 | cout << i << ' '; | ^ a.cc:30:13: error: 'j' was not declared in this scope 30 | cout << j << endl; | ^
s279658143
p00044
C++
#include <iostream> using namespace std; #define MAX 50100 int main(void){ bool prime[MAX] = false; prime[0] = prime[1] = true; for(int i = 2 ; i*i <= MAX-1 ; i++){ if(!prime[i]){ for(int j = i*2 ; j <= MAX - 1 ; j += i){ prime[j] = true; } } } int n; while(cin >> n){ for(...
a.cc: In function 'int main()': a.cc:6:21: error: array must be initialized with a brace-enclosed initializer 6 | bool prime[MAX] = false; | ^~~~~
s728912614
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Program { static void Main(string[] args) { var primeList = new List<int>(); for (int i = 1; i < 50022; i++) { if (IsPrime(i)) { primeL...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(stri...
s820246658
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Program { static void Main(string[] args) { var primeList = new List<int>(); for (int i = 1; i < 50022; i++) { if (IsPrime(i)) { primeL...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(stri...
s576275698
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Program { static void Main(string[] args) { var primeList = new List<int>(); for (int i = 1; i < 50022; i++) { if (IsPrime(i)) { primeL...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(stri...
s945964003
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Programs { static void Main(string[] args) { var primeList = new List<int>(); for (int i = 1; i < 50022; i++) { if (IsPrime(i)) { prime...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(stri...
s684176351
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Programs { static void Main(string[] args) { List<int> primeList = new List<int>(); for (int i = 1; i < 50022; i++) { if (IsPrime(i)) { ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(stri...
s407767202
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Programs { static void Main(string[] args) { List<int> primeList = new List<int>(); for (int i = 1; i < 50022; i++) { if (IsPrime(i)) { ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(stri...
s618014727
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Programs { static void Main(string[] args) { List<int> primeList = new List<int>(); for (int i = 1; i < 50022; i++) { if (IsPrime(i)) { ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(stri...
s273481226
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Programs { readonly static int MAX_NUMBER = 50022; static void Main(string[] args) { List<int> primeList = new List<int>(); for (int i = 1; i < MAX_NUMBER; i++) { ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:9: error: 'readonly' does not name a type 8 | readonly static int M...
s408983832
p00044
C++
using System; using System.Collections.Generic; namespace _0044 { class Programs { readonly static int MAX_NUMBER = 50022; static void Main(string[] args) { List<int> primeList = new List<int>(); for (int i = 1; i < MAX_NUMBER; i++) { ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:8:9: error: 'readonly' does not name a type 8 | readonly static int M...
s456253570
p00044
C++
#include <iostream> #include <vector> using namespace std; typedef vector <int> vi; #define REP1(i,n1,n2) for (int i=n1; i<n2; i++) vi primes; int get_primes(int m){ int n = (m+1)/2, root = (int)(pow(n, 0.5)); vector <bool> N(n, true); N[0]=false; if (m>1) primes.push_back(2); REP1(i,1,root){ ...
a.cc: In function 'int get_primes(int)': a.cc:9:35: error: 'pow' was not declared in this scope 9 | int n = (m+1)/2, root = (int)(pow(n, 0.5)); | ^~~
s078905185
p00045
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; int sum=0; int amount=0; int p=0; int q=0; int count=0; while((line=br.readLine())!=null){ String[] values=line.split(","); p=Integer.parseInt...
Main.java:21: error: cannot find symbol System.out.println(Math.round((flaot)amount/count)); ^ symbol: class flaot location: class Main 1 error
s625593667
p00045
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class AOJ_0045 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); A...
Main.java:6: error: class AOJ_0045 is public, should be declared in a file named AOJ_0045.java public class AOJ_0045 ^ 1 error
s484606853
p00045
Java
public class Main { public static void main(String[] args) { int price; int n; int all = 0; int allN = 0; int rCount = 0; for (Scanner in = new Scanner(System.in); in.hasNext();) { String[] r = in.next().split(","); price = Integer.parseInt(r[0]); n = Integer.parseInt(r[1]); all += price * n; ...
Main.java:8: error: cannot find symbol for (Scanner in = new Scanner(System.in); in.hasNext();) { ^ symbol: class Scanner location: class Main Main.java:8: error: cannot find symbol for (Scanner in = new Scanner(System.in); in.hasNext();) { ^ symbol: class Scanner location...
s236958413
p00045
Java
import java.io.*; class Main { public static void main(String args[])throws IOException { BufferedReader input=new BufferedReader(new InputStreamReader(System.in)); String str; int sum=0; float n=0,ave,j=1f; while((str=input.readLine())!=null) { String str_ary[]=str.split(","); int a[]=new int[2]...
Main.java:27: error: variable ave might not have been initialized System.out.println(sum+"\n"+(int)(ave)); ^ 1 error
s434076955
p00045
C
#include <stdio.h> int main(void) { int a, b, sum_a = 0, sum_b = 0, c = 0; int syousuu = 0; while (scanf("%d,%d", &a, &b) != EOF){ sum_a += a * b; sum_b += b; c++; } if (sum_b % c != 0 && 2 * (sum_b % c) >= c){ syousuu = 1; } printf("%d\n%d\n", sum_a, syousuu + sum_b / c;); return (0); }
main.c: In function 'main': main.c:17:54: error: expected ')' before ';' token 17 | printf("%d\n%d\n", sum_a, syousuu + sum_b / c;); | ~ ^ | )
s143314943
p00045
C
#include<stdio.h> int main(void){ int a, b, c, sum, i, n, ave2; double ave; while(scanf("%d, %d", &a, &b) = EOF){ sum = sum + a * b; n = n + b; } ave = su / n; ave = ave * 2; ave2 = ave / 2; printf("%d\n%d\n", sum, ave2); return 0; }
main.c: In function 'main': main.c:5:34: error: lvalue required as left operand of assignment 5 | while(scanf("%d, %d", &a, &b) = EOF){ | ^ main.c:9:10: error: 'su' undeclared (first use in this function); did you mean 'sum'? 9 | ave = su / n; | ^~ ...
s789951058
p00045
C
#include<stdio.h> int main(void){ int a, b, sum, n, ave2; double ave; sum = 0; n = 0; while ( scanf("%d, %d", &a, &b) != EOF ){ sum = sum + a * b; n = n + b; k++; } ave = n / k; ave = ave + 0.5; ave2 = ave; printf("%d\n%d\n", sum, ave2); return 0; }
main.c: In function 'main': main.c:10:7: error: 'k' undeclared (first use in this function) 10 | k++; | ^ main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
s996785979
p00045
C
#include<stdio.h> int main(void){ ??????int a, b, sum, n, ave, k; ??????sum = 0; ??????n = 0; ??????k = 0; ??????while ( scanf("%d,%d", &a, &b) != EOF ){ ????????????sum = sum + a * b; ????????????n = n + b; ????????????k++; ??????} ??????ave = n / k * 10 + 5 / 2; ??????printf("%d\n%d\n", sum, ave); ??????...
main.c: In function 'main': main.c:5:1: error: expected expression before '?' token 5 | ??????int a, b, sum, n, ave, k; | ^ main.c:7:1: error: expected expression before '?' token 7 | ??????sum = 0; | ^ main.c:7:7: error: 'sum' undeclared (first use in this function) 7 | ??????sum = 0; | ...
s768121653
p00045
C
#include<stdio.h> int main(void){ int a, b, sum, n, ave, k; sum = 0; n = 0; k = 0; while ( scanf("%d,%d", &a, &b) != EOF ){ sum = sum + a * b; n = n + b; k++; } ave = ( n / k * 10 + 5 ) / 10; printf("%d\n%d\n", sum, ave2); return 0; }
main.c: In function 'main': main.c:13:28: error: 'ave2' undeclared (first use in this function); did you mean 'ave'? 13 | printf("%d\n%d\n", sum, ave2); | ^~~~ | ave main.c:13:28: note: each undeclared identifier is reported only once for each func...
s154838812
p00045
C
#include<stdio.h> int main(){ int a, b, sum, n, ave, k; sum = 0; n = 0; k = 0; while ( scanf("%d,%d", &a, &b) != EOF ){ sum = sum + a * b; n = n + b; k++; } ave = ( n / k * 10 + 5 ) / 10; printf("%d\n%d\n", sum, ave2); return 0; }
main.c: In function 'main': main.c:13:28: error: 'ave2' undeclared (first use in this function); did you mean 'ave'? 13 | printf("%d\n%d\n", sum, ave2); | ^~~~ | ave main.c:13:28: note: each undeclared identifier is reported only once for each func...