submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s281867000
p00139
C
char s[101];A(){char a[101],b[101],t,t2;return sscanf(s,">'%[=]#%[=]%c%c",a,b,&t,&t2)==3&&t=='~'&&strlen(a)==strlen(b);}B(){short*q;char*p=s,l=0;if(*(q=p++)=='^>'){for(;*(q=++p)=='=Q';p++)l++;if(l>0&&*(q=p++)=='~~'&&*++p==0)return 1;}return 0;}main(){scanf("%*d\n");for(;~scanf("%[^\n]\n",s);){if(A())puts("A");else if(B...
main.c:1:13: error: return type defaults to 'int' [-Wimplicit-int] 1 | char s[101];A(){char a[101],b[101],t,t2;return sscanf(s,">'%[=]#%[=]%c%c",a,b,&t,&t2)==3&&t=='~'&&strlen(a)==strlen(b);}B(){short*q;char*p=s,l=0;if(*(q=p++)=='^>'){for(;*(q=++p)=='=Q';p++)l++;if(l>0&&*(q=p++)=='~~'&&*++p==0)return 1;}return 0;}m...
s513067872
p00139
C
#include<stdio.h> int main(void){ char w[201]; int a,i,j,k; a=getchar(); for(j=0;j<a;j++){ gets(w); if(w[0]!='>'){printf("NA\n");goto la;} if(w[1]=='\''){ int c; for(i=2;w[i]!='#';i++){ if(w[i]!='='){printf("NA\n");goto la;} c++; } i++; for(k=0;k<c;k++){ if(w[i++]!=...
main.c: In function 'main': main.c:8:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | gets(w); | ^~~~ | fgets
s312332447
p00139
C
#include <stdio.h> int main(int argc, const char * argv[]) { int num; int i, j, k, l; scanf("%d", &num); for (l = 0; l < num + 1; l++) { char snake[200]; int bodyacnt = 0; int bodybcnt = 0; int midcnt = 0; int endacnt = 0; int endbcnt = 0; in...
main.c: In function 'main': main.c:34:17: error: expected '}' before 'else' 34 | else nacnt++; | ^~~~ main.c:62:13: error: 'bodybcnt' undeclared (first use in this function) 62 | if (bodybcnt > 0 && endbcnt == 1 && nacnt == 0){ | ^~~~~~~~ main.c:62:1...
s223803985
p00139
C
#include <stdio.h> int main(int argc, const char * argv[]) { int num; int i, j, k, l; char snake[200]; int bodyacnt = 0; int bodybcnt = 0; int midcnt = 0; int endacnt = 0; int endbcnt = 0; int nacnt = 0; scanf("%d", &num); for (l = 0; l < num + 1; l++) { snake[2...
main.c: In function 'main': main.c:17:22: error: expected expression before '{' token 17 | snake[200] = {0}; | ^ main.c:41:17: error: expected '}' before 'else' 41 | else nacnt++; | ^~~~ main.c: At top level: main.c:78:5: error: expected ide...
s235308415
p00139
C
#include <stdio.h> int main(int argc, const char * argv[]) { int num; int i, j, k, l; char snake[200]; int bodyacnt = 0; int bodybcnt = 0; int midcnt = 0; int endacnt = 0; int endbcnt = 0; int nacnt = 0; scanf("%d", &num); for (l = 0; l < num + 1; l++) { snake[2...
main.c: In function 'main': main.c:17:22: error: expected expression before '{' token 17 | snake[200] = {0}; | ^
s112773985
p00139
C++
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; for(int i = 0; i < n; i++) { string s; cin >> s; bool a[4] = {}, b[3] = {}; int cnt = 0; for(int j = 0; j < s.size(); j++) { if(s[j] == '>') { if(!a[1] && s[j+1] == ''') a[0] = true; if(s[...
a.cc:13:31: error: empty character constant 13 | if(!a[1] && s[j+1] == ''') a[0] = true; | ^~ a.cc:13:33: warning: missing terminating ' character 13 | if(!a[1] && s[j+1] == ''') a[0] = true; | ^ a.cc:13:33: error: missing t...
s873124361
p00139
C++
#include<iostream> #include<string> using namespace std; int main(void){ string str; int n; cin>>n; while(n--){ cin>>str; int ca = 0; int cntsha = 0; bool a = true; if(str.size()%2 == 0){ if(str[str.size() / 2] == '#')str[str.size()/2] = '='; for(int i = 2 ; i < str.size() - 1 ;...
a.cc:59:5: error: redefinition of 'int main()' 59 | int main(void){ | ^~~~ a.cc:5:5: note: 'int main()' previously defined here 5 | int main(void){ | ^~~~
s798187683
p00139
C++
#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <utility> #include <stack> #include <queue> #include <map> #include <set> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #de...
a.cc: In function 'int main()': a.cc:45:65: error: expected ';' before ')' token 45 | for (int i = 2; i < s.size() - 1) { | ^ | ;
s797087883
p00139
C++
#include <string> #include <iostream> using namespace std; int n; string s; bool check() { if(s.size() < 6) return 0; if(s[0] != '>') return 0; if(s[1] != '\'') { int cnt = 0; for(int i = 2; i < s.size() - 1; i++) { if(s[i] != '=') break; cnt++; } if(s[2 + cnt] != '#') return 0; for(int j = cnt + 3; ...
a.cc: In function 'bool check()': a.cc:16:30: error: 'i' was not declared in this scope 16 | if(s[i] != '=') break; | ^
s989626371
p00139
C++
#include <iostream> #define NA cout << "NA" << endl; goto LABEL using namespace std; int main() { int snakeCount; cin >> snakeCount; for(int loopCount = 0; loopCount < snakeCount; loopCount++) { char arr[201]; ???in >> arr; int i = 0; if(arr[i]!='>') { NA; } i++; if(arr[i]=='\'') { int equ...
a.cc: In function 'int main()': a.cc:14:17: error: expected primary-expression before '?' token 14 | ???in >> arr; | ^ a.cc:14:18: error: expected primary-expression before '?' token 14 | ???in >> arr; | ^ a.cc:14:19: error: expected pri...
s474514801
p00139
C++
#include <iostream> #include <string> using namespace std; string solv(string s){ int ss = s.size(); if(s[0] != '>' || s[ss-1] != '~')return "NA"; if(s[ss-2] == '~'){ if(s[1] != '^')return "NA"; for(int i = 0;i < ss-2;i++){ if(s[i] == 'Q' && s[i+1] == '=')return "B"; } }else{ fi(s[1] != ''')return "NA";...
a.cc:14:28: error: empty character constant 14 | fi(s[1] != ''')return "NA"; | ^~ a.cc:14:30: warning: missing terminating ' character 14 | fi(s[1] != ''')return "NA"; | ^ a.cc:14:30: error: missing terminating ' c...
s625689710
p00139
C++
#include<iostream> #include<string> using namespace std; int main(){ int n,size; string s,a,b; for(cin>>n;n>0;n--){ cin>>s; size = s.size(); if(size%2){cout<<"NA"<<endl;continue} a=">'"; b=">^"; for(int i=0;i<size/2-2;i++){a=a+"=";b=b+"Q=";} a+="#"; for(int i=0;i<size/2-2;i++){a=a+...
a.cc: In function 'int main()': a.cc:10:41: error: expected ';' before '}' token 10 | if(size%2){cout<<"NA"<<endl;continue} | ^ | ;
s831674028
p00139
C++
import java.lang.*; import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=0;i<n;i++){ String s=sc.next(); if(s.matches("^>'(=+)#\\1~$")) System.out.println("A"); else if(s.matches("^>\\^(Q=)+~~$")) System.out.pri...
a.cc:1:1: error: 'import' does not name a type 1 | import java.lang.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1...
s196853041
p00139
C++
#include <iostream> #include <string> using namespace std; int main() { int n; string snake; int idx; int count; cin >> n; getline(cin,snake); for(int i=0;i<n;i++) { getline(cin,snake); //明らかにどちらのヘビでもない if(snake[0]!='>') { cout << "NA" << endl; break; } else...
a.cc: In function 'int main()': a.cc:132:19: error: 'p' was not declared in this scope 132 | goto NA;p | ^
s668691960
p00139
C++
#include <stdio.h> #include <math.h> int main(){ int syucnt[1000]={0},n,i,t,l,gou=0; char input[10000]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s",input); l = strlen(input); if(input[l-1]=='~'&&input[l-2]=='~'){//B種の調べ for(t=2;t<=l-4;t=t+2){ if(input[t]=='Q'&&input[t+1]=...
a.cc: In function 'int main()': a.cc:9:21: error: 'strlen' was not declared in this scope 9 | l = strlen(input); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <math.h> +++ |+#in...
s959987430
p00139
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int Tc; string s; while(cin>>Tc) { while(Tc--) { cin >> s; int const N = s.size(); bool NA = 0; bool isA; if(s[0] != '>') NA = 1; if(s[1] == '\'') { for(int i=2; i<(N-3)/2+2; i++) if(s[i]!='=') NA=1...
a.cc: In function 'int main()': a.cc:27:30: error: expected ';' before 'isA' 27 | if(cnt+2 != N) NA = 1 | ^ | ; 28 | isA = 0; | ~~~
s178823101
p00139
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int Tc; string s; while(cin>>Tc) { while(Tc--) { cin >> s; int const N = s.size(); bool NA = 0; bool isA; if(s[0] != '>') NA = 1; if(s[1] == '\'') { for(int i=2; i<(N-3)/2+2; i++) ...
a.cc: In function 'int main()': a.cc:28:30: error: expected ';' before 'isA' 28 | if(cnt+2 != N) NA = 1 | ^ | ; 29 | isA = 0; | ~~~
s447625713
p00140
C
#include <bits/stdc++.h> using namespace std; int main(){ int n, src, dir = 1, dst, spc; cin >> n; for(int i=0;i<n;i++){ cin >> src >> dst; spc = 0; if(src<dst || (src>dst && src>=6))dir = 1; else dir = -1; int j=0; do{ if(src+j>9){ j=5-src; dir = -1; } if(spc++ != 0)cout << " "; cou...
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s300247453
p00140
C
#include<stdio.h> int main(){ int n,a,b,i; scanf("%d",&n); while(n-->0){ scanf("%d %d",&a,&b); if(a>=0&&5>=a){ if(b>a){ for(i=a;i<b;i++) printf("%d ",i); printf("%d\n",b); } else { for(i=a;i>b;i--) printf("%d ",i); printf("%d\n",b); } } else { if(b>5&&10>b&&b>a){ for(i=a;i<b;i++) printf("%d ",i); printf("%d\n",b); } el...
main.c: In function 'main': main.c:45:1: error: expected declaration or statement at end of input 45 | } | ^
s283686932
p00140
C
#include <stdio.h> int main(void) { int datanum,datamax; int start,end; int i; scanf("%d",&datamax); for(datanum=0;datanum<datamax;datanum++) { scanf("%d %d",&start,&end); if(start<=5 && end<start) { for(i=start;i>=end;i--) { printf("%d",i); if(i>end)printf(" "); } } else if(start<=5 && end>st...
main.c:45:9: error: expected identifier or '(' before 'return' 45 | return 0; | ^~~~~~ main.c:46:1: error: expected identifier or '(' before '}' token 46 | } | ^
s988174633
p00140
C
#include <stdio.h> int main(void) { int datanum,datamax; int start,end; int i; scanf("%d",&datamax); for(datanum=0;datanum<datamax;datanum++) { scanf("%d %d",&start,&end); if(start<=5 && end<start) { for(i=start;i>=end;i--) { printf("%d",i); if(i>end)printf(" "); } } else if(start<=5 && end>st...
main.c:45:9: error: expected identifier or '(' before 'return' 45 | return 0; | ^~~~~~ main.c:46:1: error: expected identifier or '(' before '}' token 46 | } | ^
s899061354
p00140
C
#include <stdio.h> int main(void) { int datanum,datamax; int start,end; int i; scanf("%d",&datamax); for(datanum=0;datanum<datamax;datanum++) { scanf("%d %d",&start,&end); if(start<=5 && end<start) { for(i=start;i>=end;i--) { printf("%d",i); if(i>end)printf(" "); } } else if(start<=5 && end>st...
main.c:45:9: error: expected identifier or '(' before 'return' 45 | return 0; | ^~~~~~ main.c:46:1: error: expected identifier or '(' before '}' token 46 | } | ^
s188267760
p00140
C
#include <Stdio.h> #include <math.h> int main(void) { int bus_stop[15] = {0,1,2,3,4,5,6,7,8,9,5,4,3,2,1}; int start, end, spin, n_spin; int num, i, j, idx1, idx2; scanf("%d", &num); while(num--) { scanf("%d %d", &start, &end); for(j = 0; j < 10; j++) { ...
main.c:1:10: fatal error: Stdio.h: No such file or directory 1 | #include <Stdio.h> | ^~~~~~~~~ compilation terminated.
s988198973
p00140
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cassert> #include <vector> #include <string> #include <cmath> #include <map> using namespace std; const int MAX= 10000100; #define loop(i,a,b) for(int i = a ; i < b ; i ++) #define rep(i,a) loop(i,0,a) #define all(a) (a).begin(),(a).end() #define ...
a.cc:22:2: error: invalid preprocessing directive #deefine; did you mean #define? 22 | #deefine N 15 | ^~~~~~~ | define a.cc:23:7: error: 'N' was not declared in this scope 23 | int d[N] = {0, 1, 2, 3, 4, 5 ,6 ,7 ,8 ,9 ,5 ,4 ,3 ,2 ,1}; | ^ a.cc: In function 'int main()': a.cc:33:11: erro...
s322307748
p00140
C++
#include<stdio.h> int main(){ int n,s,f; int w; while(1){ scanf("%d",&n);if(n==0)break; for(int i=0;i<n;i++) scanf("%d %d",&s,&f); if(s<=5){ if(s<f){ for(int i=s;i<=f;i++) { if(i!=s)printf(" "); printf("%d",i); } } else if(s>f){ for(int i=s;i>=f;i--) { if(i!=s)printf(" "); printf("%d",i); } } if(s>5){ if(f...
a.cc: In function 'int main()': a.cc:55:2: error: expected '}' at end of input 55 | } | ^ a.cc:8:9: note: to match this '{' 8 | while(1){ | ^ a.cc:55:2: error: expected '}' at end of input 55 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s877082216
p00140
C++
import java.util.Scanner; import java.util.ArrayList; import java.util.Iterator; import java.util.Collections; import java.util.Comparator; class Main{ public static void main(String args[]){ Scanner in = new Scanner(System.in); int d[]={9,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9}; int n = in.nextInt(); for(int i = 0...
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: 'import' does not name a type 2 | import java.util.ArrayList; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodule...
s389722728
p00140
C++
int main() { const int busstop[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; const int bussize = sizeof(busstop) / sizeof(int); int n; while (cin >> n) { while (n--) { int a, b; cin >> a >> b; int s = 0; for (; s < bussize; ++s) { if (busstop[s] ...
a.cc: In function 'int main()': a.cc:7:10: error: 'cin' was not declared in this scope 7 | while (cin >> n) { | ^~~ a.cc:18:7: error: 'vector' was not declared in this scope 18 | vector<int> ans; | ^~~~~~ a.cc:18:14: error: expected primary-expression before 'int' 18 | ...
s114721271
p00140
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int num[]={0,1,2,3,4,5,6,7,8,9,5,4,3,2,1,0}; for(int i=0,x,y;i<n;i++){ cin>>x>>y; if(x<6&&y<6&&y-x>0){ cout<<num[x]; for(int j=x+1;j<=y;j++)cout<<" "<<num[j]; cout<<endl; ...
a.cc: In function 'int main()': a.cc:28:6: error: expected '}' at end of input 28 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s432671545
p00140
C++
#include <iostream> using namespace std; int s[15] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 4, 3, 2, 1}; void disp(int a, int b){ for(int i = a+1;;i++){ cout << " " << s[i%15]; if(s[i%15] == b){cout << endl;return 0;} } } int main(){ int n, a, b;cin >> n; while(n--){ cin >> a >> b;cout << a; if(6 <= a && a <= ...
a.cc: In function 'void disp(int, int)': a.cc:8:54: error: return-statement with a value, in function returning 'void' [-fpermissive] 8 | if(s[i%15] == b){cout << endl;return 0;} | ^
s731469887
p00140
C++
int main(){int s,t,d,n;scanf("%d",&n);while(n--){scanf("%d %d",&s,&t);d=(t<s&&s<6)? -1:1;while(t!=s){printf("%d ",s);s+=d;if(s>9){d=-1;s=5;}elseif(s<0){d=1;s=1;}}printf("%d\n",t);}return 0;}
a.cc: In function 'int main()': a.cc:1:24: error: 'scanf' was not declared in this scope 1 | int main(){int s,t,d,n;scanf("%d",&n);while(n--){scanf("%d %d",&s,&t);d=(t<s&&s<6)? -1:1;while(t!=s){printf("%d ",s);s+=d;if(s>9){d=-1;s=5;}elseif(s<0){d=1;s=1;}}printf("%d\n",t);}return 0;} | ^...
s144031501
p00141
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import static java.lang.Integer.parseInt; /** * Spiral Pattern */ public class P0141 { static final int[][] DIR = { {-1, 0}, {0, 1}, {1, 0}, {0, -1}, }; public static void main(Stri...
Main.java:11: error: class P0141 is public, should be declared in a file named P0141.java public class P0141 { ^ 1 error
s406305991
p00141
C
#include<stdio.h> #include<string.h> int N,s,i,j,mv[4][2]={{0,-1},{1,0},{0,1},{-1,0}},x,y,S,r; char M[105][105],E[3][30]={"#","##\n#","###\n# #\n# #"}; int c(int n){return 0<=n-1&&n+1<100;} int c2(int x,int y) { int i,m[5]={1,0,-1,0,1},c=0,c2=0; for(i=0;i<4;i++) { if(M[y+m[i]][x+m[i+1]]=='#')c++; if((mv[i][1]&...
main.c: In function 'main': main.c:21:36: error: expected ';' before ')' token 21 | for(scanf("%d",&N);puts("")) | ^ | ;
s236143090
p00141
C++
d = gets.to_i d.times do |i| n = gets.to_i a = Array.new(n).map { Array.new(n, 0) } a.map! {|r| [9] + r + [9]} a.unshift [9] * (n + 2) a<< [9] * (n + 2) y = n x = 1 dy = -1 dx = 0 loop do a[y][x] = 1 if a[y + dy][x + dx] == 0 a[y + dx][x - dy] = 9 ...
a.cc:29:7: error: too many decimal points in number 29 | a[1..-2].each do |r| | ^~~ a.cc:30:47: error: empty character constant 30 | puts r.map {|x| x == 1 ? '#' : ' '} * '' | ^~ a.cc:1:1: error: 'd' does not name a type 1 | d = gets....
s708768147
p00141
C++
d = gets.to_i d.times do |i| n = gets.to_i a = Array.new(n).map { Array.new(n, 0) } a.map! {|r| [9] + r + [9]} a.unshift [9] * (n + 2) a<< [9] * (n + 2) y = n x = 1 dy = -1 dx = 0 loop do a[y][x] = 1 if a[y + dy][x + dx] == 0 a[y + dx][x - dy] = 9 ...
a.cc:29:7: error: too many decimal points in number 29 | a[1..-2].each do |r| | ^~~ a.cc:30:16: error: too many decimal points in number 30 | puts r[1..-2].map {|x| x == 1 ? '#' : ' '} * '' | ^~~ a.cc:30:54: error: empty character constant 30 | puts r[1..-2]...
s780725581
p00141
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <queue> #include <stack> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <cmath> #include <complex> #include <map> #include <climits> #include <sstream> using namespace std; #define reep(i,a,b) for(int i=(a);i<(b);++...
a.cc: In function 'int main()': a.cc:47:20: error: 'i' was not declared in this scope 47 | if(i) cout<<endl; | ^
s227032673
p00141
C++
#include <iostream> #include <string> using namespace std; int d; string map[105]; int n; void visit() { int dx[4] = {0,1,0,-1}; int dy[4] = {-1,0,1,0}; int sum, flg = 0; int x = 2,y = n; map[y][x] = ' '; int ab[4] = {2,2,2,2}; while(1) { sum = 0; while(1) { if(map[y+dy[flg]*2][x+dx[flg...
a.cc: In function 'int main()': a.cc:77:9: error: expected ';' before '}' token 77 | return 0 | ^ | ; 78 | } | ~
s168767529
p00141
C++
#include <iostream> #include <string> using namespace std; ?? int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1}; ?? int main(){ int d; cin >> d; for(int t = 0;t < d;t++){ if(t) cout << endl; char s[100][100]; int n; cin >> n; for(int i = 0;i < n;i++){ for(int j = 0;j < n;j++) s[i][j] = ' '; } ...
a.cc:7:1: error: expected unqualified-id before '?' token 7 | ?? | ^ a.cc:9:22: error: expected unqualified-id before ',' token 9 | int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1}; | ^ a.cc:9:28: error: expected constructor, destructor, or type conversion before '=' token 9 | int dx...
s719229739
p00141
C++
#include <iostream> #include <string> #include <algorithm> #include <math.h> #include <vector> #include <set> using namespace std; typedef long long LL; static const double EPS = 1e-9; #define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i) #define REP(i,n) FOR(i,0,n) int nx,ny,nr; int dx[4] = {1,0,-1,0}; int dy[4] = {0...
a.cc: In function 'int main()': a.cc:42:5: error: 'memset' was not declared in this scope 42 | memset(a,0,sizeof(a)); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <set> +++ |+#include <cstring> 7 |
s894289504
p00141
C++
ar MAP[104][104]; int nx,ny,vx=0,vy=-1; void rotate(){ //‰E‰ñ‚è‚ɉñ“]‚·‚é int tx=vx,ty=vy; vx=-ty;vy=tx; } int main(){ int s; //ƒ}ƒbƒv‚̍L‚³ int n; //ˆ—‚·‚éŒÂ” int t; //I—¹”»’è—p scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&s); memset(MAP,'#',104*104); for(int x=1;x<1+s+2;x++){ for(int y=1;y<1+...
a.cc:1:1: error: 'ar' does not name a type; did you mean 'char'? 1 | ar MAP[104][104]; | ^~ | char a.cc: In function 'int main()': a.cc:11:9: error: 'scanf' was not declared in this scope 11 | scanf("%d",&n); | ^~~~~ a.cc:14:24: error: 'MAP' was not declared in this scope 14 ...
s827415441
p00141
C++
#include <iostream> #include <algorithm> using namespace std; main(){ int n; char data[100][100]; int dx[] = {0, 1, 0, -1}; int dy[] = {-1, 0, 1, 0}; int t; while(cin >> t){ { for(int tc=0;tc<t;tc++){ cin >> n; if(tc != 0) cout << endl; if(n == 1){ cout << "#" << endl; f = false;...
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:19:9: error: 'f' was not declared in this scope 19 | f = false; | ^ a.cc:63:2: error: expected '}' at end of input 63 | } | ^ a.cc:6:...
s540334741
p00141
C++
import java.util.Scanner; public class Main { char[][] makeSpiral(int n){ char[][] pattern=new char[n][n]; int dir=0; int x=0,y=n-n%2; int[] dx={0,1,0,-1}; int[] dy={-1,0,1,0}; for(int i=0;i<n;++i){ for(int j=0;j<n;++j){ pattern[i][j]=' '; } } int notTurn=2; boolean end=false; while(!e...
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:4:1: error: expected unqualified-id before 'public' 4 | public class Main { | ^~~~~~
s970003937
p00141
C++
#include<queue> #include<map> #include<cstring> using namespace std; #define fr first #define sc second #define INF 100 typedef pair<int,int>Pt; int main(){ int d,n,dx[]={-1,0,1,0},dy[]={0,1,0,-1}; char mas[101][101]; //上右下左 bool ok = false; cin >> d; while(d--){ if(ok) cout << endl; memset(mas,' ',si...
a.cc: In function 'int main()': a.cc:13:3: error: 'cin' was not declared in this scope 13 | cin >> d; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<cstring> +++ |+#include <iostream> 4 | using namespace st...
s446672591
p00141
C++
#include<iostream> using namespace std; char a[102][102]; int dx[]={ 0,1,0,-1}; int dy[]={-1,0,1,0}; int main(){ bool fst=true; int n; cin>>n; while(n--){ memset(a,' ',sizeof(a)); int m,y,x,dir; cin>>m; y=m;x=1;dir=0; a[y][x]='#'; while(1){ for(int i=0;i<m-1;i++){ if(a[y+2*dy[dir]][x+2*dx[dir]...
a.cc: In function 'int main()': a.cc:14:17: error: 'memset' was not declared in this scope 14 | memset(a,' ',sizeof(a)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |...
s061789909
p00141
C++
#include <iostream> #define rep(i,n) for(int i=0;i<(int)(n);i++) const int INF = 10000000; using namespace std; int main() { char b[100][100]; int n, d, dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1}; cin >> d; rep(t, d) { memset(b, ' ', sizeof(b)); cin >> n; rep(i, n) b[0][i]='#'; int x=0, y=0, nn = n, di...
a.cc: In function 'int main()': a.cc:14:17: error: 'memset' was not declared in this scope 14 | memset(b, ' ', sizeof(b)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> ++...
s398658395
p00142
C++
#include <iostream> #include <set> using namespace std; const int MAX = 10001; int main(void){ int square[MAX]; for (int i=1; i < MAX+1; i++) square[i-1] = i*i; while (true){ int n; cin >> n; if (n == 0) break; int m = (n-1)/2; int raw_mod[n-1],mod[m]; ...
a.cc: In function 'int main()': a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(raw_mod,raw_mod+n-1); | ^~~~ | short
s137272820
p00142
C++
using System.Linq; using System.Collections.Generic; using System; public class Hello { public static void Main() { while (true) { var n = int.Parse(Console.ReadLine().Trim()); if (n == 0) break; var n2 = (n - 1) / 2; var w1 = new List<int>(); ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System.Linq; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using Sys...
s404028511
p00142
C++
g#include <iostream> #include <set> #include <cstring> using namespace std; int n; int main() { while (cin >> n, n != 0) { set<int> mod; for (int i = 1; i < n; i++) mod.insert( (i*i) % n ); int count[(n-1)/2+1]; memset(count, 0, sizeof(count)); for (set<int>::i...
a.cc:1:2: error: stray '#' in program 1 | g#include <iostream> | ^ a.cc:1:1: error: 'g' does not name a type 1 | g#include <iostream> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/includ...
s137805844
p00142
C++
#include <set> #include <cstdio> int i,n,v[9999];main(){for(;scanf("%d",&n),n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(auto s=t.begin(),S;s!=t.end();s++)for(S=s;++S!=t.end();v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=1;i<=n/2;i++)printf("%d\n",v[i]);}}
a.cc:3:17: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | int i,n,v[9999];main(){for(;scanf("%d",&n),n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(auto s=t.begin(),S;s!=t.end();s++)for(S=s;++S!=t.end();v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=1;i<=n/2;i++)printf("%d\n",v[i]);...
s013121992
p00142
C++
#include <set> #include <iostream> int i,n,v[9999];main(){for(;cin>>n,n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(std::set<int>::iterator s=t.begin(),S=s,T=t.end();s!=T;S=++s)for(;++S!=T;v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=0;i<n/2;)cout<<v[++i]<<endl;}}
a.cc:3:17: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | int i,n,v[9999];main(){for(;cin>>n,n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(std::set<int>::iterator s=t.begin(),S=s,T=t.end();s!=T;S=++s)for(;++S!=T;v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=0;i<n/2;)cout<<v[++i]<<...
s982968051
p00142
C++
#include <iostream> #include <cmath> #include <vector> #include <cstring> using namespace std; typedef pair<int,int> P; int n; int main(){ while(cin >> n ,n){ int ans[(n-1)/2]; memset(ans,0,sizeof(ans)); vector<int> v; vector<int> nv; int nn = n; for(int i = 1 ; i < nn ; i++){ v...
a.cc: In function 'int main()': a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 21 | sort(v.begin(),v.end()); | ^~~~ | sqrt
s174080278
p00142
C++
#include<iostream> #include<sstream> #include<map> #include<vector> #include<string> #include<algorithm> using namespace std; int main() { int n; for(;cin>>n,n;) { map<int,bool>hash; vector<int> data; for(int i=1;i<n;i++) { if(hash.count(i*i%n)==0) { hash[i*i%n]=true; ...
a.cc: In function 'int main()': a.cc:26:7: error: 'memset' was not declared in this scope 26 | memset(ans,0,sizeof(ans)); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include<algorithm> +++ |+#include <cstring...
s286093643
p00143
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int N=in.nextInt(); while(N-->0) { double xp1=in.nextDouble(),yp1=in.nextDouble(); double xp2=in.nextDouble(),yp2=in.nextDouble(); double xp3=in.nextDouble(),yp3=in.nextDouble();...
Main.java:22: error: cannot find symbol System.out.println(kabe==1 ? "OK":"NG"); ^ symbol: variable kabe location: class Main 1 error
s341987857
p00143
C++
#include <stdio.h> #include <math.h> int main(void){ int n; cin >> n; rep(i,n) { int count = 0; double x[8],y[8],a,b,c,d,p,q,det; //入力を多少簡略化 for(int i=0;i<8;i++) { printf("x%d =? ",i+1); scanf("%lf" ,&x[i]); printf("y%d =? ",i+1); scanf("%lf" ,&y[i]);...
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'? 6 | cin >> n; | ^~~ | sin a.cc:7:9: error: 'i' was not declared in this scope 7 | rep(i,n) { | ^ a.cc:7:5: error: 'rep' was not declared in this scope; did you mea...
s772042849
p00143
C++
#include <iostream> #include <stdio.h> #include <fstream> #include <algorithm> #include <string> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <limits.h> #include <math.h> #define rep(i,n) for (int i = 0; (i) < (n); ++ (i)) using namespace std; int main(void...
a.cc: In function 'int main()': a.cc:39:17: error: 'ansx' was not declared in this scope 39 | ansx = (d*p - b*q)/det; | ^~~~ a.cc:40:17: error: 'ansy' was not declared in this scope 40 | ansy = (-c*p + a*q)/det; | ^~~~
s009454604
p00143
C++
#include <iostream> #include <stdio.h> #include <fstream> #include <algorithm> #include <string> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <limits.h> #include <math.h> #define rep(i,n) for (int i = 0; (i) < (n); ++ (i)) using namespace std; int main(void...
a.cc: In function 'int main()': a.cc:39:17: error: 'ansx' was not declared in this scope 39 | ansx = (d*p - b*q)/det; | ^~~~ a.cc:40:17: error: 'ansy' was not declared in this scope 40 | ansy = (-c*p + a*q)/det; | ^~~~
s577823723
p00143
C++
#include <iostream> #include <stdio.h> #include <fstream> #include <algorithm> #include <string> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <limits.h> #include <math.h> #define rep(i,n) for (int i = 0; (i) < (n); ++ (i)) #define EPS 1e-10 using namespace s...
a.cc: In function 'int main()': a.cc:41:21: error: 'ansy' was not declared in this scope; did you mean 'ansx'? 41 | ansy = (-c*p + a*q)/det; | ^~~~ | ansx
s952153956
p00143
C++
include <iostream> #include <stdio.h> #include <fstream> #include <algorithm> #include <string> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <limits.h> #include <math.h> #define rep(i,n) for (int i = 0; (i) < (n); ++ (i)) #define EPS 1e-10 using namespace st...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/wchar.h:53, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40, from /usr/include/c++/14/iosfwd:42, ...
s362336486
p00143
C++
#include <bits/stdc++.h> using namespace std; typedef double D; typedef complex<D> P; #define EPS (1e-10) D dot(P a, P b) { return real(conj(a) * b); } D cross(P a, P b) { return imag(conj(a) * b); } int ccw(P p0, P p1, P p2) { P a = p1 - p0; P b = p2 - p0; if (cross(a,b) > EPS) retu...
a.cc: In function 'int main()': a.cc:45:40: error: lvalue required as unary '&' operand 45 | scanf("%lf %lf", &P[i].real(), &P[i].imag()); | ~~~~~~~~~^~ a.cc:45:54: error: lvalue required as unary '&' operand 45 | scanf("%lf %lf", &P[i].real(), &P[i].ima...
s138996255
p00143
C++
#include <iostream> #include <algorithm> #include <cassert> #include <cctype> #include <complex> #include <cstdio> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) typedef complex<double> P; ...
a.cc:20:11: error: 'double y1' redeclared as different kind of entity 20 | double x1,y1,x2,y2,x3,y3,x4,y4,x5,y5; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu...
s620895897
p00143
C++
#include<cmath> #include<algorithm> #include<iostream> #include<vector> using namespace std; double EPS = 1e-10; double add(double a, double b){ if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0; return a+b; } struct point{ double x, y; point(){} point(double x,double y) : x(x) , y(y){} point operator ...
a.cc: In function 'int inside(point, point*, int)': a.cc:72:10: error: 'INT_MAX' was not declared in this scope 72 | lt.b.x=INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include<vector> +++ |+#include...
s557266083
p00144
Java
import java.util.*; public class Main { static final int inf = 99999; int[][] a; Main(){ Scanner sc = new Scanner(System.in); int n, m, s, t; while(sc.hasNext()){ n = sc.nextInt(); a = new int[n+1][n+1]; for(int i = 0; i <= n; ++i) for(int j = i+1; j <= n; ++j) a[i][j] = a[j][i...
Main.java:39: error: cannot find symbol if(a[s][t] < u) ^ symbol: variable u location: class Main 1 error
s453737668
p00144
Java
import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.util.Collections.*; import static java.lang.Math.*; public class Main { int INF = 1 << 28; //long INF = 1L << 62; double EPS = 1e-10; int n; int[][] es; void run() { Scanner sc = new Scanner(System.in); n = sc.ne...
Main.java:50: error: bad operand types for binary operator '&&' for (int i=0;i<n;i++) if (! used[i] && es[cur.p][i] ) { ^ first type: boolean second type: int 1 error
s491295069
p00144
C
#include <stdio.h> #define N 101 int check(int s,int d,int v); int root[N][N]; /* rooter path */ int distance[N]; /* already visited flag */ int main(){ int n,r,k,t; int p,s,d,v; int i,j; char c; int ans; /* init root */ for(i=0;i<N;i++){ for(j=0;j<N;j++){ root[i][j]...
main.c: In function 'check': main.c:54:13: error: 'j' undeclared (first use in this function) 54 | for(j=0;j<N;j++){ | ^ main.c:54:13: note: each undeclared identifier is reported only once for each function it appears in main.c:56:21: error: 'k' undeclared (first use in this function) 5...
s754010032
p00144
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define VD void #define U4 unsigned int #define U1 unsigned char #define S4 int /* ---------- ?????°?????? ------------ */ #define MAX_COUNT_ROUTER (100) /* ?????????????????§??° */ #define MAX_CNT_PACKET (1000) /* PACKET????????§??° */ #define NOT_CONNECTED (0...
main.c: In function 'main': main.c:154:32: warning: missing terminating " character 154 | printf("\n); | ^ main.c:154:32: error: missing terminating " character 154 | printf("\n); | ^~~~~ main.c...
s035023961
p00144
C
#include<stdio.h> #define N 100000 int main(void) { int n,p,r,k,t,a,count[101]; int queue[1000000],head=0,tail=0; int router[101][101],visited[101],i,j,b; struct mail{ int s; int d; int v; }packet[N]; for(i=0;i<101;i++) { for(j=0;j<101;j++) { router[i][j]=0; } } sc...
main.c:87:5: error: redefinition of 'main' 87 | int main(void) | ^~~~ main.c:4:5: note: previous definition of 'main' with type 'int(void)' 4 | int main(void) | ^~~~
s945470445
p00144
C
#include<stdio.h> int main(void) { int n,p,r,k,t,a,count[101]; int queue[1000000],head=0,tail=0; int router[101][101],visited[101],i,j,b; struct mail{ int s; int d; int v; }packet[100000]; for(i=0;i<101;i++) { for(j=0;j<101;j++) { router[i][j]=0; } } scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d%d",...
main.c: In function 'main': main.c:117:61: error: expected ']' before ')' token 117 | if(count[packet[i].d<=packet[i].v && count[packet[i].d] != 0)printf("%d\n",count[packet[i].d]); | ^ | ...
s346120193
p00144
C
#include<stdio.h> int main(void) { int n,p,r,k,t,a,count[101]; int queue[1000000],head=0,tail=0; int router[101][101],visited[101],i,j,b; struct mail{ int s; int d; int v; }packet[100000]; for(i=0;i<101;i++) { for(j=0;j<101;j++) { router[i][j]=0; } } scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d%d",...
main.c: In function 'main': main.c:117:61: error: expected ']' before ')' token 117 | if(count[packet[i].d<=packet[i].v && count[packet[i].d] != 0)printf("%d\n",count[packet[i].d]); | ^ | ...
s644749863
p00144
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n; int r,k,t; int p; int s,d,b; int ans=0; int box[111][111]; cin >> n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ box[i][j]=INT_MAX; } } for(int i=0;i<n;i++){ cin >> r >> k; for(int j=0;j<k;j++){ ...
a.cc: In function 'int main()': a.cc:14:17: error: 'INT_MAX' was not declared in this scope 14 | box[i][j]=INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algorithm> +++ |+#include <...
s795633102
p00144
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n; int r,k,t; int p; int s,d,b; int ans=0; int box[111][111]; cin >> n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ box[i][j]=INT_MAX; } } for(int i=0;i<n;i++){ cin >> r >> k; for(int j=0;j<k;j++){ ...
a.cc: In function 'int main()': a.cc:14:17: error: 'INT_MAX' was not declared in this scope 14 | box[i][j]=INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algorithm> +++ |+#include <...
s345337633
p00144
C++
#include <stdio.h> #include <cmath> #include <algorithm> #include <queue> using namespace std; struct Packet{ Packet(){ ttl = current = 0; } void copy(Packet t){ ttl = t.ttl; current = t.current; for(int i=0; i < 101; i++)checkTable[i] = t.checkTable[i]; } Packet(int arg_ttl,int loc){ ttl = arg_ttl; ...
a.cc: In function 'int main()': a.cc:90:33: error: 'memo' was not declared in this scope 90 | memo[start][goal] = t_limit - tmp.ttl+1; | ^~~~
s565191709
p00144
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> #include<queue> #include<set> #include<functional> #include<unordered_map> using namespace std; vector<int>rinsetu[100]{}; unordered_map<int, int>taiou; int main() { int a; cin >> a; for (int b = 0; b < a; b++) { int c, d; s...
a.cc: In function 'int main()': a.cc:29:17: error: 'memset' was not declared in this scope 29 | memset(e, -1, sizeof(e)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include<functional> ++...
s320564803
p00144
C++
/* ????????????????????????????????????????????? */ #include <stdio.h> /* ?????°???????????? */ typedef void VD; typedef signed char I1; typedef unsigned char U1; typedef signed short I2; typedef unsigned short U2; typedef signed int I4; typedef unsigned int U4; /* ?????°?????? */ #define MAX_ROUTER 100 #defin...
a.cc: In function 'I1 inputTransmitPacket()': a.cc:113:38: error: too many arguments to function 'I4 CalcDijikstra(I4, I4, I4)' 113 | i4Ans = CalcDijikstra(i4StartRouter,i4GoalRouter,i4TTL,1); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:31:4: note: declared h...
s410534821
p00144
C++
&#65279;#include<iostream> #include<queue> using namespace std; int main(){ int n; //making graph cin >> n; int data[n+1][n+1]; for(int i = 0; i <= n; i++){ for(int j = 0; j <= n; j++){ data[i][j] = 0; } } int from, to, conesum; for(int i = 0; i < n; i++){ ...
a.cc:1:2: error: stray '#' in program 1 | &#65279;#include<iostream> | ^ a.cc:1:9: error: stray '#' in program 1 | &#65279;#include<iostream> | ^ a.cc:1:3: error: expected unqualified-id before numeric constant 1 | &#65279;#include<iostream> | ^~~~~ a.cc:1:10: error: 'include' d...
s753366548
p00144
C++
import java.util.*; public class Main { static final int inf = 99999; int[][] a; Main(){ Scanner sc = new Scanner(System.in); int n, m, s, t; while(sc.hasNext()){ n = sc.nextInt(); a = new int[n+1][n+1]; for(int i = 0; i <= n; ++i) for(int j = i+1; j <= n; ++j) a[i][j] = a[j][i...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main | ^~~~~~
s541658539
p00144
C++
#include<iostream> #include<cstdio> using namespace std; #define SUB 103 int net[SUB][SUB],n,maxx=0; typedef pair<int,int> BVB; int ans(int,int,int); int main(){ int i,j,p,num,n1,th; cin >> n; for(i=0;i<n;i++){ //net's info cin >> num >> n1; if(num >= maxx)maxx = num; for(int k=...
a.cc: In function 'int ans(int, int, int)': a.cc:79:3: error: 'queue' was not declared in this scope 79 | queue<BVB> Nari; | ^~~~~ a.cc:3:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>' 2 | #include<cstdio> +++ |+#include <queue> 3 | a....
s787286364
p00144
C++
#include<iostream> #include<queue> #define MAX_N 110 bool A[MAX_N][MAX_N]; int rooter_num; using namespace std; int bfs(int,int); int main() { int n,startNode,goalNode,TTL; int r,k,t; memset(A,false,sizeof(A)); cin>>rooter_num; for(int i=0;i<rooter_num;i++) { cin>>r>>k; for(int j=0;j<k;j++) {...
a.cc: In function 'int main()': a.cc:12:3: error: 'memset' was not declared in this scope 12 | memset(A,false,sizeof(A)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<queue> +++ |+#include <cstring> 3 | #d...
s939377788
p00145
Java
import java.io.*; import java.util.*; public class Main{ public static void main(String args[]){ try{ new Main(); }catch(IOException e){ e.printStackTrace(); } } public Main() throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = in.readLine();...
Main.java:32: error: cannot find symbol public long get_cost(List<Cards> data, long cost){ ^ symbol: class Cards location: class Main Main.java:17: error: cannot find symbol List<Cards> data = new ArrayList<Cards>(); ^ symbol: class Cards location: class Main Main.java:1...
s262946515
p00145
Java
import java.io.*; import java.util.*; public class Main{ public static void main(String args[]){ try{ new Main(); }catch(IOException e){ e.printStackTrace(); } } public Main() throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = in.readLine()...
Main.java:53: error: class, interface, enum, or record expected lass Cards{ ^ Main.java:55: error: unnamed classes are a preview feature and are disabled by default. long bottom; ^ (use --enable-preview to enable unnamed classes) Main.java:56: error: class, interface, enum, or record expected public Cards(long a, ...
s114933014
p00145
C++
#include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <deque> #include <complex> #include <stack> #include ...
a.cc: In function 'void {anonymous}::mainmain()': a.cc:91:9: error: 'll' was not declared in this scope; did you mean 'vll'? 91 | ll ans=0; | ^~ | vll a.cc:97:19: error: expected ';' before 'x' 97 | ll x=-1,y=0; | ^~ | ...
s936799723
p00145
C++
#include <iostream> #include <algorithm> using namespace std; int u[100], b[100]; int dp[100][100]; int main(void){ int n; cin >> n; for(int i = 0; i < n; i++){ cin >> u[i] >> b[i]; } for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(i != j) dp[i][j] = INT_MAX; } dp[i][i] = 0...
a.cc: In function 'int main()': a.cc:17:29: error: 'INT_MAX' was not declared in this scope 17 | if(i != j) dp[i][j] = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algor...
s996347186
p00145
C++
#include<iostream> #include<math.h> #include<vector> #include<algorithm> #include<cstdio> #include <string> using namespace std; int a[100],b[100]; int dp[100][100]; int main(){ int n,i,j,k; cin >> n; for(i=0;i<n;i++) cin >> a[i] >> b[i]; for(i=0;i<n;i++) for(j=0;j<n;j++) dp[i][j] = INT_MAX; for(...
a.cc: In function 'int main()': a.cc:16:50: error: 'INT_MAX' was not declared in this scope 16 | for(i=0;i<n;i++) for(j=0;j<n;j++) dp[i][j] = INT_MAX; | ^~~~~~~ a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#...
s533253224
p00145
C++
#include <iostream> #include <vector> #include <map> using namespace std; typedef pair<int, int> P; vector<P> D; int n, a, b; int DP[101][101]; void solve() { for(int i=0; i<n; i++) { for(int j=0; j<n; j++) { if(i!=j) DP[i][j] = INT_MAX; else DP[i][j] = 0; } } for(int i=1; i<n; i++) { for(int j...
a.cc: In function 'void solve()': a.cc:19:45: error: 'INT_MAX' was not declared in this scope 19 | if(i!=j) DP[i][j] = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include ...
s516876148
p00145
C++
#include <iostream> #include <vector> #include <climit> #include <map> using namespace std; typedef pair<int, int> P; vector<P> D; int n, a, b; int DP[101][101]; void solve() { for(int i=0; i<n; i++) { for(int j=0; j<n; j++) { if(i!=j) DP[i][j] = INT_MAX; else DP[i][j] = 0; } } for(int i=1; i<n; i...
a.cc:3:10: fatal error: climit: No such file or directory 3 | #include <climit> | ^~~~~~~~ compilation terminated.
s613662559
p00145
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; long long dp[101][101][101]; long long a[101],b[101]; #define rep(i,n) for(int i=0;i<n;i++) int main(){ int n; cin >> n; rep(i,n) cin >> a[i+1] >> b[i+1]; rep(i,101)rep(j,101)rep(k,101) dp[i][j][k] = INT_MAX; for(int j=1;j<=n;j++) ...
a.cc: In function 'int main()': a.cc:13:54: error: 'INT_MAX' was not declared in this scope 13 | rep(i,101)rep(j,101)rep(k,101) dp[i][j][k] = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by a...
s628918948
p00145
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <map> #include <utility> #include <set> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <sstream> #include <complex> #include <stack> #include <queue> using namespace std; typedef long long LL; typed...
a.cc: In function 'int main()': a.cc:42:19: error: expected ';' before 'return' 42 | cout<<dp[0][n-1] | ^ | ; 43 | 44 | return 0; | ~~~~~~
s494913038
p00145
C++
#include <iostream> #include <vector> using namespace std; typedef pair<int,int> P; int dp[101][101]; vector<P> v; const int INF=(1<<31)-1; int dfs(int d,int u){ if(u==d) return 0; if(dp[d][u]!=INF) return dp[d][u]; int minCost=INF; for(int i = d; i < u; i++){ minCost=min(minCost,v[d].second*v[u].first*v...
a.cc:11:22: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow] 11 | const int INF=(1<<31)-1; | ~~~~~~~^~ a.cc: In function 'int main()': a.cc:35:9: error: 'reverse' was not declared in this scope 35 | reverse(v.begin(),v.end()); | ^...
s653836757
p00146
C
#include <stdio.h> // printf(), scanf() #include <stdlib.h> // abs() #include <string.h> // memset() #include <stdbool.h> #define MAX_N 15 #define MAX_S (1 << MAX_N) const double INF = 1e10; int n; int s[MAX_N], l[MAX_N], p[MAX_N]; double dp[MAX_N][MAX_S]; int w[MAX_N][MAX_S]; short prev[MAX...
main.c: In function 'main': main.c:46:89: error: expected ',' or ';' before ')' token 46 | double x = dp[j][k] + d * ((70 + 20 * w[j][k])) / 2000.0); | ^
s655888029
p00146
C
#include <stdio.h> #include <math.h> #include <stdlib.h> int i,j,n,num[20],dist[20],wei[20],next[10000000]; double search(int code,int weg,int now){ if(code>=(int)pow(2.0,n)-1)return 0; int div=2,sel,i,wgg; double ttt=999999999,tim,addt; if(next[code]>=0){ sel=now;wgg=weg;i=code;tim=0.0; while(i<(int)pow...
main.c: In function 'main': main.c:43:15: error: expected expression before 'int' 43 | for(i=int(pow(2.0,n));i>=0;i--)next[i]=-1; | ^~~
s269898212
p00146
C++
#include<bits/stdc++.h> using namespace std; #define INF 1000000007 int main(void){ int n; cin >> n; int k[n][3]; for(int i = 0; i < n; i++) cin >> k[i][0] >> k[i][1] >> k[i][2]; int we[1 << n];{ for(int i = 0; i < (1 << n); i++){ we[i] = 0; for(int j = 0; j < n; j++){ if(!(i & (1 << i))) we[i] += k[i][2...
a.cc: In function 'int main()': a.cc:27:77: error: expected ')' before '{' token 27 | else if(i + (i << j) == (1 << n - 1){ | ~ ^ | ...
s927665773
p00146
C++
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i= (a); i<((int)b); ++i) #define RFOR(i,a) for(int i=(a); i >= 0; --i) #define FOE(i,a) for(auto i : a) #define ALL(c) (c).begin(), (c).end() #define RALL(c) (c).rbegin(), (c).rend() #define DUMP(x) cerr << #x << " = " << (x) << endl; #define SUM(x) std::accumulate(...
a.cc: In function 'int main()': a.cc:67:31: error: expected ')' before '{' token 67 | if ((BIT_ON(b, i)) { | ~ ^~ | ) a.cc:70:9: error: expected primary-expression before '}' token 70 | } | ^
s830695542
p00146
C++
#include<iostream> #include<vector> #include<queue> #include<map> #include<functional> #include<tuple> #include<algorithm> #include<cmath> #include<cfloat> using namespace std; class Store { public: double distance, gold; Store(double d, double g) :distance(d), gold(g) {} }; enum {COST, GOLD, ID, PATH}; typed...
a.cc: In function 'std::vector<int> bfs(const std::vector<Store>&, int)': a.cc:47:23: error: expected primary-expression before ';' token 47 | return vector<int>; | ^
s468493152
p00146
C++
// AOJ 0146 #include<cstdio> #include<cstdlib> #include<algorithm> #include<limits> #include<vector> #define rep(i,a) for( int i = 0; i != (a); ++i ) #define repi(i,a,b) for( int i = (a); i != (b); ++i ) const int MAX_V = 15; const double INF = std::numeric_limits<double>::max()/4.0; int n; int ord[MAX_V], d[MAX_V], ...
a.cc: In function 'int main()': a.cc:61:48: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>' 61 | rec( i, 0, w[i]*20, 1<<i, std::vector<int>( 1, ord[i] ) ); | ^~~~~~~~~~~~~~~~~~~~~~~~...
s663342854
p00146
C++
# define _CRT_SECURE_NO_WARNINGS 1 # define _USE_MATH_DEFINES # include <iostream> # include <intrin.h> # include <numeric> # include <string> # include <bitset> # include <vector> # include <algorithm> # include <cstdlib> # include <cstdio> # include <cstring> # include <cstdlib> # include <iomanip> # include <queue> ...
a.cc:4:11: fatal error: intrin.h: No such file or directory 4 | # include <intrin.h> | ^~~~~~~~~~ compilation terminated.
s802618456
p00146
C++
# define _CRT_SECURE_NO_WARNINGS 1 # define _USE_MATH_DEFINES # include <iostream> # include <numeric> # include <string> # include <bitset> # include <vector> # include <algorithm> # include <cstdlib> # include <cstdio> # include <cstring> # include <cstdlib> # include <iomanip> # include <queue> # include <sstream> #...
a.cc: In function 'pdv dp(int, int)': a.cc:65:13: error: '__popcnt' was not declared in this scope 65 | if (__popcnt(bit) == n)return pdv(0.0, {}); | ^~~~~~~~
s528975123
p00146
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <complex> #include <cstring> #include <cstdlib> #include <string> #include <cmath> #include <queue> using namespace std; #define REP(i,n) for(int i=0;i<(int)n;++i) #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();...
a.cc:26:8: error: conflicting declaration 'Weight best [32768][15]' 26 | Weight best[1<<M][M]; | ^~~~ a.cc:25:25: note: previous declaration as 'std::vector<std::vector<double> > best' 25 | vector<vector<double> > best(1<<M,vector<double>(15, INF)); | ^~~~ a.cc: In funct...
s429557724
p00146
C++
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <cmath> using namespace std; int id[20],dist[20],cnt[20]; double dp[1<<15][15]; pair<int,int> prev[1<<15][15]; int W[1<<15]; int main(){ int n; while(cin >> n && n){ for(int i = 0 ; i < n ; i++){ cin >> id[i] >> dist[i] >> cn...
a.cc: In function 'int main()': a.cc:37:49: error: reference to 'prev' is ambiguous 37 | prev[i|(1<<k)][k] = make_pair(i,j); | ^~~~ In file included from /usr/include/c++/14/string:47, from /usr/inc...
s223331614
p00147
Java
import static java.util.Arrays.deepToString; import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; import java.util.concurrent.PriorityBlockingQueue; public class Main_pq { public static void main(String[] args) { new Main_pq().run(); } void tr(Object... os) { System.err.println(d...
Main.java:9: error: class Main_pq is public, should be declared in a file named Main_pq.java public class Main_pq { ^ 1 error
s819945273
p00147
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class M2ain { public static void main(String[] args) { int[] seats = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int[] groupMembers = new int[] {2, 5, 2, 2, 2}; int[] eat...
Main.java:5: error: class M2ain is public, should be declared in a file named M2ain.java public class M2ain { ^ 1 error
s434004678
p00147
Java
<?php $waitTime = array(0, 0, 0, 0, 0, 0, 14, 9, 4, 0, 0, 8, 3, 2, 0, 0, 15, 10, 15, 10, 6, 12, 7, 9, 11, 6, 23, 18, 13, 8, 3, 23, 18, 13, 8, 3, 34, 29, 24, 22, 17, 28, 23, 24, 19, 27, 34, 29, 35, 30, 28, 31, 28, 23, 24, 28, 42, 37, 32, 27, 22, 42, 37, 32, 27, 22, 53, 48, 43, 41, 36, 47, 42, 43, 38, 46, 64, 59, 54, 49...
Main.java:1: error: class, interface, enum, or record expected <?php ^ Main.java:104: error: class, interface, enum, or record expected while($input = fscanf(STDIN, "%d")){ ^ Main.java:106: error: class, interface, enum, or record expected } ^ Main.java:108: error: class, interface, enum, or record expected ?> ^ 4 erro...
s245304611
p00147
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * プログラミングコンテスト<br> * 0147:Fukushimaken * * @author t690593 * */ public class Fukushimaken { /** 最大グループ数 */ static final int MAX_GROUP_NUKMBER = 100; /** 客の到着間隔 */ static final int TIME_INTERVAL = 5; /** 座席 */ static int[] s...
Main.java:12: error: class Fukushimaken is public, should be declared in a file named Fukushimaken.java public class Fukushimaken { ^ 1 error