submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s532360590
p00232
C++
#include<iostream> #include<cstdio> using namespace std; #define MAX 100 #define MMAX 5001 int X, Y, Z, A[MAX], V[MAX], E[MAX]; void compute() { float P[MMAX][MAX]; for (int i = 0; i < MMAX; i++) { for (int j = 0; j <= Y; j++) P[i][j] = 0; } P[0][0] = 1.0; int np, nv; for (int j = 0; j < Y; j++) { for (int...
a.cc:38:1: error: '::main' must return 'int' 38 | void main() { | ^~~~
s305224299
p00232
C++
#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; #define REP(i,b,n) for(int i=b;i<n;i++) #define rep(i,n) REP(i,0,n) typedef long long ll; enum {GO=1,GET=2,LOST=3}; /* ƒ‹[ƒŒƒbƒg‚Í4Ží—Þ ƒ}ƒX‚̐”y <= 50 50 * 50 * (100*50) * 4 dp[ith][jth turn][syojikin] = ƒpƒ^[ƒ“” */ const int N = 5...
a.cc:62:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 62 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:75:18: error: 'floor' was not declared in this scope 75 | double ans = floor(solve(n,X,rt,event,eval,sum)+1e-10); | ^~~~~
s667081633
p00232
C++
#include <cstdio> #include <cstring> #include <map> #include <algorithm> using namespace std; typedef pair<int, int> P; int x, y, z, n, a, e; int v[4]; P event[55]; double dp[55][5050][2]; //double dp[55][5050]; int main() { while (scanf("%d%d%d",&x,&y,&z)) { if (!x&&!y&&!z) break; fill...
a.cc: In function 'int main()': a.cc:90:2: error: expected '}' at end of input 90 | } | ^ a.cc:21:12: note: to match this '{' 21 | int main() { | ^
s381185263
p00232
C++
#include "stdafx.h" #include<iostream> #include<cstdio> #include<vector> #include<map> #include<queue> #include<algorithm> int x,y,z; int invN[51],invE[51],invA[51],le[5]; long double dp[5001][51]; using namespace std; void life(int m,int n){ int a,b,c; int next,gm; int flag=1; if(n==y)return; //ルーレットを回す for(...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s920516953
p00232
C++
int x,y,z; int invN[51],invE[51],invA[51],le[5]; double dp[5001][51]; double ans=0; using namespace std; void life(int m,int n){ int a,b,c; int next,gm; int flag=1; if(n==y)return; //ルーレットを回す for(a=0;a<x;a++){ next=n+le[a]; //ゴール if(next>=y){ ans+=m*dp[m][n]/x; }else{ //イベントマスにとまったか flag=0; ...
a.cc: In function 'int main()': a.cc:60:17: error: 'cin' was not declared in this scope 60 | cin >> x >> y >> z; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int x...
s675371312
p00232
C++
#include <iostream> #include <vector> using namespace std; #define rep(i, n) for(int i = 0;i < n;i++) vector<int> V; struct Cell { int N, E, A; }; vector<Cell> cells; float memo[50][100 * 50]; float rec(int current, int patternNum, int money) { if(memo[current][money] != -1) return memo[current][money]; ...
a.cc: In function 'int main()': a.cc:63:9: error: 'memset' was not declared in this scope 63 | memset(memo, -1, 50 * 100 * 50 * sizeof(float)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <vector> ...
s334126656
p00233
C++
#include<iostream> using namespace std; &#160; int main(){ &#160;&#160;int n; &#160; &#160;&#160;while(cin >> n && n){ &#160;&#160;&#160;&#160;int res = 0,k=0,tmp = 1; &#160;&#160;&#160;&#160;while(n){ &#160;&#160;&#160;&#160;&#160;&#160;res += ((n%10)+10)%10 * tmp; &#160;&#160;&#160;&#160;&#160;&#160;if(n%10<0)n-=10; ...
a.cc:3:2: error: stray '#' in program 3 | &#160; | ^ a.cc:5:2: error: stray '#' in program 5 | &#160;&#160;int n; | ^ a.cc:5:8: error: stray '#' in program 5 | &#160;&#160;int n; | ^ a.cc:6:2: error: stray '#' in program 6 | &#160; | ^ a.cc:7:2: error: stray '#' in prog...
s109055079
p00233
C++
#include<iostream> using namespace std; &#160; int main(){ &#160;&#160;int n; &#160; &#160;&#160;while(cin >> n && n){ &#160;&#160;&#160;&#160;int res = 0,k=0,tmp = 1; &#160;&#160;&#160;&#160;while(n){ &#160;&#160;&#160;&#160;&#160;&#160;res += ((n%10)+10)%10 * tmp; &#160;&#160;&#160;&#160;&#160;&#160;if(n%10<0)n-=10; ...
a.cc:3:2: error: stray '#' in program 3 | &#160; | ^ a.cc:5:2: error: stray '#' in program 5 | &#160;&#160;int n; | ^ a.cc:5:8: error: stray '#' in program 5 | &#160;&#160;int n; | ^ a.cc:6:2: error: stray '#' in program 6 | &#160; | ^ a.cc:7:2: error: stray '#' in prog...
s897544136
p00233
C++
#include <iostream> #include <string> using namespace std; #define rep(x,to) for(int x=0; x<(to); ++(x)) int main() { int x; while(cin >> x, x) { string ans = ""; while(x) { int tmp = (x % 10 + 10) % 10; ans += '0' + tmp; x = (x - tmp) / -10; } ...
a.cc: In function 'int main()': a.cc:15:9: error: 'reverse' was not declared in this scope 15 | reverse(ans.begin(), ans.end()); | ^~~~~~~
s944178959
p00233
C++
#include<cstdio> #include<string> using namespace std; typedef long long ll; int main(){ for(ll n;scanf("%lld",&n),n;){ string ans; while(n){ int dgt=n%10; if(dgt<0) dgt+=10; ans+=(dgt+'0'); n=(n-dgt)/-10; } reverse(ans.begin(),ans.end()); puts(ans.c_str()); } return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'reverse' was not declared in this scope 17 | reverse(ans.begin(),ans.end()); | ^~~~~~~
s822243074
p00233
C++
char s[];n,a;main(r){for(;scanf("%d",&a)*a;puts(s+n))for(;a;a=(r-a)/10)r=(a%10+10)%10,s[--n]=r+48;}
a.cc:1:6: error: storage size of 's' isn't known 1 | char s[];n,a;main(r){for(;scanf("%d",&a)*a;puts(s+n))for(;a;a=(r-a)/10)r=(a%10+10)%10,s[--n]=r+48;} | ^ a.cc:1:10: error: 'n' does not name a type 1 | char s[];n,a;main(r){for(;scanf("%d",&a)*a;puts(s+n))for(;a;a=(r-a)/10)r=(a%10+10)%10,s[--n]=r+48...
s336099790
p00233
C++
#include<cstdio> #include<iostream> #include<cstring> #include<vector> #include<algorithm> using namespace std; typedef long long ll; ll rsum[]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,10000000000}; //int dm[]={1,-1}; ll abs(ll a){ return a>0?a:-a; } int main(){ ll n; while(scanf("%lld",&n)...
a.cc: In function 'int main()': a.cc:17:10: error: call of overloaded 'abs(ll&)' is ambiguous 17 | n=abs(n); | ~~~^~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_strin...
s660337846
p00233
C++
#include<stdio.h> long long solve(int x){ int ans[] = {9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0}; long long now = -909090909090; now = (long long)x - now; int p = 11, i; while(now){ ans[p] = abs(ans[p] - (now % 10)); p--;now/=10; } char res[100]; for(i = 0;i < 12;i++)res[i] = ans[i] + '0'...
a.cc: In function 'long long int solve(int)': a.cc:11:18: error: 'abs' was not declared in this scope; did you mean 'ans'? 11 | ans[p] = abs(ans[p] - (now % 10)); | ^~~ | ans
s331073675
p00234
Java
import java.util.Scanner; //Aizu Buried Treasure public class Main{ int w, h, f, m, o; long[][] a; long[][][][] dp; long get(int i, int j, int s, int rest){ if(i==h)return 0; if(rest<1)return dp[i][j][s][rest] = 1L<<30; if(dp[i][j][s][rest]!=-1)return dp[i][j][s][rest]; long x = 0; int nr = rest; ...
Main.java:53: error: cannot find symbol new AOJ0234().run(); ^ symbol: class AOJ0234 location: class Main 1 error
s052167095
p00234
C
W,H,m,c[10][10];DP[51][10][10][10][10];CalcO(o,x,y){c[x][y]>0?o+=c[x][y]:0;return o>0?o>m?m:o:0;}CalcF(f,x,y){return c[x][y]<0?f+c[x][y]:f;}Walk(x,y,l,r,o,f){int*p=&DP[o][y][x][l][r];f>*p?*p=f:0;}Dig(x,y,l,r,o,f){Walk(x,y,l,r,CalcO(o-1,x,y),CalcF(f,x,y));}main(){int*p,x,y,g,d,v,f,o,l,r,f0;for(;scanf("%d%d%d%d%d",&W,&H,...
main.c:1:1: warning: data definition has no type or storage class 1 | W,H,m,c[10][10];DP[51][10][10][10][10];CalcO(o,x,y){c[x][y]>0?o+=c[x][y]:0;return o>0?o>m?m:o:0;}CalcF(f,x,y){return c[x][y]<0?f+c[x][y]:f;}Walk(x,y,l,r,o,f){int*p=&DP[o][y][x][l][r];f>*p?*p=f:0;}Dig(x,y,l,r,o,f){Walk(x,y,l,r,CalcO(o-1,x,y),CalcF...
s298717820
p00234
C++
#include <iostream> #include <algorithm> #include <utility> #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <string> #include <sstream> #include <cstring> #include <cstdlib> using namespace std; #define ALL(c) c.begin(),c.end() #define RALL(c) c.rbegin(),c.re...
a.cc: In function 'void Solve()': a.cc:98:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 98 | int main(){ | ^~ a.cc:98:9: note: remove parentheses to default-initialize a variable 98 | int main(){ | ^~ | -- a.cc:98:9: note: or ...
s270076714
p00234
C++
//Solution for aoj:0212 Highway Express Bus #include<iostream> #include<algorithm> #include<vector> #include<queue> #include<functional> using namespace std; struct S { int cost, x, y, o, xh; S(int c, int in_x, int in_y, int in_o, int in_xh) : cost(c), x(in_x), y(in_y), o(in_o), xh(in_xh){} bool operator<(const S &...
a.cc: In function 'int main()': a.cc:79:17: error: 'memset' was not declared in this scope 79 | memset(stratum, sizeof(stratum), 0); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include<funct...
s182846689
p00234
C++
#include<bits/stdc++.h> #define INF 0x3f3f3f3f #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; int c[11][11], d[11][11][51][1 << 10]; int dx[]{ 1,0,0 }, dy[]{ 0,1,-1 }; struct st { int x, y, p, v, c; }; bool operator<(st a, st b) { return a.c > b.c; } int main() { int w, h; while (scanf("%d%d", &w, &h), ...
a.cc: In function 'int main()': a.cc:42:9: error: jump to label 'g' 42 | g:; | ^ a.cc:14:48: note: from here 14 | if (o == 0) { puts("NA"); goto g; } | ^ a.cc:38:21: note: crosses initialization of 'int Min' 38 | ...
s936818244
p00234
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<vector> #include<sstream> #include<set> #include<map> #include<algorithm> #include<cassert> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define fr(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++) #d...
a.cc: In function 'int main()': a.cc:73:21: error: redeclaration of 'int ans' 73 | int ans=inf; | ^~~ a.cc:32:21: note: 'int ans' previously declared here 32 | int ans=inf; | ^~~
s124908691
p00234
C++
#include <cstdio> #include <iostream> #include <sstream> #include <iomanip> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <climits> #include <cfloat> using namespace ...
a.cc: In member function 'int Data::toInt()': a.cc:34:23: error: 'w' was not declared in this scope 34 | return (((y * w + x) * w + left) * w + right) * (m+1) + o; | ^ a.cc:34:58: error: 'm' was not declared in this scope; did you mean 'tm'? 34 | return (((y * w + x) * ...
s741516467
p00234
C++
Aizu Buried Treasure
a.cc:1:1: error: 'Aizu' does not name a type 1 | Aizu Buried Treasure | ^~~~
s562130417
p00234
C++
#include <cstdio> #include <cstdlib> #include <queue> using namespace std; #define inf (1<<27) struct State { int x,y,l,r,o,c; State(int xx,int yy,int ll,int rr,int oo,int cc) { x=xx,y=yy,l=ll,r=rr,o=oo,c=cc; } }; bool operator > (const State &left,const State &right) { return left.c>right.c...
a.cc: In function 'int main()': a.cc:26:17: error: 'memset' was not declared in this scope 26 | memset(cost,0x10,sizeof(cost)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <queue> ...
s697626378
p00234
C++
#include<cstdio> #include<queue> #include<algorithm> using namespace std; #define INF 1<<25 typedef struct n { int w,h,m,o,g[11][11]; }n; struct Order { bool operator ()(n const& a, n const& b) const { return a.m<b.m; } }; int W,H,F,M,O,G[11][11],mv[4]={0,1,0,-1},f; n cr(int h,int w,int o,int m,int g[11][11]...
a.cc: In function 'n cr(int, int, int, int, int (*)[11])': a.cc:29:9: error: 'memcpy' was not declared in this scope 29 | memcpy(ins.g,g,sizeof(ins.g)); | ^~~~~~ a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<a...
s342297657
p00235
Java
import java.util.Scanner; public class SaveBrian { static int [][] map; static int N; static int total; public static void main(String[] args) { Scanner sc=new Scanner(System.in); int x,y; while(sc.hasNext()){ N=sc.nextInt(); if(N==0){ sc.close(); break; } initialise(N); //値の更新 N-1個分のデ...
Main.java:3: error: class SaveBrian is public, should be declared in a file named SaveBrian.java public class SaveBrian { ^ 1 error
s053927042
p00235
Java
int n; int t[22][22]; int solve(int idx){ int res = 0; rep(i,n){ if(t[idx][i] > 0){ t[i][idx] = 0; res = max(res,t[idx][i]+solve(i)); } } return res; } int main(void){ while(cin>>n,n){ memset(t,0,sizeof(t)); int sum = 0; rep(i,n-1){ int a,b,cost; cin>>a>>b>>cost;...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. int n; ^ (use --enable-preview to enable unnamed classes) Main.java:2: error: class, interface, enum, or record expected int t[22][22]; ^ Main.java:6: error: ';' expected rep(i,n){ ^ Main.java:16: error: not a statement...
s434055542
p00235
C
#include<stdio.h> #include<vector> using namespace std; #define INF 100000 int d[20][20]; vector<int> ch[20]; bool term[20]; bool nterm[20]; bool used[20]; int min(int a,int b){return a<b?a:b;} int main(){ int n; int i,j,k; while(1){ scanf("%d",&n); if(n==0)return 0; for(i=0;i<n;i++)for(j=0;j<n;j++)d[i][j]=INF; ...
main.c:2:9: fatal error: vector: No such file or directory 2 | #include<vector> | ^~~~~~~~ compilation terminated.
s787427198
p00235
C
int n; int t[22][22]; int solve(int idx){ int res = 0; rep(i,n){ if(t[idx][i] > 0){ t[i][idx] = 0; res = max(res,t[idx][i]+solve(i)); } } return res; } int main(void){ while(cin>>n,n){ memset(t,0,sizeof(t)); int sum = 0; rep(i,n-1){ int a,b,cost; cin>>a>>b>>cost;...
main.c: In function 'solve': main.c:6:3: error: implicit declaration of function 'rep' [-Wimplicit-function-declaration] 6 | rep(i,n){ | ^~~ main.c:6:7: error: 'i' undeclared (first use in this function) 6 | rep(i,n){ | ^ main.c:6:7: note: each undeclared identifier is reported only once...
s655040573
p00235
C++
#include <iostream> using namespace std; int n; int t[22][22]; int solve(int idx){ int res = 0; rep(i,n){ if(t[idx][i] > 0){ t[i][idx] = 0; res = max(res,t[idx][i]+solve(i)); } } return res; } int main(void){ while(cin>>n,n){ memset(t,0,sizeof(t)); int sum = 0; rep(i,n-1){ ...
a.cc: In function 'int solve(int)': a.cc:9:7: error: 'i' was not declared in this scope 9 | rep(i,n){ | ^ a.cc:9:3: error: 'rep' was not declared in this scope; did you mean 'res'? 9 | rep(i,n){ | ^~~ | res a.cc: In function 'int main()': a.cc:20:5: error: 'memset' was not declar...
s922249197
p00235
C++
#include<iostream> #include<algorithm> using namespace std; int n; int cost[20][20]; int edgenum[20]; int dis[20];//?????????????????????????????§??????????????¢???????????????????????? void dfs(int idx,int totalcost,int parent) { if (edgenum[idx] == 1) { dis[idx] = -1; return; } dis[idx] = totalcost; for (i...
a.cc: In function 'int main()': a.cc:49:17: error: 'memset' was not declared in this scope 49 | memset(cost, 0, sizeof(cost)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> ...
s266940748
p00235
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int n; int cost[20][20]; int edgenum[20]; int dis[20];//?????????????????????????????§??????????????¢???????????????????????? void dfs(int idx,int totalcost,int parent) { if (edgenum[idx] == 1) { dis[idx] = -1; return; } dis[idx] = t...
a.cc: In function 'int main()': a.cc:50:17: error: 'memset' was not declared in this scope 50 | memset(cost, 0, sizeof(cost)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> ...
s732140393
p00235
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <queue> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set>...
a.cc: In function 'int main()': a.cc:63:9: error: 'memset' was not declared in this scope 63 | memset(cost,0,sizeof(cost)); | ^~~~~~ a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 22 | #include <stack> +++ |+#include <cst...
s226981781
p00235
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <queue> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set>...
a.cc: In function 'int main()': a.cc:64:9: error: 'memset' was not declared in this scope 64 | memset(cost,0,sizeof(cost)); | ^~~~~~ a.cc:24:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 23 | #include <stdlib.h> +++ |+#include <...
s763964083
p00235
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <queue> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set>...
a.cc: In function 'int main()': a.cc:65:9: error: 'memset' was not declared in this scope 65 | memset(cost,0,sizeof(cost)); | ^~~~~~ a.cc:25:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 24 | #include<cstdio> +++ |+#include <cst...
s343765601
p00235
C++
#include <bits/stdc++.h> using namespace std; int num; int a[21][21]={0}; int retcost(int Island){ int x=0; for(int i=1;i<=num;i++){ if(a[Island][i]){ a[i][Island]=0; x=max(x,a[Island][i]+cost(i)); } } return x; } int main(void){ while(cin>>num,num){ int I1,I2,t,I[num+1]={0},Cost=0; for(int i=1;i<...
a.cc: In function 'int retcost(int)': a.cc:12:46: error: 'cost' was not declared in this scope; did you mean 'cosl'? 12 | x=max(x,a[Island][i]+cost(i)); | ^~~~ | cosl
s205050569
p00235
C++
#include <bits/stdc++.h> using namespace std; int num; int a[21][21]; int retcost(int Island){ int x=0; for(int i=1;i<=num;i++){ if(a[Island][i]){ a[i][Island]=0; x=max(x,a[Island][i]+retcost(i)); } } return x; } int main(void){ while(cin>>num,num){ int I1,I2,t,ans,I[num+1],Cost=0; memset(a,0,size...
a.cc: In function 'int main()': a.cc:40:18: error: expected '}' at end of input 40 | return 0; | ^ a.cc:18:15: note: to match this '{' 18 | int main(void){ | ^
s362368803
p00235
C++
#include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <numeric> #include <map> #include <string> #include <vector> #include <cmath> #include <queue> #include <algorithm> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> PP; typedef pair<P,P> P2; co...
a.cc: In function 'int main()': a.cc:55:17: error: 'memset' was not declared in this scope 55 | memset(G, -1, sizeof(G)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include <algorithm> +...
s021126187
p00235
C++
#include<iostream> #define MAXN 32 using namespace std; const int infty = 1<<24; int dfs(int now, int n, int par[MAXN], bool vis[MAXN], bool leaf[MAXN], int W[MAXN][MAXN]){   int ret = 0;   int cnt = 0;   vis[now]=true;   for(int i = 0; i < n; ++i){     if(W[now][i]>0 && !vis[i]){ Â...
a.cc:9:1: error: extended character ‚ is not valid in an identifier 9 |   int ret = 0; | ^ a.cc:9:1: error: extended character   is not valid in an identifier a.cc:9:1: error: extended character ‚ is not valid in an identifier a.cc:9:1: error: extended character   is not valid in an identifier a.cc:10:1...
s968040473
p00235
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; struct edge{ int to,cost; }; int n; vector<edge> G[30]; const int INF=1000000000; bool passed[30]; bool passed2[30]; // •’ʂɍċA‚µ‚ăRƒXƒg‚ðŒvŽZ int rec(int s){ passed[s]=true; int sumCost=0; bool f=fa...
a.cc: In function 'int dfs(int)': a.cc:51:9: error: 'memset' was not declared in this scope 51 | memset(passed,0,sizeof(passed)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#inc...
s600021699
p00235
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int maxn; vector<int> to[21]; int cost[21][21]; int tree[21];//その木の種類を示す //0:tree,1:leaf,2:last bool isgo[21]; int dfs(int t,int c) { int sum = 0; isgo[t] = true; bool go = false; for(int i=0;i<to[t].size();++i){ int next = to[t][i...
a.cc: In function 'int main()': a.cc:65:17: error: 'memset' was not declared in this scope 65 | memset(isgo,false,sizeof(isgo)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <vector> ...
s170604553
p00235
C++
int n; int t[22][22]; int solve(int idx){ int res = 0; rep(i,n){ if(t[idx][i] > 0){ t[i][idx] = 0; res = max(res,t[idx][i]+solve(i)); } } return res; } int main(void){ while(cin>>n,n){ memset(t,0,sizeof(t)); int sum = 0; rep(i,n-1){ int a,b,cost; cin>>a>>b>>cost;...
a.cc: In function 'int solve(int)': a.cc:6:7: error: 'i' was not declared in this scope 6 | rep(i,n){ | ^ a.cc:6:3: error: 'rep' was not declared in this scope; did you mean 'res'? 6 | rep(i,n){ | ^~~ | res a.cc: In function 'int main()': a.cc:16:9: error: 'cin' was not declared ...
s836684171
p00235
C++
int n; int t[22][22]; int solve(int idx){ int res = 0; rep(i,n){ if(t[idx][i] > 0){ t[i][idx] = 0; res = max(res,t[idx][i]+solve(i)); } } return res; } int main(void){ while(cin>>n,n){ memset(t,0,sizeof(t)); int sum = 0; rep(i,n-1){ int a,b,cost; cin>>a>>b>>cost;...
a.cc: In function 'int solve(int)': a.cc:6:7: error: 'i' was not declared in this scope 6 | rep(i,n){ | ^ a.cc:6:3: error: 'rep' was not declared in this scope; did you mean 'res'? 6 | rep(i,n){ | ^~~ | res a.cc: In function 'int main()': a.cc:16:9: error: 'cin' was not declared ...
s107817692
p00235
C++
#include <vector> #include <iostream> #include <algorithm> #include <utility> #include <cstring> using namespace std; typedef long long int lli; typedef pair<int,int> P; const int INF=100000000; const long long int INF_=1000000000000000000; int N; vector<int> T[20]; int Cost[20][20]; int Count[20]; bool Done[20]; /...
a.cc: In function 'int main()': a.cc:122:17: error: 'sum' was not declared in this scope 122 | cout << sum-dfs(0) << endl; | ^~~ a.cc: At global scope: a.cc:124:5: error: expected unqualified-id before 'return' 124 | return 0; | ^~~~~~ a.cc:125:1: error: expected declarat...
s917117485
p00236
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } private void run() { Scanner scanner = new Scanner(System.in); loop: while (true) { w = scanner.nextInt(); h = scanner.nextInt(); if ((w | h) == 0) break; count = 0; visited = new ...
Main.java:66: error: unnamed classes are a preview feature and are disabled by default. private boolean dfs(int x, int y, int deep) { ^ (use --enable-preview to enable unnamed classes) Main.java:126: error: class, interface, enum, or record expected int count, w, h, sx, sy; ^ Main.java:129: error: class, ...
s769797853
p00236
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } private void run() { Scanner scanner = new Scanner(System.in); loop: while (true) { w = scanner.nextInt(); h = scanner.nextInt(); if ((w | h) == 0) break; count = 0; visited = new ...
Main.java:66: error: unnamed classes are a preview feature and are disabled by default. private boolean dfs(int x, int y, int deep) { ^ (use --enable-preview to enable unnamed classes) Main.java:126: error: class, interface, enum, or record expected int count, w, h, sx, sy; ^ Main.java:129: error: class, ...
s091964619
p00236
Java
import java.util.*; public class No11 { /** * @param args */ public static int[][] map; static int W,H,sh = 0,sw = 0; static boolean res = false; static boolean first = true; static int[][] d = {{0,1,0,-1},{1,0,-1,0}}; public static void main(String[] args) { // TODO ツ篠ゥツ督ョツ青カツ青ャツつウツづェツつスツδソツッツドツ・ツスツタツブ ...
Main.java:2: error: class No11 is public, should be declared in a file named No11.java public class No11 { ^ 1 error
s087303183
p00236
C
int w,h; int d[9][9],q[9][9]; int a[4]={-1,0,1,0}; int X,Y,C,t; int b=0; int chk(int x,int y){ int i=0,ans=1; if(q[y][x])return 0; q[y][x]=1; if(d[y][x])return y==Y&&x==X; for(;i<4;i++)ans+=chk(x+a[i],y+a[(i+1)%4]); return ans; } int dfs(int x,int y,int c){ int i=0; if(!c&&x==X&&y==Y)return 1; memset(q,0,324),...
main.c: In function 'dfs': main.c:17:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 17 | memset(q,0,324), | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | int w,h; main.c:17:9: warning...
s215203787
p00236
C++
#include<bits/stdc++.h> using namespace std; typedef long long int64; const static int dy[4] = {0, -1, 0, 1}, dx[4] = {1, 0, -1, 0}; int W, H; int c[7][7]; pair< int, int > first; int64 used; set< pair< int64, unsigned char > > sets; #define getShift(x, y) (int64)(x + y * W) inline bool dfs(int x, int y, int bit) { ...
a.cc: In function 'int main()': a.cc:53:9: error: cast from 'const char*' to 'int' loses precision [-fpermissive] 53 | srand((int)"iky"); | ^~~~~~~~~~
s115510827
p00236
C++
using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "Input2"; static List<string> GetInputList() { var WillReturn = new List<string>(); if (InputPattern == "Input1") { WillReturn.Add("5 4"); WillReturn.Add...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s983132564
p00236
C++
#include<iostream> #include<queue> #include<vector> #include<algorithm> #include<cassert> #include<set> #include<cassert> using namespace std; #define REP(i,b,n) for(int i=b;i<n;i++) #define rep(i,n) REP(i,0,n) #define ALL(c) (c).begin(),(c).end() #define pb push_back typedef long long ll; bool vis[10][10]; char ...
a.cc:82:3: error: unterminated comment 82 | /* | ^ a.cc: In function 'bool search(int, int, int, int, int, int, int, int, int)': a.cc:80:18: error: expected '}' at end of input 80 | vis[y][x]=true; | ^ a.cc:64:41: note: to match this '{' 64 | int sy,int sx,int py,...
s441953313
p00236
C++
int w,h; int d[9][9]; int a[4]={-1,0,1,0}; int X,Y,C,t; int b=0; int dfs(int x,int y,int c){ int i=0; if(!c&&x==X&&y==Y)return 1; if(d[y][x])return 0; if(b++ > (1<<19))return 2; d[y][x]=1; for(;i<4;i++)if(t=dfs(x+a[i],y+a[(i+1)%4],c-1))return t; return d[y][x]=0; } int main(i,j){ for(;C=0,b=0,scanf("%d%d\n",&...
a.cc:16:5: error: cannot declare '::main' to be a global variable 16 | int main(i,j){ | ^~~~ a.cc:16:10: error: 'i' was not declared in this scope 16 | int main(i,j){ | ^ a.cc:16:12: error: 'j' was not declared in this scope 16 | int main(i,j){ | ^ a.cc:16:13: error: e...
s260237815
p00236
C++
int w,h; int d[9][9],q[9][9]; int a[4]={-1,0,1,0}; int X,Y,C,t; int b=0; int chk(int x,int y){ int i=0,ans=1; if(q[y][x])return 0; q[y][x]=1; if(d[y][x])return y==Y&&x==X; for(;i<4;i++)ans+=chk(x+a[i],y+a[(i+1)%4]); return ans; } void output(int a[9][9]){ int i,j; for(i=1;i<=h;i++){ for(j=1;j<=w;j++)printf("...
a.cc: In function 'void output(int (*)[9])': a.cc:18:34: error: 'printf' was not declared in this scope 18 | for(j=1;j<=w;j++)printf("%d",!!a[i][j]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include ...
s406086427
p00236
C++
int w,h; int d[9][9],q[9][9]; int a[4]={-1,0,1,0}; int X,Y,C,t; int b=0; int chk(int x,int y){ int i=0,ans=1; if(q[y][x])return 0; q[y][x]=1; if(d[y][x])return y==Y&&x==X; for(;i<4;i++)ans+=chk(x+a[i],y+a[(i+1)%4]); return ans; } int dfs(int x,int y,int c){ int i=0; if(!c&&x==X&&y==Y)return 1; memset(q,0,324),...
a.cc: In function 'int dfs(int, int, int)': a.cc:17:9: error: 'memset' was not declared in this scope 17 | memset(q,0,324), | ^~~~~~ a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' +++ |+#include <cstring> 1 | int w,h; a.c...
s750112649
p00236
C++
#include<cstdio> int table[7][7],a,b,l,m; int solve(int x,int y,int z){ if(z==a*b)return (x==l&&y==m)?1:0; if(x<0 || x>=b || y<0 || y>=a ||table[x][y]==1) return 0; table[x][y]=1; int res=0; res=solve(x+xx[0],y+yy[0],z+1)||solve(x+xx[1],y+yy[1],z+1)||solve(x+xx[2],y+yy[2],z+1)||solve(x+xx[3],y+yy[3],z+1); table...
a.cc: In function 'int solve(int, int, int)': a.cc:10:21: error: 'xx' was not declared in this scope; did you mean 'x'? 10 | res=solve(x+xx[0],y+yy[0],z+1)||solve(x+xx[1],y+yy[1],z+1)||solve(x+xx[2],y+yy[2],z+1)||solve(x+xx[3],y+yy[3],z+1); | ^~ | x a.cc:10...
s187464281
p00237
C++
3 4 1 0 3 0 2 1 2 3 2 5 3 4 5 3 5 5 6 4 3 2 1 0 3 0 2 1 2 3 2 5 3 4 5 3 5 5 6 4 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 4 | ^
s773571741
p00237
C++
#include <bits/stdc++.h> using namespace std; namespace geometry { // ???????????§?????? typedef complex<double> Point; struct Segment { Point p1, p2; Segment(const Point &p1 = Point(), const Point &p2 = Point()): p1(p1), p2(p2){} }; struct Circle { Point p; double r; Circle(const Point &p = Point...
a.cc: In function 'bool intersect(const geometry::Polygon&, const geometry::Polygon&)': a.cc:326:21: error: 'contain' was not declared in this scope 326 | if (contain(h, g[i])) return true; | ^~~~~~~ a.cc:329:21: error: 'contain' was not declared in this scope 329 | ...
s009355442
p00237
C++
#include <bits/stdc++.h> using namespace std; namespace geometry { // ???????????§?????? typedef complex<double> Point; struct Segment { Point p1, p2; Segment(const Point &p1 = Point(), const Point &p2 = Point()): p1(p1), p2(p2){} }; struct Circle { Point p; double r; Circle(const Point &p = Point...
a.cc: In function 'int solve()': a.cc:454:27: error: 'cmp' was not declared in this scope; did you mean 'bcmp'? 454 | if (indeg[cmp[i]] == 0) res++; | ^~~ | bcmp a.cc: In function 'std::vector<std::complex<double> > geometry::crossPoints(...
s508680802
p00237
C++
#include <cstdio> #include <cmath> #include <vector> #include <algorithm> #define MAX_N (128) #define EPS (0.01) #define SQ(X) ((X) * (X)) using namespace std; class Triangle { public: double x[3], y[3]; int no; }; class Point { public: double x, y; Point Point::operator - (Poin...
a.cc:22:19: error: extra qualification 'Point::' on member 'operator-' [-fpermissive] 22 | Point Point::operator - (Point &a){ | ^~~~~ a.cc: In function 'int scc()': a.cc:70:5: error: 'memset' was not declared in this scope 70 | memset(used, 0, sizeof(used)); | ^~...
s815038956
p00237
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <cassert> #include <memory> #include <string> #include <cstring> #include <vector> #include <algorithm> #include <functional> #include <sstream> #inclu...
a.cc: In function 'int main()': a.cc:197:2: error: expected '}' at end of input 197 | } | ^ a.cc:90:11: note: to match this '{' 90 | int main(){ | ^
s767316890
p00238
Java
import java.util.Scanner; public class main { Scanner sc = new Scanner(System.in); int m,k,s,t; int kei; public void kei(){ m = sc.nextInt(); while(m!=0){ k = sc.nextInt(); for(int i=0;i<=k-1;i++){ s = sc.nextInt(); t = sc.nextInt(); k...
Main.java:29: error: reached end of file while parsing t.kei(); ^ 1 error
s511015376
p00238
Java
import java.util.*; public class v02_0238_sano{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); while(true){ int t=scan.nextInt(); if(t==0){ break; } int n=scan.nextInt(); for(int i=0;i<n;i++){ int from=scan.nextInt(); int to=scan.nextInt(); t-=to-...
Main.java:3: error: class v02_0238_sano is public, should be declared in a file named v02_0238_sano.java public class v02_0238_sano{ ^ 1 error
s001897780
p00238
Java
import java.io.*; public class TimeToStudy{ public static void main(String[] args){ try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String tmp = br.readLine(); while(tmp != null && Integer.parseInt(tmp) != 0){ int norma = Integer.parseInt(tmp); int times = Integer.parse...
Main.java:3: error: class TimeToStudy is public, should be declared in a file named TimeToStudy.java public class TimeToStudy{ ^ 1 error
s422695669
p00238
C
#include <stdio.h> int main(void){ while(1){ int t, n, s, f, sum=0, i; scanf("%d", &t); if(t==0) break; scanf(" %d", &n); for(i=0; i<n; i++){ scanf(" %d %d", &s, &f); sum += f-s; } if(sum >= t) printf("OK\n"); else printf("%d\n", t-sum);1 } return 0; }
main.c: In function 'main': main.c:17:48: error: expected ';' before '}' token 17 | else printf("%d\n", t-sum);1 | ^ | ; 18 | 19 | } | ~ ...
s468454629
p00238
C
#include<stdio> int main(void){ int t,n,s,f,i; while(scanf("%d",&t)&&t!=0){ for(i=0;i<t;i++){ scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d%d",&s,&f); t=t-s+f; } if(t>0) printf("%d\n",t); else printf("OK\n"); } } return 0; }
main.c:1:9: fatal error: stdio: No such file or directory 1 | #include<stdio> | ^~~~~~~ compilation terminated.
s802089197
p00238
C
#include<stdio> int main(void){ int t,n,s,f,i,j; while(scanf("%d",&t)&&t!=0){ for(i=0;i<t;i++){ scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d%d",&s,&f); t=t-s+f; } if(t>0) printf("%d\n",t); else printf("OK\n"); } } return 0; }
main.c:1:9: fatal error: stdio: No such file or directory 1 | #include<stdio> | ^~~~~~~ compilation terminated.
s418650199
p00238
C
#include<stdio> int main(void){ int t,n,s,f,i,j; while(scanf("%d",&t)&&t!=0){ for(i=0;i<t;i++){ scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d%d",&s,&f); t=t-s+f; } if(t>0){ printf("%d\n",t);} else{ printf("OK\n");} } } return 0; }
main.c:1:9: fatal error: stdio: No such file or directory 1 | #include<stdio> | ^~~~~~~ compilation terminated.
s673841477
p00238
C
#include<stdio> int main(void){ int t,n,s,f,i,j; while(scanf("%d",&t)&&t!=0){ for(i=0;i<t;i++){ scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d%d",&s,&f); t=t-s+f; } if(t>0){ printf("%d\n",t);} else{ printf("OK\n");} } } return 0; }
main.c:1:9: fatal error: stdio: No such file or directory 1 | #include<stdio> | ^~~~~~~ compilation terminated.
s608245145
p00238
C
#include<stdio.h> int main(void) { int t, n=0, s, f, z=0,i; scanf("%d", &t); while (1) { if (n == 0)break; scanf("%d", &n); for (i = 0;i < n;i++) { scanf_s("%d %d", &s, &f); z += f - s; } if (z >= t) { printf("OK\n"); } else { printf("%d\n",t - z); } }return 0; }
main.c: In function 'main': main.c:9:25: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 9 | scanf_s("%d %d", &s, &f); | ^~~~~~~ | scanf
s847747344
p00238
C
#include<stdio.h> int main(void) { int t, n=0, s, f, z=0,i; scanf_s("%d", &t); while (1) { if (n == 0)break; scanf("%d", &n); for (i = 0;i < n;i++) { scanf("%d %d", &s, &f); z += f - s; } if (z >= t) { printf("OK\n"); } else { printf("%d\n",t - z); } } return 0; }
main.c: In function 'main': main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 4 | scanf_s("%d", &t); | ^~~~~~~ | scanf
s052211279
p00238
C
#include<stdio.h> int main(void) { int a, b, d, e, f = 0, i; while (scanf("%d", &a)) { if (a == 0)break; scanf("%d", &b); for (i = 0;i < b;i++) { scanf_s("%d %d", &d, &e); f = f + (e - d); } if(f > a) { printf("OK\n"); } else { f = a - f; printf("%d\n", f); } f = 0; } return...
main.c: In function 'main': main.c:12:25: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 12 | scanf_s("%d %d", &d, &e); | ^~~~~~~ | scanf
s834471489
p00238
C
#include<stdio.h> int main(void) { int t, n, s, f,a,b,c=0,d; scanf("%d", &t); scanf("%d", &n); for (a = 1;a <= n;a++) { scanf("%d %d", &s, &f); b = f - s; c = c + b; } d = t - c; if (d > 0) { printf("%d??????????¶?\n",d); } else { printf("OK!!\n"); } return 0;
main.c: In function 'main': main.c:22:1: error: expected declaration or statement at end of input 22 | return 0; | ^~~~~~
s791799354
p00238
C
#include<stdio.h> int main(void) { int t, n, s, f, a, b, c = 0, d; while (1) { scanf("%d", &t); if (t != 0) { break; } scanf("%d", &n); for (a = 1;a <= n;a++) { scanf("%d %d", &s, &f); b = f - s; c = c + b; } d = t - c; if (d > 0) { printf("%d\n", d); }
main.c: In function 'main': main.c:23:17: error: expected declaration or statement at end of input 23 | } | ^ main.c:23:17: error: expected declaration or statement at end of input
s813551290
p00238
C
#include <stdio.h> int main(void) { int benkyou; int kaisuu; int benkyou_s; int benkyou_e; int sum; int i; while (1){ scanf("%d", &benkyou); if (benkyou == 0){ break; } scanf("%d", &kaisuu); sum = 0; for (i = 0; i < kaisuu; i++){ scanf("%d%d", &benkyou_s, &benkyou_e); sum += b...
main.c: In function 'main': main.c:33:32: warning: missing terminating " character 33 | printf("%d | ^ main.c:33:32: error: missing terminating " character 33 | printf("%d | ^~~ main.c:34:1: e...
s133360025
p00238
C
#include <stdio.h> int main(void) { int target; int num,i; int start,end; while(1) { scanf("%d",&target); if(target==0)break; scanf("%d",&num); for(i=0;i<num;i++) { scanf("%d%d",&start,&end); target-=end-start; } if(target<=0)puts("OK"); else printf("%d\n",target); } return 0;
main.c: In function 'main': main.c:17:9: error: expected declaration or statement at end of input 17 | return 0; | ^~~~~~
s727174754
p00238
C
t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
main.c:1:1: warning: data definition has no type or storage class 1 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in dec...
s746615964
p00238
C
#include<stdio.h> t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);}
main.c:2:1: warning: data definition has no type or storage class 2 | t,n,s;main(f){for(;scanf("%d%d",&t,&n)/2;printf(t>0?"%d\n":"OK\n",t))for(;n--;t-=f-s)scanf("%d%d",&s,&f);} | ^ main.c:2:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] main.c:2:3: error: type defaults to 'int' in dec...
s425397250
p00238
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cassert> #include <vector> #include <string> #include <map> using namespace std; const int MAX= 10000100; int main(void){ int t,n; while(cin>>t,t){ int ans = 0; cin>>n; for(int i = 0 ; i < n ; i ++){ int s,e; cin>>s>>e...
a.cc: In function 'int main()': a.cc:22:17: error: operands to '?:' have different types 'const char*' and 'int' 22 | cout<<(ans>t?"OK":t-ans)<<endl; | ~~~~~^~~~~~~~~~~
s134640504
p00238
C++
#include<stdio.h> int main(){ int G,N; while(1){ scanf("%d",&G);if(G==0)break; scanf("%d",&N); int s,f; for(int i=0;i<N;i++) { scanf("%d %d",&s,&f) f-=s; G-=f; if(G<=0)break; } if(G<=0)printf("OK\n"); else printf("%d\n",G); } return 0; }
a.cc: In function 'int main()': a.cc:13:21: error: expected ';' before 'f' 13 | scanf("%d %d",&s,&f) | ^ | ; 14 | f-=s; | ~
s673583615
p00238
C++
#include<iostream> using namespace std; int main(){ int t,i,k,n,s[n],f[n]; while(cin>>t){ cin>>s>>f>>n; for(i=0;i<n;i++){ k=k+f[i]-s[i]; } if(k>=t){cout<<"OK"<<endl; } else{cout<<t-k<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [n]') 7 | cin>>s>>f>>n; | ~~~^~~ | | | | | int [n] | std::istream {aka std::basic_istream<char...
s700589230
p00238
C++
#include <stdio.h> int main(void){ int t,n,s,f; for (scanf("%d", &t), t){ scanf("%d", &n); for (; n>=0; n--){ scanf("%d %d", &s, &f); t -= (f-s); } if (t<0) puts("OK"); else printf("%d\n", t); } return 0; }
a.cc: In function 'int main()': a.cc:6:32: error: expected ';' before ')' token 6 | for (scanf("%d", &t), t){ | ^ | ; a.cc:15:9: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:...
s497275748
p00238
C++
#include <bits/stdc++.h> #define FOR(v, a, b) for(int v = (a); v < (b); ++v) #define REP(v, n) FOR(v, 0, n); using namespace std; int main(){ int t, n, s, f, sum; while(cin >> t, t){ cin >> n; sum = 0; REP(i, n){ cin >> s >> f; sum += (f - s); } if(sum >= t) cout << "OK" << endl; else cout << t -...
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s722703214
p00238
C++
?°??\???§??????
a.cc:1:2: error: extended character ° is not valid in an identifier 1 | ?°??\???§?????? | ^ a.cc:1:5: error: stray '\' in program 1 | ?°??\???§?????? | ^ a.cc:1:9: error: extended character § is not valid in an identifier 1 | ?°??\???§?????? | ^ a.cc:1:1: error: expected unqua...
s045406633
p00238
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; class Program { static void Main(string[] args) { while(true){ int t,n; t=int.Parse(Console.ReadLine()); n=int.Parse(Console.ReadLine()); int sum=0; for(in...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s097133149
p00238
C++
using System; class Program { static void Main(string[] args) { while(true){ int t=int.Parse(Console.ReadLine()); int n=int.Parse(Console.ReadLine()); int sum=0; for(int i=0;i<n;++i){ string[] input = Console.ReadLine().Sp...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:5:22: error: 'string' has not been declared 5 | static void Main(string[] args) | ^~~~~~ a.cc:5:31: error: expected ',' or '...' before 'args' 5 | static void Main(s...
s428192579
p00238
C++
using System; namespace a{ class Program { static void Main(string[] args) { while(true){ int t=int.Parse(Console.ReadLine()); int n=int.Parse(Console.ReadLine()); int sum=0; for(int i=0;i<n;++i){ string[] input = Cons...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:6:22: error: 'string' has not been declared 6 | static void Main(string[] args) | ^~~~~~ a.cc:6:31: error: expected ',' or '...' before 'args' 6 | static void Main(s...
s109061891
p00238
C++
#include<stdio.h> int main(void) { int n,t,i,k,h,x,w; w=0; while(1){ scanf("%d",&n); if(n==0) break; scanf("%d",&t); for(i=0;i<t;i++){ scanf("%d %d",&k,&h); w+=h-k; } if(n=<w){ printf("OK\n"); } else{ x=n-w; printf("%d\n",x); } w=0; } return 0; }
a.cc: In function 'int main()': a.cc:14:14: error: expected primary-expression before '<' token 14 | if(n=<w){ | ^
s909508378
p00238
C++
#include <iostream> using namespace std; int main(){ int t,n,s,f; cin>>t>>n>>s>>f; for(int i=0;i<n;i++){ if(f[i]-s[i]>=t) cout<<"OK"<<endl; else{ A=f[i]-s[i]; cout<<t-A<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:7:21: error: invalid types 'int[int]' for array subscript 7 | if(f[i]-s[i]>=t) | ^ a.cc:7:26: error: invalid types 'int[int]' for array subscript 7 | if(f[i]-s[i]>=t) | ^ a.cc:9:25: erro...
s043029960
p00238
C++
#include <iostream> using namespace std; int main(){ int t,n,s,f; cin>>t; if(t==0) break; cin>>n; for(int i=0;i<n;i++){ cin>>s>>f; t-=f-s; } if(t>0) cout<<m<<endl; else cout<<"OK"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: break statement not within loop or switch 7 | break; | ^~~~~ a.cc:14:15: error: 'm' was not declared in this scope 14 | cout<<m<<endl; | ^
s028888589
p00238
C++
#include <iostream> using namespace std; int main(){ int t,n,s,f; while(true){ cin>>t; if(t==0) break; cin>>n; for(int i=0;i<n;i++){ cin>>s>>f; t-=f-s; } if(t>0) cout<<m<<endl; else cout<<"OK"<<endl; return 0; } }
a.cc: In function 'int main()': a.cc:15:15: error: 'm' was not declared in this scope 15 | cout<<m<<endl; | ^
s105209729
p00238
C++
#include<stdio.h> int main(void) { int t,n,i,s,f; scanf("%d %d",&t,&n); for(i=0;i<n;i++){ scanf("%d %d",&s,&f); t=t-(f-s); } if(t<=0){ printf("OK\n"); } else printf("%d\n",t); } }
a.cc:15:1: error: expected declaration before '}' token 15 | } | ^
s158626138
p00238
C++
#include<stdio.h> int main(void) { int t,n,i,s,f; scanf("%d %d",&t,&n); while (1){ if (n=0) break; for(i=0;i<n;i++){ scanf("%d %d",&s,&f); t=t-(f-s); } if(t<=0){ printf("OK\n"); } else printf("%d\n",t); } return 0; } }
a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s083779011
p00238
C++
#include<iostream> using namespace std; int main(){ while(true){ int t;cin>>t; if(t == 0)return 0; int n; cin >> n; int result= 0; for(int i = 0; i < n; i++){ int time[2] = {}; cin >>time[0] >> time[1]; result += time[1]-time[0]; } (result > t)?(cout << "OK"<<endl):(cout...
a.cc: In function 'int main()': a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s537950709
p00238
C++
f
a.cc:1:1: error: 'f' does not name a type 1 | f | ^
s281043713
p00238
C++
#include <iostream> using namespace std; int main (void) { while(true) { int n, m, p; p = 0; cin >> n; if(n == 0) { break; } cin >> m; while(m > 0) { int s, q; cin >> s >>q; p += q-s; m--; } if(p >= n) { cout << "OK"<< endl; } else { cout << n - p; } } return 0;...
a.cc:34:25: error: 'cin' does not name a type 34 | cin >> s >>q; | ^~~ a.cc:35:25: error: 'p' does not name a type 35 | p += q-s; | ^ a.cc:36:25: error: 'm' does not name a type; did you mean 'tm'? 36 | ...
s026607198
p00238
C++
#include<iostream> using namespace std; int main(){ int t,n,s,f,cnt; while(true){ cin>> t; if(t==0)break; cn >> n; for(int i=0;i<n;i++){ cin >> s >> f; cnt+= f-s; } if(cnt >= t)cout<< "OK" << endl; else cout << t-fe << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'cn' was not declared in this scope; did you mean 'cnt'? 10 | cn >> n; | ^~ | cnt a.cc:16:20: error: 'fe' was not declared in this scope; did you mean 'f'? 16 | else cout << t-fe << endl; | ^~ | ...
s396531241
p00238
C++
include<iostream> using namespace std; int main(){ int t,n,s,f,cnt; while(true){ cin>> t; cnt = 0; if(t==0)break; cin >> n; for(int i=0;i<n;i++){ cin >> s >> f; cnt+= f-s; } if(cnt >= t)cout<< "OK" << endl; else cout << t-cnt << endl; } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin>> t; | ^~~ a.cc:15:17: error: 'cout' was not declared in this scope 15 | if(cnt >= t)cout<< "OK" << endl; ...
s419788599
p00238
C++
include <iostream> using namespace std; int d, n, s, t, sum; int main() { while(cin>>d>>n, d) { for(int i=0; i<n; i++) { cin >> s >> t; sum += t-s; } if(sum<d) cout << sum-d << endl; else cout << "OK" << endl; } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | while(cin>>d>>n, d) { | ^~~ a.cc:11:15: error: 'cout' was not declared in this scope 11 | if(sum<d) cout << sum-...
s460945139
p00238
C++
#include <iostream> using namespace std; int main (){ int a; while(cin>>a){ if(a==0)break; int N; cin>>n; int ans=0; for(int i=0;i<N;i++){ int c,d; cin>>c>>d; ans+=d-c; ...
a.cc: In function 'int main()': a.cc:8:18: error: 'n' was not declared in this scope 8 | cin>>n; | ^
s061730735
p00238
C++
#include<iostream> using namespace std; int main(){ int sum; int a,b; int m,n; while(cin>>m,m!=0){ cin>>n; sum=0; for(int i=0;i<n;i++){ cin>>a>>b; sum+=b-a; } if(m<sum)cout<<"OK"<<endl;A else cout<<m-sum<<endl; } }
a.cc: In function 'int main()': a.cc:15:43: error: 'A' was not declared in this scope 15 | if(m<sum)cout<<"OK"<<endl;A | ^
s327838180
p00238
C++
#include<iostream> using namespace std; int main(){ int sum; int a,b; int m,n; while(cin>>m,m!=0){ cin>>n; sum=0; for(int i=0;i<n;i++){ cin>>a>>b; sum+=b-a; } if(m<sum)cout<<"OK"<<endl;A else cout<<m-sum<<endl; } }
a.cc: In function 'int main()': a.cc:15:43: error: 'A' was not declared in this scope 15 | if(m<sum)cout<<"OK"<<endl;A | ^
s747818315
p00238
C++
#include<iostream> using namespace std; int main(){ int sum; int a,b; int m,n; while(cin>>m,m!=0){ cin>>n; sum=0; for(int i=0;i<n;i++){ cin>>a>>b; sum+=b-a; } if(m<sum)cout<<"OK"<<endl;A else cout<<m-sum<<endl; } }
a.cc: In function 'int main()': a.cc:15:43: error: 'A' was not declared in this scope 15 | if(m<sum)cout<<"OK"<<endl;A | ^