submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s548641388
p01427
C++
#include<iostream> #include<vector> #include<cmath> using namespace std; typedef pair<double,int> P; int H,W; string str; vector <P> u; char t[600][600]; char T(int y,int x){ if(y<0||x<0)return '.'; if(y>=H||x>=W)return '.'; return t[y][x]; } int main(){ double a,x,y; while(cin>>H>>W){ u.clear(); ...
a.cc: In function 'int main()': a.cc:60:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 60 | sort(u.begin(),u.end()); | ^~~~ | sqrt
s351970071
p01428
Java
import java.io.PrintStream; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Scanner; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { public static fi...
Main.java:70: error: invalid method declaration; return type required public DessertWitch(Boolean[][] boad) { ^ 1 error
s025272999
p01428
Java
import java.util.Scanner; public class DessertWitch { Scanner in = new Scanner(System.in); char[][] map = new char[10][10]; boolean flag = true; int[] dirx = {-1, 0, 1, -1, 1, -1, 0, 1}; int[] diry = {-1, -1, -1, 0, 0, 1, 1, 1}; int put(char color, int y, int x) { int ret = 0; if (map[y][x] != '.') return...
Main.java:4: error: class DessertWitch is public, should be declared in a file named DessertWitch.java public class DessertWitch { ^ 1 error
s134454979
p01428
C
#include<stdio.h> using namespace std; int di[]={-1,0,1,0,-1,1,1,-1}; int dj[]={0,1,0,-1,1,1,-1,-1}; char t[8][8],ch,turn='o'; char u[8][8]; int calc(int I,int J,char turn){ u[I][J]=turn; int i,j,k,l,sum=0,cnt; for(k=0;k<8;k++){ i=I; j=J; cnt=0; while(1){ i+=di[k]; j+=dj[k]; ...
main.c:2:1: error: unknown type name 'using' 2 | using namespace std; | ^~~~~ main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 2 | using namespace std; | ^~~
s762188583
p01428
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s088495074
p01428
C++
#define r return #define a (int dx,int dy,int x,int y,char m,int c) i,j,n,f[6];w[8]={1,1,0,-1,-1,-1,0,1};h[8]={0,1,1,1,0,-1,-1,-1}; char t[10][10],mark[2]={'o','x'}; int l a{if(t[x][y]=='.'||t[x][y]=='0')r 0;if(t[x][y]==m)r c;r l(dx,dy,x+dx,y+dy,m,c+1);} int s a{int k,d;d=0;if(t[x][y]!='.')r 0;for(k=0;k<8;k++)d+=l(w[k]...
a.cc:3:1: error: 'i' does not name a type 3 | i,j,n,f[6];w[8]={1,1,0,-1,-1,-1,0,1};h[8]={0,1,1,1,0,-1,-1,-1}; | ^ a.cc:3:12: error: 'w' does not name a type 3 | i,j,n,f[6];w[8]={1,1,0,-1,-1,-1,0,1};h[8]={0,1,1,1,0,-1,-1,-1}; | ^ a.cc:3:38: error: 'h' does not name a type 3 | i,j,n,f[6...
s518304238
p01428
C++
#define r return #define a (int dx,int dy,int x,int y,char m,int c) i,j,n,f[6];w[8]={1,1,0,-1,-1,-1,0,1};h[8]={0,1,1,1,0,-1,-1,-1};char t[10][10],mark[2]={'o','x'};l a{if(t[x][y]=='.'||t[x][y]=='0')r 0;if(t[x][y]==m)r c;r l(dx,dy,x+dx,y+dy,m,c+1);}s a{int k,d;d=0;if(t[x][y]!='.')r 0;for(k=0;k<8;k++)d+=l(w[k],h[k],x+w[k...
a.cc:3:1: error: 'i' does not name a type 3 | i,j,n,f[6];w[8]={1,1,0,-1,-1,-1,0,1};h[8]={0,1,1,1,0,-1,-1,-1};char t[10][10],mark[2]={'o','x'};l a{if(t[x][y]=='.'||t[x][y]=='0')r 0;if(t[x][y]==m)r c;r l(dx,dy,x+dx,y+dy,m,c+1);}s a{int k,d;d=0;if(t[x][y]!='.')r 0;for(k=0;k<8;k++)d+=l(w[k],h[k],x+w[k],y+h[k],m,0);r d;...
s251214008
p01428
C++
#include <iostream> #include <string> #include <vector> #include <tuple> #include <functional> using namespace std; typedef tuple<int,int,int> tiii; typedef struct{ int x; int y; }dir; vector<dir>D={ {-1,-1},{0,-1},{1,-1}, {-1,0},{1,0}, {-1,1},{0,1},{1,1}, }; const int H=8,W=8; vector<function<bool(tiii&,tiii&)>...
a.cc: In function 'int main()': a.cc:90:25: error: 'sort' was not declared in this scope; did you mean 'short'? 90 | sort(v.begin(),v.end(),sorter[turn]); | ^~~~ | short
s234396251
p01428
C++
#include <iostream> #include <string> #include <vector> #include <tuple> #include <functional> using namespace std; typedef tuple<int,int,int> tiii; typedef struct{ int x; int y; }dir; vector<dir>D={ {-1,-1},{0,-1},{1,-1}, {-1,0},{1,0}, {-1,1},{0,1},{1,1}, }; const int H=8,W=8; vector<function<bool(tiii&,tiii&)>...
a.cc: In function 'int main()': a.cc:90:25: error: 'sort' was not declared in this scope; did you mean 'short'? 90 | sort(v.begin(),v.end(),sorter[turn]); | ^~~~ | short
s000564922
p01428
C++
#include<bits/stdc++.h> using namespace std; /*繧ェ繧サ繝ュ繝輔ぅ繝シ繝ォ繝?/ string field[8]; /*隧穂セ。髢「謨ー*/ /*player=0 Mami / player=1 Majo*/ int Evaluation(int x,int y,int player){ int n=0; int temp; if(player == 0){ /*蜿ウ*/ temp=0; for(int i=x+1 ; i < 8 ; i++){ if(field[y][i] == 'x'){ temp++; }...
a.cc:526:3: error: unterminated comment 526 | /*逶、髱「蜃コ蜉?/ | ^ a.cc: In function 'int Evaluation(int, int, int)': a.cc:17:10: error: 'field' was not declared in this scope 17 | if(field[y][i] == 'x'){ | ^~~~~ a.cc:29:10: error: 'field' was not declared in this scope 29 | if(f...
s685637504
p01428
C++
#include <cmath> #include <cstdio> #include <algorithm> #pragma warning(disable : 4996) using namespace std; const int dx[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }; const int dy[8] = { -1, -1, 0, 1, 1, 1, 0, -1 }; char c[8][9]; int place(int x, int y, char t, bool m) { int ret = 0; for (int i = 0; i < 8; i++) { int px = x...
a.cc: In function 'int main()': a.cc:58:2: error: expected '}' at end of input 58 | } | ^ a.cc:36:12: note: to match this '{' 36 | int main() { | ^
s972009630
p01428
C++
#include <iostream> #include <string> using namespace std; void game(char s[8][8]); int repcheck(int r,int x,int y,int& si,int& sj,int i,int j,char c,char s[8][8]); void repcookie(char s[8][8],int ri,int rj,int x,int y,int r,char w); bool allcheck(char w,char s[8][8]); int main() { const int size=8; char table[size][...
a.cc: In function 'void game(char (*)[8])': a.cc:85:25: error: break statement not within loop or switch 85 | break; | ^~~~~ a.cc:88:25: error: break statement not within loop or switch 88 | break; | ^~~~~ ...
s371121148
p01428
C++
#include <iostream> using namespace std; int board[10][10]; int dx[] = {0,1,0,-1,1,-1,1,-1}; int dy[] = {1,0,-1,0,1,-1,-1,1}; int rev(int c,int x,int y,int d ,int depth,int flag){ if(depth == 0 && board[y][x] != -1 && flag == 0) return 0; //cout << x << " " << y << " " << board[y][x] << endl; if(depth != 0 && boar...
a.cc: In function 'int ableCnt(int, int, int, bool)': a.cc:25:13: error: 'i' was not declared in this scope 25 | rep(i,8){ | ^ a.cc:25:9: error: 'rep' was not declared in this scope; did you mean 'rev'? 25 | rep(i,8){ | ^~~ | rev a.cc: In function 'int...
s727409117
p01428
C++
#include<iostream> #include<vector> #include<string> using namespace std; vector< vector<char> >V(8,vector<char>(8)); int dx[8]={-1,1,0,0,-1,-1,1,1}; int dy[8]={0,0,-1,1,-1,1,-1,1}; bool update; int idx,idy,count; bool can[8]; bool in(int x,int y){ return x>=0 && y>=0 && x<8 && y<8; } void check(int k){ char me,y...
a.cc: In function 'void check(int)': a.cc:22:9: error: 'memset' was not declared in this scope 22 | memset(can,false,sizeof(can)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<vector> +++ |+#includ...
s484322042
p01429
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vint; #define reep(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) reep((i),0,(n)) #define ALL(v) (v).begin(),(v).end() #define INFL 0x3f3f3f3f3f3f3f3fLL #define mins(x,y) x=min(x,y) ll dp[2010][2010]; ll s[100010]; int L; ll su...
a.cc: In function 'll sum(int, int)': a.cc:17:32: error: expected ')' before ':' token 17 | return (s[b]-(a?:s[a-1]:0))/L; | ~ ^ | ) a.cc:17:38: error: expected ')' before ';' token 17 | return (s[b]-(a?:s[a-1]:0))/L; | ...
s376762360
p01429
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; constexpr int MAX = 2525; int N, M, L; ll memo[MAX][MAX]; vector<ll> K, sum; ll calc(int l, int r) { return (sum[K[r] + 1] - sum[K[l]]) / L; } ll solve(int l, int r) { ll& res = memo[l][r]; if (res...
a.cc: In function 'int main()': a.cc:52:5: error: 'memset' was not declared in this scope 52 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstri...
s268201082
p01429
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))<<endl template<class T,class U> ostream& operator<<(ostream& o, const pa...
a.cc: In function 'int main()': a.cc:39:22: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'std::vector<int>') 39 | k = vector<int>(n); | ^ In file included from /usr/include/c++/14/vector:72, from /usr/include/c++/14/functional:64,...
s818873369
p01429
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int N,M,L; vector<int>K,S; long long int ans=LLONG_MAX; cin>>N>>M>>L; K.resize(N); S.resize(M); for(int i=0;i<N;i++)cin>>K[i]; for(int i=0;i<M;i++)cin>>S[i]; sort(K.begin(),K.end()); do{ long long int sum=0...
a.cc: In function 'int main()': a.cc:9:21: error: 'LLONG_MAX' was not declared in this scope 9 | long long int ans=LLONG_MAX; | ^~~~~~~~~ a.cc:4:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include<algorithm> ++...
s887463946
p01429
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; typedef long long ll; int N,M,L; int K[2001]; int S[100001]; pair<int,int> Onpu[2001]; ll dp[2001][2001]; ll sums[100001]; ll dfs(int a,int b){ if(a==N-1||b==N-1){ if(a<b)swap(a,b); return (sums[K[a]+1]-sums[K[b]])/...
a.cc: In function 'int main()': a.cc:46:9: error: 'memset' was not declared in this scope 46 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <vector> +++ |+#include <cstrin...
s115073452
p01429
C++
#include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; int N, M, L; ll K[2048]; ll Sum[100001]; ll memo[2048][2048]; ll pls(int r, int l) { return ((SSum[r] - SSum[l]) / (ll)L); } ll saveSayaka(int l, int r) { int next = max(l, r) + 1; if (memo[l][...
a.cc: In function 'll pls(int, int)': a.cc:16:18: error: 'SSum' was not declared in this scope; did you mean 'Sum'? 16 | return ((SSum[r] - SSum[l]) / (ll)L); | ^~~~ | Sum a.cc: In function 'int main()': a.cc:48:17: error: 'SSum' was not declared in this scope; d...
s796064993
p01429
C++
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> using namespace std; #define FOR(i,k,n) for(int i=(k); i<(int)(n);...
a.cc: In function 'int main()': a.cc:58:37: error: 'LONG_LONG_MAX' was not declared in this scope 58 | REP(i, N)REP(j, N) dist[i][j] = LONG_LONG_MAX; | ^~~~~~~~~~~~~
s769134853
p01429
C++
#include<iostream> #include<vector> #include<algorithm> #include<cstdlib> using namespace std; int N,M,L,K[2001],sum[100001],dp[2001][2001]; int func(int l,int r){ if(dp[l][r]>-1)return dp[l][r]; int n=max(l,r)+1; if(n==N)return (sum[K[n]]-sum[K[l]-1])/L+(sum[K[n]]-sum[K[r]-1])/L; int lf=func(n,r)+(sum[K[...
a.cc: In function 'int main()': a.cc:36:3: error: 'memset' was not declared in this scope 36 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<cstdlib> +++ |+#include <cstring> 5 |
s480329746
p01430
C++
#include<iostream> using namespace std; #define MAX_V 500 #define INF 1e9 #define f(i,n) for(int i=0;i<n;i++) #define memu memset(used,0,sizeof(used)) int G[MAX_V][MAX_V],V,E,Q,F,T,m,a,b; bool used[MAX_V]; void add_edge(int from,int to){ G[from][to]=1; G[to][from]=1; } void erase_edge(int from,int to){ G[fr...
a.cc: In function 'int max_flow(int, int)': a.cc:6:14: error: 'memset' was not declared in this scope 6 | #define memu memset(used,0,sizeof(used)) | ^~~~~~ a.cc:36:9: note: in expansion of macro 'memu' 36 | memu; | ^~~~ a.cc:2:1: note: 'memset' is defined in header '<cstr...
s220873247
p01430
C++
#include<stdio.h> #include<string.h> using namespace std; #define MAX_V 500 #define INF 1e9 #define f(i,n) for(int i=0;i<n;i++) #define memu memset(used,0,sizeof(used)) int G[MAX_V][MAX_V],V,E,Q,F,T,m,a,b; bool used[MAX_V]; void add_edge(int from,int to){ G[from][to]=G[to][from]=1; } void erase_edge(int from,int to...
a.cc: In function 'int dfs(int, int, int)': a.cc:21:27: error: 'min' was not declared in this scope 21 | int d=dfs(i,t,min(f,G[v][i])); | ^~~ a.cc: In function 'int main()': a.cc:57:17: error: 'swap' was not declared in this scope 57 | swap(a,b); |...
s269864272
p01430
C++
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; struct Dinic { const int INF = 1 << 30; struct edge { int to, cap, rev; }; vector< vector< edge > > graph; vector< int > min_cost, iter; Dinic(int n) { graph.resize(n); } void add_edge(int from, int to, int cap) ...
a.cc: In member function 'bool Dinic::back_edge(int, int)': a.cc:83:26: error: 'struct Dinic::edge' has no member named 'alive' 83 | if(e.to == to && e.alive) { | ^~~~~ a.cc:84:11: error: 'struct Dinic::edge' has no member named 'alive' 84 | e.alive = false; | ...
s310695556
p01430
C++
#include <vector> #include <algorithm> #include <iostream> #include <cstring> #include <fstream> using namespace std; #define RED_FILE //#ifdef RED_FILE ifstream ifs("input.txt"); ofstream ofs("output.txt"); #define cin ifs #define cout ofs #endif struct edge{ int to,cap,rev; int id; }; const int MAX_V=1000; con...
a.cc:16:2: error: #endif without #if 16 | #endif | ^~~~~
s804621628
p01430
C++
#include<iostream> #include<algorithm> using namespace std; int n, m, q, a, b, come[1050], used[1050][1050], res; int dfs(int s, int g, int cp){ if(s == g)return 1; come[s] = 1; for(int i = 0;i <= n;i++){ if(come[i])continue; if(used[s][i] <= cp)continue; if(dfs(i, g)){ used[i][s]++; used[s][i]--; ...
a.cc: In function 'int dfs(int, int, int)': a.cc:14:23: error: too few arguments to function 'int dfs(int, int, int)' 14 | if(dfs(i, g)){ | ~~~^~~~~~ a.cc:8:5: note: declared here 8 | int dfs(int s, int g, int cp){ | ^~~
s355441862
p01430
C++
#include<iostream> #include<algorithm> using namespace std; int n, m, q, a, b, come[1050], used[1050][1050], res, ok[1050][1050]; int dfs(int s, int g, int cp){ if(s == g)return 1; come[s] = 1; for(int i = 0;i <= n;i++){ if(come[i])continue; if(used[s][i] <= 0)continue; if(ok[j][i] < cp)continue; if(dfs(i...
a.cc: In function 'int dfs(int, int, int)': a.cc:14:23: error: 'j' was not declared in this scope 14 | if(ok[j][i] < cp)continue; | ^ a.cc: In function 'void color()': a.cc:30:13: error: 'inti' was not declared in this scope; did you mean 'int'? 30 | for(inti = ...
s283274027
p01430
C++
#include<iostream> #include<algorithm> using namespace std; int n, m, q, a, b, come[1050], used[1050][1050], res, ok[1050][1050]; int dfs(int s, int g, int cp){ if(s == g)return 1; come[s] = 1; for(int i = 0;i <= n;i++){ if(come[i])continue; if(used[s][i] <= 0)continue; if(ok[j][i] < cp)continue; if(dfs(i...
a.cc: In function 'int dfs(int, int, int)': a.cc:14:23: error: 'j' was not declared in this scope 14 | if(ok[j][i] < cp)continue; | ^
s845849874
p01431
C++
#include <cassert> #include <iostream> #include <map> #include <vector> using namespace std; template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; } typedef vector<int> state; enum { EMPTY = -3, WHITE, ROOT }; inline bool not_black(const int x) { return x == EMPTY || x == WHITE; } inline int fin...
a.cc: In function 'int number_of_sets(const state&)': a.cc:57:16: error: 'count' was not declared in this scope 57 | return count(begin(uf), end(uf), ROOT); | ^~~~~
s544757229
p01431
C++
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include<map> #include<set> #include<string> #include<stack> #include<cstdio> #include<cmath> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> P; typedef pair<int,P> P1; #define fr first #define sc second #...
a.cc: In function 'int main()': a.cc:148:17: error: jump to label 'Next' 148 | Next:; | ^~~~ a.cc:124:68: note: from here 124 | rep(j,w-1)if((!a.black[j]) && (!a.black[j+1]))goto Next; | ...
s556877575
p01431
C++
#include <bits/stdc++.h> #define int long long #define rank Asdfiasofsad #define MAX_N N #define N 12 using namespace std; const int INF = 1LL<<55; const int mod = (1e9)+7; const double EPS = 1e-8; const double PI = 6.0 * asin(0.5); int Max(int &a,int b){return a=max(a,b);} int Min(int &a,int b){return a=min(a,b);} cl...
a.cc: In function 'long long int dfs(long long int, long long int, UF&)': a.cc:101:13: error: initializer in range-based 'for' loop 101 | for(int i=0:Bit){ | ^
s803153293
p01431
C++
#include <cstdio> #include <algorithm> #include <cstring> using namespace std; int H, W; char board[15][15]; short dp[2][180000][122]; void chmax(int &A, int B) { A = max(A, B); } int B; int merge(int A, int i) { while(A >= B) A -= B; int b = A % 3; A = A - (A % 3); if(b == 1 && i != 0) b = ...
a.cc: In function 'int main()': a.cc:84:51: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'short int' 84 | chmax(dp[nxt][nbit][n_diff], val + 1); | ~~~~~~~~~~~~~~~~~~~~^ a.cc:10:17: note: initializing argument 1 of 'void ...
s289064181
p01432
C++
#include<bits/stdc++.h> #include"../matrix.cpp" using namespace std; using namespace ProconLib; int main(){ int s,n,k; cin>>s>>n>>k; if(n==1 && s%k!=0){ cout<<-1<<endl; return 0; } int sz=n*k+1; vector<vector<double>> dp(k+1,vector<double>(sz)); dp[0][0]=1; for(int ...
a.cc:2:9: fatal error: ../matrix.cpp: No such file or directory 2 | #include"../matrix.cpp" | ^~~~~~~~~~~~~~~ compilation terminated.
s270788876
p01432
C++
#include<bits/stdc++.h> using namespace std; using namespace ProconLib; namespace ProconLib{ template<typename T> struct Detail{ static constexpr T EPS = T(1e-9); static bool isZero(T v){ return abs(v)<=EPS; } }; template<typename T> class Vector{ i...
a.cc:3:17: error: 'ProconLib' is not a namespace-name 3 | using namespace ProconLib; | ^~~~~~~~~ a.cc:145:25: error: redefinition of default argument for 'class Detail' 145 | template<typename T,typename Detail=Detail<T>> | ^~~~~~~~ a.cc:61:25: note: origina...
s083546788
p01432
C++
#include<bits/stdc++.h> namespace ProconLib{ template<typename T> struct Detail{ static constexpr T EPS = T(1e-15); static bool isZero(T v){ return abs(v)<=EPS; } }; template<typename T> class Vector{ int N; std::vector<T> dat; publi...
a.cc:143:25: error: redefinition of default argument for 'class Detail' 143 | template<typename T,typename Detail=Detail<T>> | ^~~~~~~~ a.cc:59:25: note: original definition appeared here 59 | template<typename T,typename Detail=Detail<T>> | ^~~~~...
s137195514
p01432
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++) #define REP(i,n) FOR(i,0,n) #define ALL(a) a.begin(), a.end() #define MS(m,v) memset(m,v,sizeof(m)) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; typedef pair<int,...
a.cc: In function 'int main()': a.cc:158:24: error: 'dp' was not declared in this scope; did you mean 'dup'? 158 | REP(i, 111111) dp[i] = 0; | ^~ | dup a.cc:190:9: error: 'mx' was not declared in this scope 190 | mx = n*k; | ^~ ...
s553003191
p01432
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; using ld=__float128; #define REP(i,n) for(ll i=0;i<(n);++i) #define FOR(i,n,m) for(ll i=n; i<(m);i++) #define eps 1e-5 using mat=vector<vector<ld>>; mat gauss_jordan(mat A) { int n = A.size(), m = A[0].size(); REP(i, n) { int piv...
a.cc:112:18: error: stray '#' in program 112 | t#include <bits/stdc++.h> | ^ a.cc:254:18: error: stray '#' in program 254 | e[i]=tmp;#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:112:17: error: 't' was not declared in this sco...
s321075254
p01432
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; using ld=__float128; #define REP(i,n) for(ll i=0;i<(n);++i) #define FOR(i,n,m) for(ll i=n; i<(m);i++) #define eps 1e-5 using mat=vector<vector<ld>>; mat gauss_jordan(mat A) { int n = A.size(), m = A[0].size(); REP(i, n) { ...
a.cc:281:5: error: expected declaration before '}' token 281 | } | ^ a.cc:283:5: error: expected unqualified-id before 'if' 283 | if(s<=n*k){ | ^~ a.cc:293:11: error: 'n' was not declared in this scope; did you mean 'yn'? 293 | mat c(n*k+1,vector<ld>(n*k+1,0)); | ^ ...
s222518201
p01432
C++
#include<iostream> #include<vector> using namespace std; const double eps = 1e-8; typedef vector<double> array; typedef vector<array> matrix; int S,N,K; double prob[11][101]; matrix identity_matrix(int n) { matrix A(n, array(n)); for (int i = 0; i < n; ++i) A[i][i] = 1; return A; } matrix mul(const matrix &A,...
a.cc:7:21: error: template argument 1 is invalid 7 | typedef vector<array> matrix; | ^ a.cc:7:21: error: template argument 2 is invalid a.cc: In function 'matrix identity_matrix(int)': a.cc:13:15: error: reference to 'array' is ambiguous 13 | matrix A(n, array(n)); | ...
s927598310
p01432
C++
#include<iostream> #include<vector> #include<cmath> #include<cstdio> using namespace std; const double eps = 1e-8; typedef vector<double> array; typedef vector<array> matrix; int S,N,K; double prob[11][101]; matrix identity_matrix(int n) { matrix A(n, array(n)); for (int i = 0; i < n; ++i) A[i][i] = 1; return ...
a.cc:9:21: error: template argument 1 is invalid 9 | typedef vector<array> matrix; | ^ a.cc:9:21: error: template argument 2 is invalid a.cc: In function 'matrix identity_matrix(int)': a.cc:15:15: error: reference to 'array' is ambiguous 15 | matrix A(n, array(n)); | ...
s778300665
p01432
C++
double pro[11][200]; typedef vector<vector<double> > mat; mat matmul(const mat& a,const mat& b){ int n = SZ(a); mat c(n,vector<double>(n)); rep(i,n)rep(j,n)rep(k,n) c[i][j] += a[i][k] * b[k][j]; return c; } mat powmat(mat a, int p){ int n=SZ(a); mat ret(n,vector<double>(n)); rep(i,n) ret[i][...
a.cc:3:9: error: 'vector' does not name a type 3 | typedef vector<vector<double> > mat; | ^~~~~~ a.cc:6:1: error: 'mat' does not name a type 6 | mat matmul(const mat& a,const mat& b){ | ^~~ a.cc:15:1: error: 'mat' does not name a type 15 | mat powmat(mat a, int p){ | ^~~ a.cc:27:1: ...
s067321293
p01434
C++
#include<iostream> #include<algorithm> using namespace std; #define MAX_N 500000 long long s[MAX_N][2], t[MAX_N]; long long n, m, sum; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { cin >> s[i][0] >> s[i][1]; } for (int i = 0; i < m; i++) { cin >> t[i]; } for (int i = 0; i < n; i++) { sort(s[i], ...
a.cc: In function 'int main()': a.cc:25:9: error: jump to label 'E' 25 | E:; | ^ a.cc:20:92: note: from here 20 | if (t[0] > s[i][1] || t[m - 1] < s[i][0]) { sum += s[i][1] - s[i][0]; goto E; } | ...
s330837266
p01434
C++
#include<iostream> #include<algorithm> using namespace std; #define MAX_N 500000 long long s[MAX_N][2], t[MAX_N]; long long n, m, sum, a, b; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { cin >> s[i][0] >> s[i][1]; } for (int i = 1; i <= m; i++) { cin >> t[i]; } for (int i = 0; i < n; i++) { sort...
a.cc: In function 'int main()': a.cc:27:9: error: duplicate label 'E' 27 | E:; | ^
s865093190
p01434
C++
#include <iostream> #include <vector> #include <set> using namespace std; struct event{ int x; int type; //0:cut +:テ・ツァツ凝ァツつケ -:テァツオツづァツつケ event(int type, int x){ this->type=type; this->x=x; } bool operator<(const event&b) const{ return x!=b.x?x<b.x:type<b.type; } bool oper...
a.cc: In function 'int main()': a.cc:47:5: error: 'sort' was not declared in this scope; did you mean 'short'? 47 | sort(E1.begin(),E1.end()); | ^~~~ | short
s699510571
p01435
C
#include<iostream> #include <algorithm> #include <vector> #include <cstring> using namespace std; int dp[301]; int to[1001]; vector<int> from[1001]; const int INF=1000000000; int main(){ int n,e,t; while(cin>>n>>e>>t&&(n|e|t)){ for(int i=0;i<1001;i++)from[i].clear(); for(int i=1;i<=n;i++){ cin>>dp[...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s716521856
p01435
C++
#include<bits/stdc++.h> using namespace std; using Int = long long; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} //INSERT ABOVE HERE signed main(){ Int n,m,t; cin>>n>>m>>t; t--; vector<Int> w(n); f...
a.cc: In function 'int main()': a.cc:40:35: error: expected ';' before 'if' 40 | chmax(tmp,j+dp[R[i][j]]);g | ^ | ; 41 | 42 | if(tmp<dp[g[i]]){ | ~~
s817336095
p01435
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N, E, T; cin >> N >> E >> T; vector<int> W(N); for(int i = 0; i < N; ++i) cin >> W[i]; vector<int> G(E), C(E); vector<vector<int>> S(E); for(int i = 0; i < E; ++i){ cin >> G[i] >> C[i]; for(int j = 0; j...
a.cc:45:2: error: #error "G" 45 | #error "G" | ^~~~~ a.cc: In function 'int main()': a.cc:32:26: error: 'INF' was not declared in this scope 32 | if(W[S[j][k]] >= INF){ | ^~~
s461637563
p01435
C++
#include <cstdlib> #include <iostream> #include <vector> using namespace std; template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; } template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; } constexpr int MAX_N = 300; constexpr int INF = (1 << 29); int N, E, T; bool w[MAX_N]; ve...
a.cc: In function 'int dfs(int)': a.cc:37:25: error: 'sort' was not declared in this scope; did you mean 'short'? 37 | sort(need.rbegin(), need.rend()); | ^~~~ | short a.cc: In function 'int main()': a.cc:75:9: error: 'memset' was no...
s734255975
p01435
C++
#include "bits/stdc++.h" #include<unordered_map> #include<unordered_set> #pragma warning(disable:4996) using namespace std; using ld = long double; template<class T> using Table = vector<vector<T>>; struct howto { int wit; vector<int>needs; howto(const int g) :wit(g), needs() {} }; struct aa { int wit; int need; ...
a.cc: In function 'int main()': a.cc:76:21: error: 'amax' was not declared in this scope; did you mean 'fmax'? 76 | if (amax < costs[hows[h].wit])que.push(aa{ hows[h].wit,amax }); | ^~~~ | fmax a.cc:76:39: error: 'h' was not declared in this scope ...
s917290139
p01437
C++
#include<bits/stdc++.h> using namespace std; using ll=long long; struct State{ int h,w,dir; }; int dh[]={-1,0,1,0}; int dw[]={0,1,0,-1}; map<char,int> dmp={{'N',0},{'E',1},{'S',2},{'W',3}}; string dmpi="NESW"; void out(State st){ cout<<st.h<<" "<<st.w<<" "<<dmpi[st.dir]<<endl; } int solve(int H,int W,int L)...
a.cc: In function 'int solve(int, int, int)': a.cc:34:16: error: expected primary-expression before '{' token 34 | while(ini=={-1,-1}) 1; | ^ a.cc:34:16: error: expected ')' before '{' token 34 | while(ini=={-1,-1}) 1; | ~ ^ | ) a.cc:34:22: erro...
s876135500
p01437
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> using namespace std; using lint = long long; using ldouble = long double; const lint INF = 1LL << 60; const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1}; bool solve() { int H, W; lint L; cin >> H >> W >> L; if (H == 0) ...
a.cc: In function 'bool solve()': a.cc:57:5: error: 'assert' was not declared in this scope 57 | assert(step == L); | ^~~~~~ a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 3 | #include <vector> +++ |+#include <cassert> 4 | #i...
s401644078
p01437
C++
??¶
a.cc:1:3: error: extended character ¶ is not valid in an identifier 1 | ??¶ | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??¶ | ^
s834905525
p01437
C++
#include <cstdio> #include <algorithm> #include <map> #include <string> #include <iostream> typedef long long ll; int dx[] = { 0,1,0,-1 }, dy[] = {-1, 0, 1, 0}; using namespace std; int main() { ll H, W, L; while (cin >> H >> W >> L, H) { string field[100]; for (int i = 0; i < H; i++) { ...
a.cc: In function 'int main()': a.cc:29:9: error: 'memset' was not declared in this scope 29 | memset(memo, -1, sizeof memo); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <iostream> +++ |+#include ...
s151076306
p01437
C++
#include <cstdio> #include <algorithm> #include <map> #include <string> #include <iostream> typedef long long ll; int dx[] = { 0,1,0,-1 }, dy[] = {-1, 0, 1, 0}; using namespace std; int main() { ll H, W, L; while (cin >> H >> W >> L, H) { string field[100]; for (int i = 0; i < H; i++) { ...
a.cc: In function 'int main()': a.cc:29:9: error: 'memset' was not declared in this scope 29 | memset(memo, -1, sizeof memo); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <iostream> +++ |+#include ...
s398788067
p01437
C++
}else{ seen[ny][nx][(dir+i)%4] = seen[sy][sx][dir]+1; if(1 == l) ax = nx,ay = ny,ad = (dir+i)%4; sx = nx,sy = ny,dir = (dir+i)%4; l--; break; ...
a.cc:1:21: error: expected declaration before '}' token 1 | }else{ | ^ a.cc:1:22: error: expected unqualified-id before 'else' 1 | }else{ | ^~~~ a.cc:9:17: error: expected declaration before '}' token 9 | ...
s461858999
p01437
C++
#include<iostream> #include<algorithm> #include<vector> #include<cassert> #define F first #define S second #define REP(i,s,n) for(int i=s;i<n;i++) #define rep(i,n) REP(i,0,n) using namespace std; typedef pair<int,int> P; struct Pox { long long x,y,dir; Pox(long long x=-1,long long y=-1,long long dir=-1):x(x),y(y),d...
a.cc: In function 'int main()': a.cc:134:27: error: no matching function for call to 'move(int&, int&, long long int&, long long int&, long long int&)' 134 | move(H,W,path[i+L].x,path[i+L].y,path[i+L].dir); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:52:6: ...
s470532444
p01437
C++
#include<iostream> #include<algorithm> #include<vector> #include<cassert> #define F first #define MAX 1000 #define S second #define REP(i,s,n) for(int i=s;i<n;i++) #define rep(i,n) REP(i,0,n) using namespace std; typedef pair<int,int> P; struct Pox { int x,y,dir; Pox(int x=-1,int y=-1,int dir=-1):x(x),y(y),dir(dir)...
a.cc: In function 'int main()': a.cc:82:19: error: no matching function for call to 'move(int&, int&, int&, int&, int&)' 82 | move(H,W,src.F,src.S,dir); | ~~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/...
s177521703
p01438
C++
#include<iostream> using namespace std; long long int dp[110][1<<16]; int main(int argc, char *argv[]){ int n; while(cin >> n, n){ int m, l[n], t[n]; memset(t, 0, sizeof(t)); for (int i = 0; i < n; i++) { cin >> m >> l[i]; int s, e; for (int j = 0; j < m; j++) { cin >> s >> e...
a.cc: In function 'int main(int, char**)': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(t, 0, sizeof(t)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cst...
s285247582
p01438
C++
#include<std/c++.h> using namespace std; long long int dp[110][1<<16]; int main(int argc, char *argv[]){ int n; while(cin >> n, n){ int m, l[n], t[n]; memset(t, 0, sizeof(t)); for (int i = 0; i < n; i++) { cin >> m >> l[i]; int s, e; for (int j = 0; j < m; j++) { cin >> s >> ...
a.cc:1:9: fatal error: std/c++.h: No such file or directory 1 | #include<std/c++.h> | ^~~~~~~~~~~ compilation terminated.
s700306449
p01438
C++
#include<iostream> #include<algorithm> using namespace std; #define MAX_N 120 #define MAX_M 16 int dp[1 << (MAX_M + 1)]; int dp2[1 << (MAX_M + 1)]; int P[MAX_N][MAX_N][2]; int N, M[MAX_M], Q[MAX_N]; int power(int le, int ri) { int cnt2 = 0; for (int i = le; i < ri; i++) { cnt2 += (1 << i); } return cnt2; } int...
a.cc: In function 'int bit_dp()': a.cc:36:25: error: jump to label 'E' 36 | E:; | ^ a.cc:31:54: note: from here 31 | goto E; | ^ a.cc:34:37: note: cr...
s359878734
p01438
C++
#include<iostream> #include<algorithm> using namespace std; #define MAX_Q 100000 #define MAX_N 120 #define MAX_M 18 #define MAX_T 17 long long dp[1 << MAX_M]; long long dp2[1 << MAX_M]; long long P[MAX_N][MAX_N][2]; long long N, M[MAX_M], D[MAX_N]; long long power(int b) { int res = 1; for (int i = 0; i < b; i++)...
a.cc: In function 'long long int bit_dp()': a.cc:59:25: error: jump to label 'E' 59 | E:; | ^ a.cc:43:54: note: from here 43 | goto E; | ^ a.cc:52:43: ...
s203354219
p01438
C++
#include<iostream> #include<algorithm> using namespace std; #define MAX_Q 100000 #define MAX_N 120 #define MAX_M 18 #define MAX_T 17 long long dp[1 << MAX_M]; long long dp2[1 << MAX_M]; long long P[MAX_N][MAX_N][2]; long long N, M[MAX_M], D[MAX_N], L, R; long long power(int b) { int res = 1; for (int i = 0; i < b...
a.cc: In function 'long long int bit_dp()': a.cc:59:25: error: jump to label 'E' 59 | E:; | ^ a.cc:43:54: note: from here 43 | goto E; | ^ a.cc:52:43: ...
s053021704
p01438
C++
#include<iostream> using namespace std; long long int dp[110][1<<16]; int main(int argc, char *argv[]){ int n; while(cin >> n, n){ int m, l[n], t[n]; memset(t, 0, sizeof(t)); for (int i = 0; i < n; i++) { cin >> m >> l[i]; int s, e; for (int j = 0; j < m; j++) { cin >> s >> e...
a.cc: In function 'int main(int, char**)': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(t, 0, sizeof(t)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cst...
s653019722
p01438
C++
#include<iostream> using namespace std; long long int dp[110][1<<16]; int main(int argc, char *argv[]){ int n; while(cin >> n, n){ int m, l[n], t[n]; memset(t, 0, sizeof(t)); for (int i = 0; i < n; i++) { cin >> m >> l[i]; int s, e; for (int j = 0; j < m; j++) { cin >> s >> e...
a.cc: In function 'int main(int, char**)': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(t, 0, sizeof(t)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cst...
s861283876
p01438
C++
#include<iostream> using namespace std; long long int dp[110][1<<16]; int main(int argc, char *argv[]){ int n; while(cin >> n, n){ int m, l[n], t[n]; memset(t, 0, sizeof(t)); for (int i = 0; i < n; i++) { cin >> m >> l[i]; int s, e; for (int j = 0; j < m; j++) { cin >> s >> e...
a.cc: In function 'int main(int, char**)': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(t, 0, sizeof(t)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cst...
s783343730
p01439
C++
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <string> #include <vector> #include <queue> #include <map> #include <set> #include <algorithm> #include <sstream> #include <iostream> #include <cassert> using namespace std; typedef long long ll; #define REP(i,n) for (int i=0; i<(int)(n)...
a.cc: In function 'int main()': a.cc:32:16: error: reference to 'prev' is ambiguous 32 | MEMSET(prev, 0); | ^~~~ a.cc:22:29: note: in definition of macro 'MEMSET' 22 | #define MEMSET(v,h) memset((v),(h),sizeof(v)) | ^ In file included from /usr/includ...
s020895070
p01439
C++
#include <algorithm> #include <cctype> #include <iostream> #include <map> #include <vector> using namespace std; pair<string, int> parse(const string &letter) { int idx = 0; while(isalpha(letter[idx])) ++idx; return {letter.substr(0, idx), stoi(letter.substr(idx))}; } void print(int idx, const vector<int> &next) {...
a.cc: In function 'int main()': a.cc:27:17: error: 'iota' was not declared in this scope 27 | iota(next.begin(), next.end(), 0); | ^~~~
s953632639
p01440
Java
import java.util.*; import java.math.*; import java.io.*; public class InfiniteSequence { private BigInteger patternBInt; private String patternStr; private int patternLen; private LinkedList<String> seqNumList = new LinkedList<String>(); private int patternOffset; public BigInteger indexOf...
Main.java:4: error: class InfiniteSequence is public, should be declared in a file named InfiniteSequence.java public class InfiniteSequence { ^ 1 error
s483300053
p01440
Java
import java.util.*; import java.math.*; import java.io.*; public class InfiniteSequence { private BigInteger patternBInt; private String patternStr; private int patternLen; private LinkedList<String> seqNumList = new LinkedList<String>(); private int patternOffset; public BigInteger indexOf...
Main.java:4: error: class InfiniteSequence is public, should be declared in a file named InfiniteSequence.java public class InfiniteSequence { ^ 1 error
s262271345
p01440
Java
import java.util.*; import java.math.*; import java.io.*; private class InfiniteSequence { private BigInteger patternBInt; private String patternStr; private int patternLen; private LinkedList<String> seqNumList = new LinkedList<String>(); private int patternOffset; public BigInteger indexO...
Main.java:4: error: modifier private not allowed here private class InfiniteSequence { ^ 1 error
s790954782
p01440
Java
import java.util.*; import java.math.*; import java.io.*; public class Main { private BigInteger patternBInt; private String patternStr; private int patternLen; private LinkedList<String> seqNumList = new LinkedList<String>(); private int patternOffset; public BigInteger indexOf(String patt...
Main.java:165: error: cannot find symbol InfiniteSequence infSeq = new InfiniteSequence(); ^ symbol: class InfiniteSequence location: class Main Main.java:165: error: cannot find symbol InfiniteSequence infSeq = new InfiniteSequence(); ...
s127977840
p01440
C++
#include<bits/stdc++.h> using namespace std; using Int = long long; signed main(){ cin.tie(0); ios::sync_with_stdio(0); string s; auto calc=[](Int x){ if(x <= 9) return x + 1; Int res=10; Int t = 10; Int k = 2; while( t * 10 <= x){ res += k * (t * 9); k++; t *= 10; } ...
a.cc: In function 'int main()': a.cc:42:27: error: no matching function for call to 'min(unsigned int, std::__cxx11::basic_string<char>::size_type)' 42 | for(Int i=1;i<(Int)min(17u,s.size());i++){ | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s341120479
p01440
C++
#include<bits/stdc++.h> using namespace std; using Int = long long; signed main(){ cin.tie(0); ios::sync_with_stdio(0); string s; auto calc=[](Int x){ if(x <= 9) return x + 1; Int res=10; Int t = 10; Int k = 2; while( t * 10 <= x){ res += k * (t * 9); k++; t *= 10; } ...
a.cc: In function 'int main()': a.cc:42:27: error: no matching function for call to 'min(unsigned int, std::__cxx11::basic_string<char>::size_type)' 42 | for(Int i=1;i<(Int)min(17u,s.size());i++){ | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s202516700
p01440
C++
#include<bits/stdc++.h> using namespace std; using Int = long long; signed main(){ cin.tie(0); ios::sync_with_stdio(0); auto calc=[](Int x){ if(x <= 9) return x + 1; Int res=10; Int t = 10; Int k = 2; while( t * 10 <= x){ res += k * (t * 9); k++; t *= 10; } return r...
a.cc: In function 'int main()': a.cc:43:27: error: no matching function for call to 'min(unsigned int, std::__cxx11::basic_string<char>::size_type)' 43 | for(Int i=1;i<(Int)min(17u,s.size());i++){ | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s367375652
p01443
C++
#include <cstdio> #include <vector> #include <string> #include <algorithm> using namespace std; int bit[100100]; int N, P; void add(int k, int x) { for (; k <= N + 1; k += k & -k){ bit[k] = (bit[k] + x) % P; } } int sum(int k) { int ret = 0; for (; k; k &= (k - 1)){ ret = (ret + bit[...
a.cc: In function 'int main()': a.cc:37:8: error: 'memset' was not declared in this scope 37 | memset(bit, 0, sizeof(bit)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <algorithm> +++ |+#include <cs...
s546746453
p01443
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <string.h> #include <queue> using namespace std; #define MP(x,y) make_pair(x,y) #define FI first #define SE second const int MAXN = 110; int len=0,ans_s; char str[MAXN],st[MAXN]; long long ans,pos; long long trans_stoi(int l,int r) { long long res=0; ...
a.cc: In function 'int main()': a.cc:93:33: error: expected primary-expression before 'else' 93 | else trans_itos(tt-1); | ^~~~
s973319963
p01445
C++
#include <vector> #include <list> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <algorithm> #include <utility> #include <functional> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstr...
a.cc:152:25: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'} 152 | const poly Zero=to_poly(string("0")); | ^~~~~~~~~~~ a.cc:118:22: note: initializ...
s825283628
p01445
C++
#include <vector> #include <list> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <algorithm> #include <utility> #include <functional> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstr...
a.cc: In function 'poly to_poly(const std::string&)': a.cc:124:31: error: binding reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to 'const std::string' {aka 'const std::__cxx11::basic_string<char>'} discards qualifiers 124 | k=num(s,i); | ...
s900014214
p01445
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++) #define REP(i,n) FOR(i,0,n) #define ALL(a) a.begin(), a.end() #define MS(m,v) memset(m,v,sizeof(m)) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; typedef pair<int,...
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46, from /usr/include/c++/14/string:43, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc...
s186236218
p01445
C++
//flow-dinic(use option -std=gnu++11 for const int INF=10000) /*caution!!! this library can use for directed graph!!!*/ #include <bits/stdc++.h> using namespace std; struct edge{ int to,cap,rev; edge(){} edge(int tt,int cc,int rr){ to=tt; cap=cc; rev=rr; } }; class dinic{ public: const int INF=1000000; ...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s556868541
p01445
C++
#include <bits/stdc++.h> #define int long long #define INF 1e9 #define MAX_V 505 using namespace std; /*?????§?????¢?????´?????????(Ford_Fulerson????????¨)???O(F|E|)*/ //????????¨????§???????(???????????????????????????) struct edge{ int to; vector<int> cap; int rev; }; vector<edge> G[MAX_V]; //??°???????????£?...
a.cc: In function 'std::vector<long long int> tocap(std::string)': a.cc:123:19: error: cannot bind non-const lvalue reference of type 'std::vector<long long int>&' to an rvalue of type 'std::vector<long long int>' 123 | Plus(res,tov(t)); | ~~~^~~ a.cc:40:42: note: initializing argument 2 ...
s132876156
p01445
C++
#include <iostream> #include <algorithm> #include <vector> #include <map> using namespace std; typedef pair<int, int> P; struct edge{ int to; vector<int> cap; int rev; }; const int MAX_V = 50; const int INF = 1 << 28; const int L = 52; vector<edge> G[MAX_V]; bool used[MAX_V]; vector<int> vec_zero(L, 0); void add_...
a.cc: In function 'void add_edge(int, int, std::vector<int>)': a.cc:21:47: warning: narrowing conversion of 'G[to].std::vector<edge>::size()' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing] 21 | G[from].push_back((edge){to, cap, G[to].size()}); | ...
s012519327
p01447
Java
import java.util.Scanner; public class AOJ2330 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); System.out.println((int)Math.ceil(Math.log(n) / Math.log(3))); } }
Main.java:4: error: class AOJ2330 is public, should be declared in a file named AOJ2330.java public class AOJ2330 { ^ 1 error
s598823536
p01447
Java
public class Main{ public static void main(String[] args){ new Main().run(); } public void run(){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int count = 0; int a = 0; while(n > 1){ if(n <= 3){ count++; break; } a = (int)(0.5 + ((double)n/3.0)); n = Math.m...
Main.java:6: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s746408409
p01447
C
#coding:utf-8 import sys import copy def main(): line = sys.stdin.readline() while line.split() != ["0","0"]: analy(line) line = sys.stdin.readline() return def analy(line): field = [int(n) for n in line.split()] num = int(sys.stdin.readline()) data = [] for i in range(num...
main.c:1:2: error: invalid preprocessing directive #coding 1 | #coding:utf-8 | ^~~~~~ main.c:3:1: error: unknown type name 'import' 3 | import sys | ^~~~~~ main.c:4:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import' 4 | import copy | ^~~~~~ main.c:4:1: error: unkno...
s381199643
p01447
C
#include<stdio.h> #include<iostream> #include<string> using namespace std; typedef long long ll; #define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl; #define REP(i,n) for(int i=0;i<(int)(n);i++) #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define FORR(i,a,b) for(int i=(int)(b)-1;i>=(int)(...
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s098418750
p01447
C
#include <cstdio> int n,t; main(){ scanf("%d",&n); while(n>1){ n = n%3?n/3+1:n/3; t++; } printf("%d\n",t); }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s461316433
p01447
C
#include <cstdio> int n,t;main(){scanf("%d",&n);for(;n>1;t++)n=n%3?n/3+1:n/3;printf("%d\n",t);}
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s399647431
p01447
C
t;main(n){scanf("%d",&n);for(;n>1;t++,n/=3)n+=n%3?1:;printf("%d\n",t);}
main.c:1:1: warning: data definition has no type or storage class 1 | t;main(n){scanf("%d",&n);for(;n>1;t++,n/=3)n+=n%3?1:;printf("%d\n",t);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | t;main(n)...
s028505443
p01447
C++
#!/usr/bin/env python #coding:utf-8 import math if __name__ == "__main__": print int(math.log(int(raw_input(), 10)-1))+1; pass;
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env python | ^ a.cc:2:2: error: invalid preprocessing directive #coding 2 | #coding:utf-8 | ^~~~~~ a.cc:4:1: error: 'import' does not name a type 4 | import math | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with...
s902906911
p01447
C++
#include <iostream> #include <cmath> #include <algorithm> using namespace std; signed main(){ int n; cin >> n; cout << min(log(n - 1), 1) << endl; }
a.cc: In function 'int main()': a.cc:7:13: error: no matching function for call to 'min(__gnu_cxx::__enable_if<true, double>::__type, int)' 7 | cout << min(log(n - 1), 1) << endl; | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits...
s356499424
p01447
C++
#include<stdio.h> #include<iostream> using namespace std; int main(){ int n; cin>>n;if(n==0)break; int c=0; while(n>3){ if(n%3==0)n=n/3; else {n=n/3+1;} c++; } if(n>1)c++; cout<<c<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:32: error: break statement not within loop or switch 8 | cin>>n;if(n==0)break; | ^~~~~
s700917700
p01447
C++
#include<iostream> using namespace stdl; int main(){ int a; cin>>a; int co=0; while(a){ a/=3; co++; } cout<<co<<endl; }
a.cc:2:17: error: 'stdl' is not a namespace-name 2 | using namespace stdl; | ^~~~ a.cc: In function 'int main()': a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>a; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostr...
s083059475
p01447
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define int ll #define FOR(i,a,b) for(int i=int(a);i<int(b);i++) #define REP(i,b) FOR(i,0,b) int read(){ int i; scanf("%lld",&i); return i; } signed main(){ int N=read(); int i=0; while(true){ i++; N/=3; if(N==0) break; } cout << i < ...
a.cc: In function 'int main()': a.cc:25:21: error: expected primary-expression before '<' token 25 | cout << i < <endl; | ^
s167818103
p01447
C++
#include <cstdio> using namespace std; #define scanf scanf_s #define printf printf_s int main(){ int N, r, c = 0; scanf("%d", &N); while (c++, N > 3) { r = N % 3; N /= 3; if (r != 0) { N++; } } printf("%d\n", c); return 0; }
a.cc: In function 'int main()': a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 4 | #define scanf scanf_s | ^~~~~~~ a.cc:9:9: note: in expansion of macro 'scanf' 9 | scanf("%d", &N); | ^~~~~ a.cc:5:16: error: 'printf_s' was not declared...
s766851080
p01447
C++
n;main(i){for(scanf("%d",&n);n/=3;i++);printf("%d",i);}
a.cc:1:1: error: 'n' does not name a type 1 | n;main(i){for(scanf("%d",&n);n/=3;i++);printf("%d",i);} | ^ a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token 1 | n;main(i){for(scanf("%d",&n);n/=3;i++);printf("%d",i);} | ^
s254090484
p01447
C++
#include <cstdio>int n,t;main(){scanf("%d",&n);for(;n>1;t++)n=n%3?n/3+1:n/3;printf("%d\n",t);}
a.cc:1:22: warning: extra tokens at end of #include directive 1 | #include <cstdio>int n,t;main(){scanf("%d",&n);for(;n>1;t++)n=n%3?n/3+1:n/3;printf("%d\n",t);} | ^ a.cc:1:10: fatal error: cstdio>in: No such file or directory 1 | #include <cstdio>int n,t;main(){scanf("%d",&n);for(;n>1...
s678463146
p01447
C++
2000000000
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2000000000 | ^~~~~~~~~~
s397489759
p01447
C++
#include <iostream> #include <iomanip> #include <sstream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <cfloat> #include <vector> #include <string> #include <stack> #include <queue> #include <set> #include <map> #include <algorithm> #include <functional> #include ...
a.cc: In function 'int main()': a.cc:63:24: error: expected ';' before 'a' 63 | cout << res + 1 a<< endl; | ^~ | ;