submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s004759070
p00491
C++
???
a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??? | ^
s710118428
p00491
C++
#include <iostream> #include <vector> #include <array> #include <numeric> int f(int, int, int); int N; int yotei[100]; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int k, date; std::cin >> N >> k; for (int i = 0; i < k; i++) { std::cin >> date; std::cin >>...
/usr/bin/ld: /tmp/ccmknkDS.o: in function `main': a.cc:(.text+0xb5): undefined reference to `f(int, int, int)' collect2: error: ld returned 1 exit status
s381478498
p00491
C++
int menu[101]; int dp[101][4][4]; int main() { int n, k; cin >> n >> k; int a, b; for (int i = 0; i < n; i++) { menu[i] = -1; } for (int i = 0; i < k; i++) { cin >> a >> b; menu[a - 1] = b - 1; } for (int i = 0; i < 3; i++) { if (menu[0] == -1 || menu[0] == i)dp[0][i][0] = 1; } for (int i = 0; i < n...
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin >> n >> k; | ^~~ a.cc:26:84: error: 'MOD' was not declared in this scope 26 | dp[i + 1][l][0] %= MOD; | ...
s911777119
p00491
C++
#include <map> #include <vector> #include <deque> #include <iostream> using namespace std; map< pair< int , deque<int> > , int > memo; int scheduled[100]; int n , m; int f(int pos,deque<int> prev){ deque<int> current = prev; if( memo.count(make_pair(pos,prev)) ) return memo[make_pair(pos,prev)]; if(prev.size() =...
a.cc: In function 'int f(int, std::deque<int>)': a.cc:15:32: error: 'count' was not declared in this scope 15 | if(prev.size() == 3 && count(prev.begin(),prev.end(),prev[0]) == 3 ) return 0; | ^~~~~ a.cc: In function 'int main()': a.cc:36:9: error: 'memset' was not declar...
s572128795
p00491
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n; cin >>n; int k; cin >>k; int a[n][3][3];//n+1個の最後から2番目-1,1番目-1 int b[n]; int c; c=0; while(c<n){ b[c]=-1; c=c+1;} int d; int e; c=0; while(c<k){ cin >>d; cin >>e; b[d-1]=e-1; c=c+1;} int f; int h; c=0; while(c<3){ f=0; while(f<3){ h=0; if(...
a.cc: In function 'int main()': a.cc:47:28: error: expected ';' before 'g' 47 | a[c][f][g]=a[c][f][g]%10000 | ^ | ; 48 | g=g+1;} | ~ a.cc:52:2: error: expected '}' at end of input 52 | } | ^ a.cc:4:11: not...
s684925388
p00491
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n; int k; int q[200]={0}; int a,b; int ans=0; int mem[110][110][110]={{{0}}}; int check(int x,int y,int z);//x日目,前日y,前々日z int main(void){ cin>>n>>k; for(int i=0;i<k;i++){ cin>>a; cin...
a.cc: In function 'int check(int, int, int)': a.cc:86:6: error: expected '}' at end of input 86 | } | ^ a.cc:28:29: note: to match this '{' 28 | int check(int x,int y,int z){ | ^ a.cc:86:6: warning: control reaches end of non-void function [-Wreturn-type] 86 | ...
s278200586
p00491
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n; int k; int q[200]={0}; int a,b; int ans=0; int mem[110][5][5]={{{0}}}; int check(int x,int y,int z);//x日目,前日y,前々日z int main(void){ cin>>n>>k; for(int i=0;i<k;i++){ cin>>a; cin>>b;...
a.cc: In function 'int check(int, int, int)': a.cc:86:6: error: expected '}' at end of input 86 | } | ^ a.cc:28:29: note: to match this '{' 28 | int check(int x,int y,int z){ | ^ a.cc:86:6: warning: control reaches end of non-void function [-Wreturn-type] 86 | ...
s415743305
p00491
C++
import java.util.*; public class Main { static int cnt=0; static int n; static void bfs(int a,int b,int c,int day){ if(a==b&&b==c)return; if(day-1==n){ cnt++; return; } a=b; b=c; if(hyou[day]>0){ bfs(a,b,hyou[day],day+1); }else{ for(int i=1;i<=3;i++){ if(a==b&&b==i){ continue; ...
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:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s231740031
p00491
C++
import java.util.*; public class Main { static int cnt=0; static int n; static void bfs(int a,int b,int c,int day){ if(a==b&&b==c)return; if(day-1==n){ cnt++; return; } a=b; b=c; if(hyou[day]>0){ bfs(a,b,hyou[day],day+1); }else{ for(int i=1;i<=3;i++){ if(a==b&&b==i){ continue; ...
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:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s761535298
p00491
C++
#include<iostream> using namespace std; int N,K,day,sosu; int plan[101]; int memo[101][4][4]; int solve(int n,int b1,int b2){ if(plan[n]!=0){ if(b1==b2&&b1==plan[n]) return 0; else return slove(n+1,plan[n],b1)%10000; } int t=0; for(int i=1;i<=3;++i){ if(b1==b2&&b1==i)continue...
a.cc: In function 'int solve(int, int, int)': a.cc:12:15: error: 'slove' was not declared in this scope; did you mean 'solve'? 12 | return slove(n+1,plan[n],b1)%10000; | ^~~~~ | solve a.cc:19:5: error: 'returm' was not declared in this scope 19 | returm memo[n][b...
s844986828
p00492
Java
import java.util.*; public class Main{ int[][] a; boolean[][] f; int h, w, res, dy, dx; int[] xdir = {0, 1, 1, 1, 0, -1}; int[] ydir = {-1, -1, 0, 1, 1, 0}; int[] xdir2 = {-1, 0, 1, 0, -1, -1}; int[] ydir2 = {-1, -1, 0, 1, 1, 0}; Main(){ Scanner sc = new Scanner(System.in); ...
Main.java:52: error: bad operand types for binary operator '&&' if(0 <= dy && dy < h+2 && 0 <= dx && dx < w+2 && !f[dy][dx] && a[dy][dx]) dfs(dy, dx); ^ first type: boolean second type: int 1 error
s798373264
p00492
C
#include <stdio.h> int main(){ int x[102][102]; int y[102][102]; int i,j,h,w; scanf("%d%d",&w,&h); for(i=1;i<=w;i++){ for(j=1;j<=h;j++){ scanf("%d",&x[i][j]); } } for(i=0;i<=w+1;i++){ for(j=0;j<=h+1;j++){ y[i][j]=0; if(j%2==0){ if(x[i][j]==0){ if(x[i-1][j-1]==...
main.c: In function 'main': main.c:36:19: error: expected declaration or statement at end of input 36 | } | ^ main.c:36:19: error: expected declaration or statement at end of input main.c:36:19: error: expected declaration or statement at end of input
s738528668
p00492
C++
#include<iostream> using namespace std; #define rep(i,x) for(int i=0;i<x;i++) #define rep1(i,x) for(int i=1;i<=x;i++) const int nex[2][6] = { {110,1,-110,-1,-111,109}, {110,1,-110,-1,-109,111} }; int w,h,a[12100],ret; void dfs(int x,int y){ if(a[x][y] == 0){ a[x][y] = -1; rep(i,6)dfs(x + nex[x%2][i],y + nex[x...
a.cc: In function 'void dfs(int, int)': a.cc:14:16: error: invalid types 'int[int]' for array subscript 14 | if(a[x][y] == 0){ | ^ a.cc:15:21: error: invalid types 'int[int]' for array subscript 15 | a[x][y] = -1; | ^ a.cc: In function 'int ma...
s474093272
p00492
C++
#include<iostream> #include<cstdio> #include<queue> #include<algorithm> using namespace std; typedef pair<int, int> P; int W, H; int X[102][102]; int dx1[6] = { -1, 0, 0, 1, 1, 1 }; int dy1[6] = { 0, -1, 1, -1, 1, 0 }; int dx2[6] = { -1, -1, -1, 0, 0, 1 }; int dy2[6] = { -1, 0, 1, -1, 1, 0 }; int main() { scanf("%d%d"...
a.cc: In function 'int main()': a.cc:25:33: error: 'memset' was not declared in this scope 25 | memset(F, false, sizeof(F)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>...
s214504137
p00492
C++
#include<iostream> using namespace std; int main(){ int n,m,x[110][110],y[110][110],sum=0; memset(x,0,sizeof(x)); cin>>m>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>x[i][j]; } } memset(y,0,sizeof(y)); for(int i=1;i<=m;i++){ if(x[1][i]==0){ y[1][i]=1; for(int j=1;j<100;j++){ for(int...
a.cc: In function 'int main()': a.cc:6:9: error: 'memset' was not declared in this scope 6 | memset(x,0,sizeof(x)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> ...
s991134031
p00492
C++
#include <iostream> using namespace std; #include <cstring> #include <queue> #define MK make_pair int date[128][128], cnt[128][128]; int data_[120][120] = { 0 }; bool flg_date[128][128], flg_rec[128][128];//???????????????????????????????????????????????? int x_move[2][6] = { { +1,-1,+1,0,+1,0 }, { +1,-1,0,-1,0,-1 } ...
a.cc: In function 'int main()': a.cc:31:40: error: expected primary-expression before ';' token 31 | cout << rec(1, 1, 0) << endl <<; | ^
s581503471
p00492
C++
#include<iostream> #include<queue> using namespace std; int a[105][105];//1==??? int w,h; int d[2][6][2]={ {{1,-1},{1,0},{1,1},{0,-1},{0,1},{-1,0}}, {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,0}} }; int check(x,y){ int i,j,k; if(x<0 || x>=w || y<0 || y>=h)return 0; if(a[x][y]==1)return 0; if(a[x][y]==2)return 1; fo...
a.cc:11:11: error: 'x' was not declared in this scope 11 | int check(x,y){ | ^ a.cc:11:13: error: 'y' was not declared in this scope 11 | int check(x,y){ | ^ a.cc:11:14: error: expression list treated as compound expression in initializer [-fpermissive] 11 | int check(x,y){ ...
s960577728
p00492
C++
#include<unordered_map> #include<iostream> #include<string> #include<vector> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<chrono> #include<cstdio> #include<iomanip> #include<algorithm> #include<functional> using namespace std; typedef long long ll; int h,w,a[100][100]; int solve(i...
a.cc: In function 'int solve(int, int)': a.cc:20:1: error: expected unqualified-id before '}' token 20 | } | ^ a.cc:19:16: error: expected ';' before '}' token 19 | for(int | ^ | ; 20 | } | ~ a.cc:20:1: error: expected primary-express...
s284461248
p00492
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> #include <cstring> #include <deque> using namespace std; #define FOR...
a.cc: In function 'bool bwb(int, int)': a.cc:32:14: error: 'ny' was not declared in this scope; did you mean 'y'? 32 | if(checked[ny][nx] || b[ny][nx]) return true; | ^~ | y a.cc:32:18: error: 'nx' was not declared in this scope; did you mean 'x'? 32 | if(checked[ny][nx] ...
s393071555
p00492
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cstring> #include <cctype> #include <cmath> #include <stack> #include <queue> #include <vector> #include <set> #include <map> #include <list> #include <stdio.h> #include <string.h> #include <cstdlib> #include <math.h> #include <bitse...
a.cc: In function 'int main()': a.cc:62:19: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'? 62 | P p=que.top(); que.pop(); | ^~~ | pop
s091126753
p00492
C++
#include <cstdio> #include <queue> #include <algorithm> using namespace std; int pent[101][101],x[101][101]={},h,w,ans=0; typedef pair<int,int> P; queue<P>que; int main(){ scanf("%d %d",&h,&w); for(int i=1;i<=h;i++){ for(int j=1;j<=w;j++){ scanf("%d",&pent[j][i]); } } que.push(make_pair(0,0)); w...
a.cc: In function 'int main()': a.cc:17:12: error: conversion from '<unresolved overloaded function type>' to non-scalar type 'P' {aka 'std::pair<int, int>'} requested 17 | P p=que.front; que.pop(); | ~~~~^~~~~
s681276469
p00492
C++
#include<iostream> using namespace std; int mas[110][110]; bool d[110][110]; int dy[6]={-1,-1, 0, 0, 1, 1}; int dx_k[6]={ 0, 1,-1, 1, 0, 1}; int dx_g[6]={-1, 0,-1, 1,-1, 0}; int wall=0; int wall_len=0; void dfs(int,int); int main(){ int x,y; memset(d,sizeof(d),true); memset(mas,sizeof(mas),0); cin >> x >> y; ...
a.cc: In function 'int main()': a.cc:14:3: error: 'memset' was not declared in this scope 14 | memset(d,sizeof(d),true); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | ...
s043483099
p00492
C++
#include<iostream> using namespace std; int mas[110][110]; bool d[110][110]; int dy[6]={-1,-1, 0, 0, 1, 1}; int dx_k[6]={ 0, 1,-1, 1, 0, 1}; int dx_g[6]={-1, 0,-1, 1,-1, 0}; int wall=0; int wall_len=0; void dfs(int,int); int main(){ int x,y; memset(d,true,sizeof(d)); memset(mas,0,sizeof(mas)); cin >> x >> y; ...
a.cc: In function 'int main()': a.cc:14:3: error: 'memset' was not declared in this scope 14 | memset(d,true,sizeof(d)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | ...
s931717705
p00493
C
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <gmp.h> #define BUFFER_SIZE 555 bool isZigzag(mpz_t num) { char buffer[BUFFER_SIZE]; mpz_get_str(buffer, 10, num); int len = strlen(buffer); if (len <= 1) return true; // one digit number. int previous = buffer[0] - '0'; int current =...
/usr/bin/ld: /tmp/ccpcvBQx.o: in function `isZigzag': main.c:(.text+0x29): undefined reference to `__gmpz_get_str' /usr/bin/ld: /tmp/ccpcvBQx.o: in function `main': main.c:(.text+0x11f): undefined reference to `__gmpz_init' /usr/bin/ld: main.c:(.text+0x155): undefined reference to `__gmpz_init_set_str' /usr/bin/ld: mai...
s447724366
p00493
C
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <gmp.h> #define BUFFER_SIZE 555 bool isZigzag(mpz_t num) { int i; char buffer[BUFFER_SIZE]; mpz_get_str(buffer, 10, num); int len = strlen(buffer); if (len <= 1) return true; // one digit number. int previous = buffer[0] - '0'; int c...
/usr/bin/ld: /tmp/ccMNwQiG.o: in function `isZigzag': main.c:(.text+0x29): undefined reference to `__gmpz_get_str' /usr/bin/ld: /tmp/ccMNwQiG.o: in function `main': main.c:(.text+0x11f): undefined reference to `__gmpz_init' /usr/bin/ld: main.c:(.text+0x155): undefined reference to `__gmpz_init_set_str' /usr/bin/ld: mai...
s150397976
p00493
C++
#include <iostream> using namespace std; constexpr int mod = 10000000; constexpr int MAX_DIGIT = 500; constexpr int MAX_M = 500; int dp[MAX_DIGIT + 1][MAX_M][10][2][2]; // digit, modulo m, prev, less flag, zig-zag flag int calc(const string &limit, int m) { const int n = limit.size(); memset(dp, 0, sizeof(dp)); ...
a.cc: In function 'int calc(const std::string&, int)': a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream...
s432642588
p00493
C++
#include <string> #include <vector> #include <sstream> #include <iostream> #include <algorithm> #include <map> #include <list> #include <set> #include <numeric> #include <queue> #include <stack> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <cstring> #include <climits> #include <cfloa...
a.cc: In function 'int num2(std::string, int)': a.cc:132:36: error: expected '}' at end of input 132 | ostringstream ostr; | ^ a.cc:130:33: note: to match this '{' 130 | for(int i=rem;i<=v;i+=M){ | ^ a.cc:132:36: ...
s425059529
p00493
C++
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<cmath> #include<queue> #include<stack> #include<functional> #include<string> using namespace std; #define LATTE 10000 int dp[502][10][500][2][3]; int main(){ char A[502],B[502]; int M,lenA,lenB; cin>>A>>B>>M; lenA = strlen(A); lenB...
a.cc: In function 'int main()': a.cc:20:16: error: 'strlen' was not declared in this scope 20 | lenA = strlen(A); lenB = strlen(B); | ^~~~~~ a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include<functional> +...
s995474369
p00493
C++
#include<iostream> #include<string> #include<cmath> #include<algorithm> using namespace std; int x[501][501][10][2]; int main(){ //init. string n,m; int N[501]; int M[501]; int p[10]; int giri[501][2][2]; int a,b,c,d,e,sum,sum2; memset(giri,0,sizeof(giri)); memset(x,0,sizeof(x)); char T[10]={'0','1','2','...
a.cc: In function 'int main()': a.cc:19:9: error: 'memset' was not declared in this scope 19 | memset(giri,0,sizeof(giri)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<algorithm> +++ |+#include <c...
s126196396
p00493
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;++i) #define FOR(i,a,b) for(int i=a;i<=b;++i) #define LL long long using namespace std; static const LL INF = 1LL<<61LL; static const int MOD = 10000; char c[]={'0','1','2','3','4','5','6','7','8','9'}; typedef pair<LL,LL> PLL; string str1,str2; int M; int sum; ...
a.cc:16:4: error: redefinition of 'long long int mem2 [501][10][2][501][3]' 16 | LL mem2[501][10][2][501][3]; | ^~~~ a.cc:15:4: note: 'long long int mem2 [501][10][2][501][3]' previously declared here 15 | LL mem2[501][10][2][501][3]; | ^~~~ a.cc: In function 'int cal3(int, int, int, int, int, s...
s112201288
p00493
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;++i) #define FOR(i,a,b) for(int i=a;i<=b;++i) #define LL long long using namespace std; static const LL INF = 1LL<<61LL; static const int MOD = 10000; char c[]={'0','1','2','3','4','5','6','7','8','9'}; typedef pair<LL,LL> PLL; string str1,str2; int M; int sum;...
a.cc: In function 'int main()': a.cc:165:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 165 | cout<<(vr-vl)&M<<endl; | ~^~~~~~
s456257048
p00493
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;++i) #define FOR(i,a,b) for(int i=a;i<=b;++i) #define LL long long using namespace std; static const LL INF = 1LL<<61LL; static const int MOD = 10000; char c[]={'0','1','2','3','4','5','6','7','8','9'}; typedef pair<LL,LL> PLL; string str1,str2; int M; int sum; ...
a.cc: In function 'int main()': a.cc:248:18: error: too few arguments to function 'int cal1(int, int, int, int, std::string)' 248 | ans+=cal1(0,i,0,i%M); | ~~~~^~~~~~~~~~~ a.cc:19:5: note: declared here 19 | int cal1(int n,int p,int pp,int mod,string s){ | ^~~~ a.cc:250:39: err...
s775395366
p00493
C++
100 200 5
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 100 | ^~~
s649575937
p00493
C++
#include <iostream> #include <algorithm> #include <climits> #include <string> #include <vector> #include <cmath> using namespace std; #define MOD 10000 char A[510], B[510]; int M; int memo[510][10][3][3][500]; int f(char *x, int i, int d, int c, int u, int r) { if (memo[i][c][d][u][r] >= 0) return memo[i][c][d][u]...
a.cc: In function 'int f(char*, int, int, int, int, int)': a.cc:17:12: error: 'strlen' was not declared in this scope 17 | if (i == strlen(x)) { | ^~~~~~ a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <cmath> ++...
s746681873
p00494
C
#include<iostream> #include<string.h> using namespace std; int main() { int n, k = 0, ans = 0, i; char s[1000001]; int JOI = -1, J = 0, O = 0, I = 0; cin >> s; n = strlen(s); s[n] = 'A'; for (i = 0; i <= n; i++) { if (s[i] == 'J' && JOI <= 0) { JOI = 0; ++J; } else if (s[i] == 'O' && (JOI == 0 || JOI...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s875188153
p00494
C
#include <stdio.h> #include <string.h> #include <string> using namespace std; char vv[100000]; char x[100000]; int main(){ scanf("%s",vv); int leng; leng=strlen(vv); for(int i=leng/3;i>=0;i--){ for(int j=0;j<i;j++){ x[j]='J'; } ...
main.c:3:10: fatal error: string: No such file or directory 3 | #include <string> | ^~~~~~~~ compilation terminated.
s364906127
p00494
C
/* AizuOnline A0571 JJOOII */ #include <stdio.h> #include <string.h> char buffer[100001]; char * find_chr_run(char * s,char c,int * ret) { int i; char *p; if(NULL==(p=strchr(s,c))) return(NULL); i=0; while(p[i]==c) i++; *ret = i; return(p); } // do not search before start ! char * chr_run_ba...
main.c:87:1: error: return type defaults to 'int' [-Wimplicit-int] 87 | main() | ^~~~ main.c: In function 'main': main.c:91:10: error: 'buffer0' undeclared (first use in this function); did you mean 'buffer'? 91 | buffer=buffer0+1; | ^~~~~~~ | buffer main.c:91:10: note: each ...
s696104499
p00494
C
x;main(l,m,n){for(;~scanf("%*[^J]");){l=m,n=0;scanf("%*[J]%n%*[O]%n%*[I]%n",&l,&m,&n);n3-=n2;n2-=n1;if(l>=m&&m<=n)if(x<m)x=m;}x=!printf("%d\n",x);} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////...
main.c:1:1: warning: data definition has no type or storage class 1 | x;main(l,m,n){for(;~scanf("%*[^J]");){l=m,n=0;scanf("%*[J]%n%*[O]%n%*[I]%n",&l,&m,&n);n3-=n2;n2-=n1;if(l>=m&&m<=n)if(x<m)x=m;}x=!printf("%d\n",x);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] main.c:...
s419418898
p00494
C++
#include <cstdio> using namespace std; typedef struct { char c; int num; } C_NUM int main() { char str[2048]; C_NUM c_num[2048]; scanf("%s", str); int len = strlen(str); int j = 0; for (int i = 0; i < len; i++){ if (j == 0 || str[i] != c_num[j - 1].c){ c_num[j].c = str[i]; c_num[j].num = 1; } ...
a.cc:9:1: error: expected initializer before 'int' 9 | int main() | ^~~
s893991705
p00494
C++
#include<cstdio> #include<math.h> #include<algorithm> #include<vector> #include<queue> #define rep(i,n) for(int i=0;i<n;i++) const int INF=1001001001; using namespace std; char T[1000002]; pair<int,int> W[1000002]; int charid(char a){ if(a=='J')return 0; if(a=='O')return 1; if(a=='I')return 2; } int main(){ //...
a.cc: In function 'int main()': a.cc:28:21: error: 'strlen' was not declared in this scope 28 | rep(i,(int)(strlen(T))){ | ^~~~~~ a.cc:10:32: note: in definition of macro 'rep' 10 | #define rep(i,n) for(int i=0;i<n;i++) | ^ a.cc:6:1: note: 'st...
s678728449
p00494
C++
#include<cstdio> #include<math.h> #include<algorithm> #include<vector> #include<queue> #include<stdlib.h> #define rep(i,n) for(int i=0;i<n;i++) const int INF=1001001001; using namespace std; char T[1000002]; pair<int,int> W[1000002]; int charid(char a){ if(a=='J')return 0; if(a=='O')return 1; if(a=='I')return 2; ...
a.cc: In function 'int main()': a.cc:27:21: error: 'strlen' was not declared in this scope 27 | rep(i,(int)(strlen(T))){ | ^~~~~~ a.cc:9:32: note: in definition of macro 'rep' 9 | #define rep(i,n) for(int i=0;i<n;i++) | ^ a.cc:7:1: note: 'str...
s501773456
p00494
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cmath> #include<stack> #include<queue> #include<string> #define INF 10000000000 #define EPS 0.000000001 #define int long long using namespace std; int Jlevel, Ilevel, Olevel; char nstr; bool Oflag = false, Iflag = false; string str; signed main() { ci...
a.cc: In function 'int main()': a.cc:20:14: error: 'sttr' was not declared in this scope; did you mean 'str'? 20 | cin>>sttr; | ^~~~ | str
s718107506
p00494
C++
#include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { string S; cin >> S; vector<char> v1; vector<int> v2; int c = 1; for(int i = 1; i < S.size(); i++) { if(S[i - 1] != S[i]) { v1.push_back(S[i - 1]...
a.cc: In function 'int main()': a.cc:34:15: error: 'i' was not declared in this scope 34 | if(v1[i - 1] == 'J' && v1[i] == 'O' && v1[i + 1] == 'I') | ^ a.cc:36:31: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 36 | ret = max(ret, min( { v2...
s245989589
p00494
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i ...
a.cc:46:16: error: conflicting declaration 'std::vector<std::__cxx11::basic_string<char> > str' 46 | vector<string> str; | ^~~ a.cc:42:8: note: previous declaration as 'std::string str' 42 | string str; | ^~~
s803669194
p00494
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i ...
a.cc: In function 'void input()': a.cc:62:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 62 | scanf_s("%s",str,III); | ^~~~~~~ | scanf
s762075725
p00494
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i ...
a.cc: In function 'int main()': a.cc:75:29: error: 'strlen' was not declared in this scope 75 | for (int i = 0; i < strlen(str); i++) { | ^~~~~~ a.cc:12:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #inclu...
s413578372
p00494
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i ...
a.cc: In function 'int main()': a.cc:75:29: error: 'strlen' was not declared in this scope 75 | for (int i = 0; i < strlen(str); i++) { | ^~~~~~ a.cc:12:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #inclu...
s354839778
p00494
C++
/*#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<string.h> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FO...
a.cc: In function 'void input()': a.cc:180:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 180 | scanf_s("%s", str, 1000010); | ^~~~~~~ | scanf
s889806688
p00494
C++
#include<iostream> #include<vector> #include<string> #include<cstdio> #include<algorithm> using namespace std; char a[1000000]; int b; int g=0; struct JOI { int J, O, I; }; JOI c(int d) { JOI e; e.J = e.O = e.I = 0; int f; for (f = d; f < b; f++) { if (a[f] != 'J')break; } e.J = f - d; d = f; for (f = d; f ...
a.cc: In function 'int main()': a.cc:37:9: error: 'strlen' was not declared in this scope 37 | b = strlen(a); | ^~~~~~ a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include<algorithm> +++ |+#include <cstring> 6 | us...
s542017395
p00494
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
a.cc: In function 'int main()': a.cc:20:11: error: 'strlen' was not declared in this scope 20 | N=strlen(s); | ^~~~~~ a.cc:13:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 12 | #include <cctype> +++ |+#include <cstring> 13 ...
s163175801
p00494
C++
#include <bits/stdc++.h> using namespace std; #define loop(i,n) for(int i=1;i<=n;i++) typedef P pair<char,int>; vector<P> v; int main(){ char c; while(cin>>c){ if(!v.empty()&&v.back().first==c){ v.back().second++; }else{ v.push_back(P(c,1)); } } int m=0; loop(p,v.size()-2){ if(v[...
a.cc:5:9: error: 'P' does not name a type 5 | typedef P pair<char,int>; | ^ a.cc:6:8: error: 'P' was not declared in this scope 6 | vector<P> v; | ^ a.cc:6:9: error: template argument 1 is invalid 6 | vector<P> v; | ^ a.cc:6:9: error: template argument 2 is invalid a...
s769300397
p00494
C++
#include<iostream> #include<math.h> using namespace std; #define FOR(i,a) for(int i=0;i<a;i++) char joi[1000000]; int retu[1000000]; int main(){ int ans; int rennsa[4]; rennsa[0]=1;rennsa[1]=0;rennsa[2]=0;rennsa[3]=0; int i=0; while(cin>>joi[i];){ if(cin.eof()==true){break;} if(joi[i]=='J'){ if(rennsa[0]=...
a.cc: In function 'int main()': a.cc:12:26: error: expected ')' before ';' token 12 | while(cin>>joi[i];){ | ~ ^ | ) a.cc:12:27: error: expected primary-expression before ')' token 12 | while(cin>>joi[i];){ | ...
s976753854
p00494
C++
#include<bits/stdc++.h> using namespace std; int main() { string q; cin>>q; int q_len = q.size(); int q_l = q_len / 3; int ans = 0; string JOI("JOI"); for(int i = 1;i <= q_l;++i){ if(i != 1){ int a = JOI.begin(); JOI.insert(a + (i - 1),'J'); JOI.insert(a + i + (i - 1),'O'); ...
a.cc: In function 'int main()': a.cc:17:24: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'int' in initialization 17 | int a = JOI.begin(); | ~~~~~~~~~^~ | | | std::__cxx11::basic_string<char>::iterator a.cc:1...
s249721838
p00494
C++
int main (int argc, char *argv[]) { string str; int ans = 0; int n1, n2, n3; cin>>str; for (int i = 0; i < str.length(); ++i) { n1 = n2 = n3 = 0; while (str[i] == 'J') { n1++; i++; } while (str[i] == 'O') { n2++; i++; ...
a.cc: In function 'int main(int, char**)': a.cc:2:5: error: 'string' was not declared in this scope 2 | string str; | ^~~~~~ a.cc:5:5: error: 'cin' was not declared in this scope 5 | cin>>str; | ^~~ a.cc:5:10: error: 'str' was not declared in this scope; did you mean 'std'? 5 | ...
s802509757
p00494
C++
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <cstdio> #include <iostream> #include <sstream> #include <cmath> #include <cstdlib> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> #include <bitset> #in...
a.cc: In function 'int main()': a.cc:72:50: error: no matching function for call to 'max(int&, std::__iterator_traits<std::_Deque_iterator<char, char&, char*>, void>::difference_type)' 72 | res = max(res,count(que.begin(),que.end(),'I')); | ...
s426896533
p00494
C++
#include <cstdio> #include <cstring> using namespace std; char s[1000001]; int main(){ scanf("%
a.cc:6:7: warning: missing terminating " character 6 | scanf("% | ^ a.cc:6:7: error: missing terminating " character 6 | scanf("% | ^~ a.cc: In function 'int main()': a.cc:6:7: error: expected primary-expression at end of input 6 | scanf("% | ^ a.cc:6:7: error: expected '...
s982519906
p00494
C++
#include <cstdio> #include <string> #include <cstring> using namespace std; string s; string a="j",b="o",c="i"; int main(){ scanf("%s",s); int leng=s.size(); for(int i=leng/3;i>=0;i++){ stirng x="j"; for(int j=1;j<i;j++){ ...
a.cc: In function 'int main()': a.cc:11:17: error: 'stirng' was not declared in this scope 11 | stirng x="j"; | ^~~~~~ a.cc:13:25: error: 'x' was not declared in this scope 13 | x+=a; | ^ a.cc:16:25: error: 'x' was not dec...
s686835116
p00494
C++
#include <cstdio> #include <string> #include <cstring> using namespace std; string s; string a="j",b="o",c="i"; int main(){ scanf("%s",s); int leng=s.size(); for(int i=leng/3;i>=0;i++){ string x="j"; for(int j=1;j<i;j++){ ...
a.cc: In function 'int main()': a.cc:21:26: error: no matching function for call to 'strstr(std::string&, std::string&)' 21 | if(strstr(s,x)!=NULL){ | ~~~~~~^~~~~ In file included from /usr/include/c++/14/cstring:43, from a.cc:3: /usr/include/string.h:330:14:...
s580312241
p00494
C++
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; int main() { static char str[1200000]; int len; vector<pair<char, int> > x; scanf("%s", str); len = strlen(str); for(int i = 0; i < len; ++i) { int it = i; while(it < len && str[it] == str[i]) ++it; x.push_back(make_pair(s...
a.cc: In function 'int main()': a.cc:23:48: error: no match for 'operator!=' (operand types are 'std::pair<char, int>' and 'char') 23 | if(jjj.first != 'J' || ooo.first != 'O' || iii != 'I') | ~~~ ^~ ~~~ | | | ...
s396022717
p00494
C++
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; int main() { static char str[1200000]; int len; vector<pair<char, int> > x; scanf("%s", str); len = strlen(str); for(int i = 0; i < len; ++i) { int it = i; while(it < len && str[it] == str[i]) ++it; x.push_back(make_pair(s...
In file included from /usr/include/c++/14/vector:62, from a.cc:3: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:27:19: required from here 27 | ans = max(ans, min(jjj.second, ooo....
s452009380
p00494
C++
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; int main() { static char str[1200000]; int len; vector<pair<char, int> > x; scanf("%s", str); len = strlen(str); for(int i = 0; i < len; ++i) { int it = i; while(it < len && str[it] == str[i]) ++it; x.push_back(make_pair(s...
a.cc: In function 'int main()': a.cc:27:61: error: expected ';' before ')' token 27 | ans = max(ans, min(min(jjj.second, ooo.second), iii.second))); | ^ | ;
s473880965
p00494
C++
#include <iostream> #include <string> using namespace std; int main(){ int K,cnt; char *in; char *joi; char JOI[4] = {"JOI"}; in = new char [1000001]; joi = new char [1000001]; cin >> in; K = strlen(in) / 3; for(int i = K; i > 0; i--){ cnt = 0; for(int c = 0; c < 3; c++){ for(int j = 0; j < i; j++...
a.cc: In function 'int main()': a.cc:17:13: error: 'strlen' was not declared in this scope 17 | K = strlen(in) / 3; | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstri...
s477766169
p00494
C++
#include <cstdio> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, x, n) for(int i = x; i < n; i++) int main() { const string joi = "JOI"; string str; cin >> str; int ans = 0; rep(i, str.size()) { int cs[3] = {0}; rep(j, 3) while(str[i] == joi[j]) cs[j]++; if(cs[...
a.cc: In function 'int main()': a.cc:8:9: error: 'string' does not name a type; did you mean 'stdin'? 8 | const string joi = "JOI"; | ^~~~~~ | stdin a.cc:10:3: error: 'string' was not declared in this scope 10 | string str; | ^~~~~~ a.cc:2:1: note: 'std::string' is defined...
s681123962
p00495
C
c[5004],d[5004],m,t,u,i,f="%d\n";main(x){for(scanf("%d%*d",c);i<*a;scanf(f,++i+c));for(;~scanf(f,&x);)for(u=i=t=0;i++<*c;t=d[i],d[i]=m<u?m=u:u)u=x-c[i]?u:t+1;m=!printf(f,m);}
main.c:1:1: warning: data definition has no type or storage class 1 | c[5004],d[5004],m,t,u,i,f="%d\n";main(x){for(scanf("%d%*d",c);i<*a;scanf(f,++i+c));for(;~scanf(f,&x);)for(u=i=t=0;i++<*c;t=d[i],d[i]=m<u?m=u:u)u=x-c[i]?u:t+1;m=!printf(f,m);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of '...
s379535267
p00495
C
c[5004],d[5004],m,u,i;p(z){u=~scanf(t="%d\n",z)||!printf(t,m);}main(t){for(p(c),p(d);i<*c;p(++i+c));for(;p(d);)for(u=i=t=0;i++<*c;t=d[i],d[i]=m<u?m=u:u)u=*d-c[i]?u:t+1;}
main.c:1:1: warning: data definition has no type or storage class 1 | c[5004],d[5004],m,u,i;p(z){u=~scanf(t="%d\n",z)||!printf(t,m);}main(t){for(p(c),p(d);i<*c;p(++i+c));for(;p(d);)for(u=i=t=0;i++<*c;t=d[i],d[i]=m<u?m=u:u)u=*d-c[i]?u:t+1;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-...
s312596308
p00495
C
#include <stdio.h> #include <stdlib.h> #include <memory.h> #define mem(x,y) (x*)malloc(sizeof(x)*(y)) int main() { int a,b; scanf("%d %d",&a,&b); int* an = mem(int,a); int* bu = mem(int,b); int i,j; int max = 0; for(i = 0;i < a;i++) { scanf("%d",an+i); } for(i = 0;i < b;i++) { scanf("%d",bu+i); } for...
main.c: In function 'main': main.c:27:37: error: 'bn' undeclared (first use in this function); did you mean 'bu'? 27 | if(an[j] == bn[pt]) | ^~ | bu main.c:27:37: note: each undeclared identifier is reported o...
s250606051
p00495
C++
#include <cstdio> #define rep(i,n) for(int i=0;i<n;i++) int n,m,ans,a[5000],b[5000]; int main(){ scanf("%d%d", &n, &m); rep(i,n) scanf("%d",&a[i]); rep(i,m) scanf("%d",&b[i]); rep(i,m){ if(ans>=m.size()-i)break; int cnt=0; rep(j,n){ if(i+cnt>=m)break; if(a[j]==b[i+cnt])cnt++; } if(cnt>ans)ans=c...
a.cc: In function 'int main()': a.cc:11:27: error: request for member 'size' in 'm', which is of non-class type 'int' 11 | if(ans>=m.size()-i)break; | ^~~~
s156431575
p00495
C++
#include<iosteream> #include<algorithm> #include<vector> using namespace std; int main(void){ int na,nb; cin>>na>>nb; vector<int> a(na); vector<int> b(nb); for(int i = 0 ; i < na ; i ++){ cin>>a[i]; } for(int i = 0 ; i < nb ; i ++){ cin>>b[i]; } int dp[2][5001]={{}}; int m = 0; for(int...
a.cc:1:9: fatal error: iosteream: No such file or directory 1 | #include<iosteream> | ^~~~~~~~~~~ compilation terminated.
s800157660
p00495
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, n) for(int i = s; i < (int)n; i++) #define per(i, n) for(int i = n; i >= 0; i--) #define ROF(i, s, n) for(int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #define ALL(a) (a).begin(),(a).end() #define RA...
a.cc:45:1: error: expected initializer before 'static' 45 | static int cards_2[ 5000 ]; | ^~~~~~ a.cc: In function 'int solve(int, int, bool)': a.cc:55:14: error: 'cards_1' was not declared in this scope 55 | if ( cards_1[ now_a ] == cards_2[ now_b ] ) { | ^~~~~~~ a.cc:55:34: erro...
s188007776
p00495
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define mp(x,y) make_pair(x,y) #define ALL(a) a.begin(),a.end() #define ZERO(a) memset(a,0,sizeof(a)) #define INF(a) memset(a,1000000000,sizeof(a)) #define len(a) sizeo...
a.cc:12:9: warning: "INF" redefined 12 | #define INF 1<<29 | ^~~ a.cc:8:9: note: this is the location of the previous definition 8 | #define INF(a) memset(a,1000000000,sizeof(a)) | ^~~ a.cc:28:12: error: macro "FOR" passed 3 arguments, but takes just 2 28 | FOR(j,i,m){ | ...
s056390748
p00495
C++
#include<bits/stdc++.h> #include<algorithm> #include<vector> #include<queue> using namespace std; typedef long long ll; int A,B,a[5000],b[5000]; int dp[5001]; int main(){ scanf("%d%d",&A,&B); for(int i=0;i<A;i++) scanf("%d",&a[i]); for(int i=0;i<B;i++) scanf("%d",&b[i]); int res=0; for(int i=1;i<=A;i++) for(int ...
a.cc: In function 'int main()': a.cc:18:61: error: invalid types 'int[int]' for array subscript 18 | if(a[i-1]==b[j-1]) dp[j]=max(dp[j-1]+1,dp[i][j]); | ^
s538513045
p00495
C++
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--) #define REP(i,n) for(int i=0;i<(n);i++) #define RREP(i,n) for(int i=n-1;i>=0;i--) #define PB push_back #define INF (1<<29) #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(),(a).rend() ...
a.cc: In function 'int main()': a.cc:40:27: error: no matching function for call to 'max(short int&, int&)' 40 | FOR(i,1,b+1) ans = max(dp[a][i],ans); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/1...
s512992150
p00495
C++
#include <stdio.h> #include <algorithm> using namespace std; int A, B, a[1000], b[1000]; int main() { scanf("%d%d", &A, &B); for(int i = 0; i < A; i++) scanf("%d", &a[i]); for(int i = 0; i < B; i++) scanf("%d", &b[i]); int ret = 0; for(int i = 0; i < B; i++) { int pos = i; for(int j = 0; j < A; j++) { if(po...
a.cc: In function 'int main()': a.cc:14:39: error: invalid types 'int[int]' for array subscript 14 | if(b[pos] == A[j]) pos++; | ^
s895038462
p00495
C++
#include<cstdio> #include<cstdlib> #include<vector> using name space std; int main(void){ int a[5000]; int b[5001]; int aa; int bb; int n; int max; int s; int c; max=0; scanf("%d %d",&aa,&bb); for(int i=0;i<aa;i++){ scanf("%d",&a[i]); } for(int i=0;i<bb;i++){ scanf("%d",&b[i]); } b[bb]=10000000; for(int i=0;i<bb;i++){ ...
a.cc:4:7: error: expected nested-name-specifier before 'name' 4 | using name space std; | ^~~~
s200406818
p00495
C++
#include<cstdio> #include<cstring> #include<algorithm> int a[5001],b[5001]; int c,d,i,j,s=0; void main(){ scanf("%d%d",&c,&d); for(i=0;i<c;i++){ scanf("%d",&a[i]); } for(j=0;j<d;j++){ scanf("%d",&b[j]); } for(int now=0;now<d;now++){ int r=now; for(i=0;i<c;i++){ if(a[i]==b[r]){ r++; if(r==d){ break; } } } s=std::max(r-n...
a.cc:6:1: error: '::main' must return 'int' 6 | void main(){ | ^~~~
s358609247
p00495
C++
#include<algorithm> int a[5001],b[5001]; int c,d,i,j,s=0; int main(){ scanf("%d%d",&c,&d); for(i=0;i<c;i++){ scanf("%d",&a[i]); } for(j=0;j<d;j++){ scanf("%d",&b[j]); } for(int now=0;now<d;now++){ int r=now; for(i=0;i<c;i++){ if(a[i]==b[r]){ r++; if(r==d){ break; } } } s=std::max(r-now,s); } printf("%d\n",s);return 0; ...
a.cc: In function 'int main()': a.cc:5:1: error: 'scanf' was not declared in this scope 5 | scanf("%d%d",&c,&d); | ^~~~~ a.cc:24:1: error: 'printf' was not declared in this scope 24 | printf("%d\n",s);return 0; | ^~~~~~ a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixabl...
s179445973
p00495
C++
#include <cstdio> #include <algorithm> using namespace std; int n; int m; int be[5005],en[5005]; int main() { scanf("%d %d",&n,&m); for(int i=1;i<=n;i++) { scanf("%d",&be[i]); } for(int i=1;i<=m;i++) { scanf("%d",&en[i]); } int ans=0; for(int i=1;i<=m;i++) { int last=i;...
a.cc: In function 'int main()': a.cc:24:26: error: 'st' was not declared in this scope; did you mean 'std'? 24 | if(en[last]==st[i]) | ^~ | std
s610143910
p00495
C++
include<iostream> #include<map> #include<algorithm> #include<vector> using namespace std; int main() { map<int,bool> exist; int a,b; cin >> a >> b; vector<int> A,B; vector<vector<int> > men; men.resize(2); men[0].resize(b),men[1].resize(b); A.resize(a),B.resize(b); for(int i=0;i<a;i++) cin >> A...
a.cc:1:1: error: 'include' does not name a type 1 | 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/include/c++/14/map:62, from a.cc:2: /usr/include/c++/14/ex...
s110500623
p00495
C++
line = gets A = gets.split B = gets.split ans = 0 A.each.with_index do |a, i| count = 0 B.each do |b| if A[i] == b count += 1 i += 1 end end ans = [ans, count].max end puts ans
a.cc:1:1: error: 'line' does not name a type 1 | line = gets | ^~~~
s820520910
p00496
C
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;i++) using namespace std; typedef long long ll; int a[3000],b[3000]; ll dp1[3000][3000],dp2[3000][3000]; int main() { int n,t,s;scanf("%d%d%d",&n,&t,&s); rep(i,n)scanf("%d%d",&a[i],&b[i]); int Max=0; for(int i=0;i<n;i++){ for(int j=0;j<=s;j++){ if(b[i]>...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s750013545
p00496
C++
#include<cstdio> using namespace std; int main(){ int N, T, S, M[3001]={}, maxM=0; scanf("%d%d%d", &N, &T, &S); if(S==0){ for(int n=0; n<N; n++){ scanf("%d%d", &mise_fun, &mise_time); cin >> mise_fun >> mise_time; for(int t=T; t>=mise_time; t--) int newM = M[t-mise_time] + mise_fun; if(M[t] > newM...
a.cc: In function 'int main()': a.cc:8:40: error: 'mise_fun' was not declared in this scope 8 | scanf("%d%d", &mise_fun, &mise_time); | ^~~~~~~~ a.cc:8:51: error: 'mise_time' was not declared in this scope 8 | scanf("%d...
s206849027
p00496
C++
#include<cstdio> using namespace std; int main(){ int N, T, S, M[3001]={}, maxM=0; scanf("%d%d%d", &N, &T, &S); if(S==0){ for(int n=0; n<N; n++){ int mise_fun, mise_time; scanf("%d%d", &mise_fun, &mise_time); for(int t=T; t>=mise_time; t--) int newM = M[t-mise_time] + mise_fun; if(M[t] > newM){ ...
a.cc: In function 'int main()': a.cc:12:38: error: 't' was not declared in this scope 12 | if(M[t] > newM){ | ^ a.cc:12:43: error: 'newM' was not declared in this scope 12 | if(M[t] > newM){ | ...
s204546650
p00496
C++
#include<iostream> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, T, S, M[3001]={}, maxM=0; cin >> N >> T >> S; if(S==0){ for(int n=0; n<N; n++){ int mise_fun, mise_time; cin >> mise_fun >> mise_time; for(int t=T; t>=mise_time; t--){ int newM = M[t-mise_time] + m...
a.cc: In function 'int main()': a.cc:37:18: error: 'max_element' was not declared in this scope 37 | cout << *max_element(M+1, M+T+1) << endl; | ^~~~~~~~~~~
s481179207
p00496
C++
include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N, T, S; cin >> N >> T >> S; vector<int> A(N); vector<int> B(N); vector<int> dp(T+1, 0); for (int i = 0; i < N; i++){ cin >> A[i] >> B[i]; } int ans = 0; for (int n = 0; n <N; n++){ for (int t = T-B[n]; t >=...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s885944797
p00496
C++
include<bits/stdc++.h> using namespace std; int dp[3001][3001]; int a[3000], b[3000]; int N, T, S; int rec(int idx, int time){ if(idx == N || time == T) return(0); if(~dp[idx][time]) return(dp[idx][time]); int ret = max( rec( idx + 1, time), rec( idx, time + 1)); if((time + b[idx] <= S || time >= S) && time...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int rec(int, int)': a.cc:11:13: error: 'max' was not declared in this scope 11 | int ret = max( rec( idx + 1, time), rec( idx, time + 1)); | ^~~ a.cc: In function 'int main()': a.cc:1...
s492323879
p00496
C++
n, t, s = gets.split.map &:to_i s = t - s if 2 * s < t items = $<.map{|s| s.split.reverse.map &:to_i} table = (0..1).map { (0..s).map{|g| [0] * ((g < t-s ? g : t-s) + 1)} } for k in 0..items.size-1 c, v = items[k] for i in 0..s j_max = (i < t-s ? i : t-s) for j in 0..j_max cand = [] cand << table[0][i][j]...
a.cc:6:10: error: too many decimal points in number 6 | table = (0..1).map { (0..s).map{|g| [0] * ((g < t-s ? g : t-s) + 1)} } | ^~~~ a.cc:6:23: error: too many decimal points in number 6 | table = (0..1).map { (0..s).map{|g| [0] * ((g < t-s ? g : t-s) + 1)} } | ^~~~ a...
s998145880
p00496
C++
//Solution for aoj 0573: Night Market #include<iostream> #include<algorithm> using namespace std; int n, s, t, time = 0, happy = 0 , ans; double save; int sho[3000][2], dp[3000][3000]; void solve(){ for (int i = 2; i <= n; i++){ for (int j = 1; j <= t; j++){ dp[i][j] = max(dp[i][j], max(dp[i - 1][j], dp[i][j - 1]...
a.cc:5:14: error: 'int time' redeclared as different kind of entity 5 | int n, s, t, time = 0, happy = 0 , ans; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linu...
s527591835
p00496
C++
#include <iostream> using namespace std; int a[3010],b[3010],dp[2][3010],mm1[3010][2],mm2[3010][2]; int main(){ int N,T,S,I,O,hog,hma,res; cin>>N>>T>>S; for(int i=1;i<=N;i++){ cin>>a[i]>>b[i]; } memset(dp[0],-1,sizeof(dp[0])); I=0;O=1; dp[0][0]=0; for(int i=1;i<=N;i++){ memset(dp[O],-1,sizeof(dp[O])); hm...
a.cc: In function 'int main()': a.cc:11:9: error: 'memset' was not declared in this scope 11 | memset(dp[0],-1,sizeof(dp[0])); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include...
s487549830
p00496
C++
#include <algorithm> #include <iostream> #include <cstdint> using namespace std; int N,T,S,A[3000],B[3000]; int dp[3000][3000]; void init() { memset(dp,NULL,3000*3000); } int rc(int depth,int time,int d_end) { if(dp[depth][time] != 0) { return dp[depth][time]; } else { int res1 = 0; int res2 = 0; if(...
a.cc: In function 'void init()': a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(dp,NULL,3000*3000); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <cstdint> +++ |+#include <cst...
s486645503
p00496
C++
#include <algorithm> #include <iostream> #include <cstdint> using namespace std; int N,T,S,A[3000],B[3000]; int dp[3000][3000]; void init() { memset(dp,NULL,3000*3000); } int rc(int depth,int time,int d_end) { if(dp[depth][time] != 0) { return dp[depth][time]; } else { int res1 = 0; int res2 = 0; if(...
a.cc: In function 'void init()': a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(dp,NULL,3000*3000); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <cstdint> +++ |+#include <cst...
s155478531
p00496
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<functional> #include<algorithm> #include<cstdio> using namespace std; typedef long long ll; int dp[3001][3001]; ll n, t, s; struct A { ll a, b; }; A a[3000]; ll sol...
a.cc: In function 'll solve(ll, ll)': a.cc:45:26: error: no matching function for call to 'max(ll&, int&)' 45 | sum = max(sum, dp[i + 1][j]); | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale...
s079214561
p00496
C++
#include<iostream> #include<algorithm> using namespace std; typedef long long ll; int N, S, T; int A[3000], B[3000]; int dp[3001][3001]; int main() { cin >> N >> T >> S; for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; } dp[0][0] = 0; if (B[0] <= S && B[0] < T)dp[B[0]][1] = A[0]; ...
a.cc: In function 'int main()': a.cc:30:42: error: no matching function for call to 'max(ll&, int&)' 30 | for (int i = 0; i <= N; i++)ans = max(ans, dp[T - 1][i]); | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/...
s673607194
p00496
C++
#include<stdio.h> #include<algorithm> using namespace std; int a[3000],b[3000],c[3001][3001]; int main(void) { int n,s,t,i,j,m; scanf("%d %d %d",&m,&s,&t); for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<=m;i++){ for(j=0;j<=s;j++){ c[i][j]=0; } } for(i=0;i<m;i++){ for(j=0;j<=s;j++){ if(j+...
a.cc:33:9: error: 'n' does not name a type 33 | n=0; | ^ a.cc:34:9: error: expected unqualified-id before 'for' 34 | for(i=0;i<=s;i++){ | ^~~ a.cc:34:17: error: 'i' does not name a type 34 | for(i=0;i<=s;i++){ | ^ a.cc:34:22: error: 'i' ...
s722279222
p00496
C++
include<stdio.h> #include<algorithm> using namespace std; int a[3000],b[3000],c[3001][3001]; int main(void) { int n,s,t,i,j,m; scanf("%d %d %d",&m,&s,&t); for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<=m;i++){ for(j=0;j<=s;j++){ c[i][j]=0; } } for(i=0;i<m;i++){ for(j=0;j<=s;j++){ if(j+b...
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gn...
s907429257
p00496
C++
#include<stdio.h> int max,n,m,h,max,sum,a[100000],b[3000],i; int main(void) { scanf("%d %d %d",&n,&m,&h); for(i=1;i<=n;i++) scanf("%d %d",&a[i],&b[i]); sum=0; max=0; func(0,1); printf("%d\n",max); return 0; } int func(int m1,int n1){ if(n>=n1&&m>=m1){ if(m1<h&&m1+b[n1]>h); else if(m1+b[n1]<=m){ m1+=b[n1];...
a.cc:2:15: error: redefinition of 'int max' 2 | int max,n,m,h,max,sum,a[100000],b[3000],i; | ^~~ a.cc:2:5: note: 'int max' previously declared here 2 | int max,n,m,h,max,sum,a[100000],b[3000],i; | ^~~ a.cc: In function 'int main()': a.cc:8:9: error: 'func' was not declared in this ...
s400849077
p00496
C++
//============================================================================ // Name : tiny.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iost...
a.cc:17:27: error: 'long int time [3010]' redeclared as different kind of entity 17 | long happy[3010],time[3010]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include...
s754156985
p00496
C++
#include <cstdio> #include <algorithm> using namespace std; int main(){ long long n,s,t,a[3001],b[3001]; long long dp[3001][3001]={}; scanf("%lld %lld %lld",&n,&s,&t); for(int i=0;i<n;i++){ scanf("%d %d",&a[i],&b[i]); } for(int i=0;i<n;i++){ for(int j=0;j<=t;j++){ if(j<b[i]){ dp[i+1][j]=dp[i][j]; }e...
a.cc: In function 'int main()': a.cc:25:2: error: expected '}' at end of input 25 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s240396910
p00496
C++
#include <cstdio> #include <algorithm> using namespace std; long long dp[3001][3001]={}; long long x[3001][2]; long long n,t,s; int main(){ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scanf("%lld %lld %lld",&n,&t,&s); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(int i=1;i<=n;i++){ &#160;&#160;&#160;&#160;&#1...
a.cc:8:2: error: stray '#' in program 8 | &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scanf("%lld %lld %lld",&n,&t,&s); | ^ a.cc:8:8: error: stray '#' in program 8 | &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scanf("%lld %lld %lld",&n,&t,&s); | ^ a.cc:8:14: error: stray '#' in progr...
s617079483
p00496
C++
#include <cstdio> #include <algorithm> using namespace std; long long dp[3001][3001]={}; long long x[3001][2]; long long n,t,s; int main(){ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scanf("%lld %lld %lld",&n,&t,&s); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(int i=1;i<=n;i++){ &#160;&#160;&#160;&#160;&#1...
a.cc:8:2: error: stray '#' in program 8 | &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scanf("%lld %lld %lld",&n,&t,&s); | ^ a.cc:8:8: error: stray '#' in program 8 | &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scanf("%lld %lld %lld",&n,&t,&s); | ^ a.cc:8:14: error: stray '#' in progr...
s893220099
p00496
C++
#include <cstdio> #include <algorithm> using namespace std; long long dp[3001][3001]={}; long long x[3001][2]; long long n,t,s; int main(){ scanf("%lld %lld %lld",&n,&t,&s); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(int i=1;i<=n;i++){ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&...
a.cc:9:2: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(int i=1;i<=n;i++){ | ^ a.cc:9:8: error: stray '#' in program 9 | &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(int i=1;i<=n;i++){ | ^ a.cc:9:14: error: stray '#' in program 9 | &#160;&#160...