submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s416722854
p01621
C++
#include <iostream> #include <cstdio> #include <string> #include <math.h> using namespace std; int main (int argc, char* argv[]){ while (true) { int s,n,t,p,m,cnt_max; string week_input,time_input; cin >> s >> n >> t >> week_input >> time_input >> p >> m; if ( s == 0 ) break; int week = 0; ...
a.cc: In function 'int main(int, char**)': a.cc:41:46: error: expected ';' before 'if' 41 | time = time % 60*24*7 | ^ | ; 42 | if ( week_input != "All" ) { | ...
s897605501
p01621
C++
#include <cstdio> #include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <complex> #include <map> #include <set> using namespace std; int S,N,T; string wkd,time; int P,M; map<string,int> m; int wkdNum; int timeInfo; bool isChange(int sweek,int stime){ bool change=false; if(wkdNum==...
a.cc:14:12: error: 'std::string time' redeclared as different kind of entity 14 | string wkd,time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bit...
s509172687
p01621
C++
#include <cstdio> #include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <complex> #include <map> #include <set> using namespace std; int S,N,T; string wkd,time; int P,M; map<string,int> m; int wkdNum; int timeInfo; bool isChange(int sweek,int stime){ bool change=false; if(wkdNum==...
a.cc:14:12: error: 'std::string time' redeclared as different kind of entity 14 | string wkd,time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bit...
s014165550
p01622
C++
#include <iostream> #include <fstream> using namespace std; int r[1001], w[1001]; int time; bool dp[1001] = { 0 }; int w_book(int wait, int n, int r_max) { int i_max = 0; dp[0] = 1; int cnt = 0; for (int i = 0; i < n; i++) { if (i != r_max || cnt > 0) { for (int j = wait; j >= w[i]; j--) { dp[j] = dp[j ...
a.cc:7:5: error: 'int time' redeclared as different kind of entity 7 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s610819325
p01622
C++
#include <iostream> #include <fstream> #include <algorithm> using namespace std; int r[1001], w[1001]; int time; bool dp[1001] = { 0 }; int w_book(int wait, int n, int r_max) { sort(r, r + n); sort(w, w + n); int i_max = 0; dp[0] = 1; int cnt = 0; for (int i = 0; i < n - 1; i++) { for (int j = wait; j >= w[i...
a.cc:8:5: error: 'int time' redeclared as different kind of entity 8 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s095114789
p01622
C++
#include <iostream> #include <utility> #include <vector> using namespace std; typedef pair<int,int> pii; #define fi first #define se second int main() { int N; while(cin >> N, N) { vector<pii> v; v.resize(N); for(int i = 0; i < N; i++) { cin >> v[i].fi >> v[i].se; } sort(v.begin(), v.end()); int sum ...
a.cc: In function 'int main()': a.cc:18:17: error: 'sort' was not declared in this scope; did you mean 'short'? 18 | sort(v.begin(), v.end()); | ^~~~ | short
s795399989
p01622
C++
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <queue> #include <cctype> #include <climits> #include <stack> using namespace std; int main(){ int n; ...
a.cc: In function 'int main()': a.cc:56:37: error: no matching function for call to 'swap(bool [1000], bool [1001])' 56 | swap(cur,next); | ~~~~^~~~~~~~~~ In file included from /usr/include/c++/14/exception:166, from /usr/include/...
s112653871
p01622
C++
#include<iostream> #include<string> #include<queue> #include<vector> using namespace std; pair<int, int>x[1000]; int n, a, b, s1, s2, dp[1100000]; int main() { while (true) { cin >> n; s1 = 0; s2 = 0; if (n == 0)break; for (int i = 0; i < n; i++) { cin >> a >> b; x[i] = make_pair(a, b); s1 += a; s2 += b; } sort(...
a.cc: In function 'int main()': a.cc:11:17: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(x, x + n); | ^~~~ | short
s921331477
p01622
C++
#include <iostream> #include <cstdlib> using namespace std; int n,mi; int r,w[1001]; int dp[1001][1001]; int rec(int i, int j){ if(dp[i][j] >= 0) return dp[i][j]; int res; if(i==n) res = 0; else if(j < w[i] || i==mi) res = rec(i+1, j); else res = max(rec(i+1, j), rec(i+1, j-w[i]) + w[i]); return dp[i][j] = res;...
a.cc:18:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 18 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:22:17: error: 'memset' was not declared in this scope 22 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is de...
s871660831
p01623
C++
#include <iostream> #include <vector> #include <queue> #include <tuple> using namespace std; typedef pair<int,int> P; typedef tuple<int,int,int> T; struct union_find{ vector<int> par, rank; union_find(int n){ par = vector<int>(n); rank = vector<int>(n); } void init(int n){ for(i...
a.cc: In function 'int main()': a.cc:59:9: error: 'sort' was not declared in this scope; did you mean 'short'? 59 | sort(H.begin(),H.end(),greater<P>()); | ^~~~ | short
s901373899
p01623
C++
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG_MODE #define DBG(n) n; #else #define DBG(n) ; #endif #define REP(i,n) for(ll (i) = (0);(i) < (n);++i) #define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i) #define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i)) #define PB push_back #define MP make_pair #define F...
a.cc: In function 'll check(ll)': a.cc:74:26: error: no matching function for call to 'max(ll&, int)' 74 | cou = max(cou,uf.size(i)); | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bi...
s811789582
p01623
C++
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <vector> #include <map> using namespace std; int p[222]; void init(int n){ for(int i = 0; i <= n; i++) p[i] = i; } int find(int x){ return p[x] = ( (p[x] == x)?x:find(p[x])); } void merge(int x,int y){ p[find(x)] = find(y); } bool ...
a.cc: In function 'int main()': a.cc:49:1: error: 'flag' was not declared in this scope 49 | flag = true; | ^~~~ a.cc:51:10: error: 'flag' was not declared in this scope 51 | if(flag && f > 0){ | ^~~~
s395159920
p01623
C++
3 3 1 2 3 1 2 1 1 3 1 2 3 10 3 2 100 10000 1000000 1 2 2 1 3 3 6 6 2 3 5 7 11 13 1 3 17 3 5 19 5 1 23 2 4 29 4 6 31 6 2 37 11 16 74 25 3 39 55 18 74 55 74 3 18 1 7 200 9 1 423 2 9 205 6 2 255 2 5 123 4 2 193 2 3 200 10 2 333 2 11 256 3 10 171 4 10 512 1 2 201 8 5 314 6 7 150 11 6 257 7 9 315 20 38 412516 185397 509168 ...
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 3 | ^
s765281792
p01624
C++
# undo が出来るゲームは全て2手だけ見ればよい ops = ["+", "*", "-", "&", "^", "|"] numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] def check(x): # +* op = 0 for c in x: if c in ops: op += 1 if op >= 2: return None else: op = 0 # +... fo...
a.cc:1:3: error: invalid preprocessing directive #undo 1 | # undo が出来るゲームは全て2手だけ見ればよい | ^~~~ a.cc:7:7: error: invalid preprocessing directive #+ 7 | # +* | ^ a.cc:16:7: error: invalid preprocessing directive #+ 16 | # +... | ^ a.cc:22:7: error: "0がないか" after # is not a...
s412160564
p01624
C++
#include <string> #include <vector> #include <iostream> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; typedef long long ll; const ll INF=1LL<<61; const char *C="()*+-&^|0123456789"; int idx; string s; bool flag; ll number(){ ll a=0; while(idx<s.length() && isdigit(s[idx])) a=10*a+(s[idx++]-'0');...
a.cc: In function 'll expr()': a.cc:31:29: error: 'strchr' was not declared in this scope 31 | if(!strchr("*+-&^|",s[idx])) flag=false; | ^~~~~~ a.cc:4:1: note: 'strchr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'...
s493773586
p01624
C++
#include <iostream> #include <cstdio> #include <vector> #include <set> #include <map> #include <queue> #include <deque> #include <stack> #include <algorithm> #include <cstring> #include <functional> #include <cmath> #include <complex> #include <cassert> #include <cctype> using namespace std; #define rep(i,n) for(int i=...
a.cc: In function 'll dfs(std::string, int)': a.cc:124:16: error: reference to 'hash' is ambiguous 124 | ll tmp=hash(s,k); | ^~~~ In file included from /usr/include/c++/14/string_view:50, from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/...
s985913239
p01624
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) #define all(c) c.begin(),c.end() typedef long long ll; ll inf=1e18; string op="*+-&^|"; inline void change(ll &x,ll y,bool A){ if(A) x=max(x,y); else x=min(x,y); } string st; ll factor(int& be); ll v4(int &be){ ll x=fac...
a.cc: In function 'int main()': a.cc:132:13: error: expected ';' before 'if' 132 | N%=2 | ^ | ; 133 | if(N==0) N=2; | ~~
s203039733
p01624
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) #define all(c) c.begin(),c.end() typedef long long ll; ll inf=1e18; string op="*+-&^|"; inline void change(ll &x,ll y,bool A){ if(A) x=max(x,y); else x=min(x,y); } string st; ll factor(int& be); ll v4(int &be){ ll x=fac...
a.cc: In function 'int main()': a.cc:135:6: error: expected '}' at end of input 135 | } | ^ a.cc:126:11: note: to match this '{' 126 | int main(){ | ^
s096881089
p01624
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:195:2: error: expected unqualified-id before '?' token 195 | }??? | ^
s204677482
p01626
C++
#include <cmath> #include <queue> #include <cstdio> #include <cassert> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; const double EPS=1e-8; const double INF=1e77; struct point{ double x,y; point():x(0),y(0){} point(double x,double y):x(x),y(y){} point &operator+=(const point &a){ x+=a.x; y+=a.y; ...
a.cc: In function 'bool cover(const polygon&, const segment&)': a.cc:112:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 112 | sort(P.begin(),P.end()); | ^~~~ | sqrt a.cc:113:17: error: 'unique' was not declared in this scope 113 | P.erase(unique(P.b...
s736804998
p01627
C++
#include <iostream> #include <cmath> #include <vector> using namespace std; int main(){ int n,t; int m=0; int k=0; string sn,st,an,at; string c=""; cin>>n>>t; vector<string> name; map<int,string> a; for(int i=0;i<n;i++){ cin>>st>>sn>>an>>at; if(c==sn){ int b=((st[0]-'0')*10+(st[1]-'0'))*60+(st[3]-'0'...
a.cc: In function 'int main()': a.cc:16:9: error: 'map' was not declared in this scope 16 | map<int,string> a; | ^~~ a.cc:4:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' 3 | #include <vector> +++ |+#include <map> 4 | using namesp...
s023919790
p01627
C++
#include <iostream> #include <cmath> #include <vector> #include <map> using namespace std; int main(){ int n,t; int m=0; int k=0; string sn,st,an,at; string c=""; cin>>n>>t; vector<string> name; map<int,string> a; for(int i=0;i<n;i++){ cin>>st>>sn>>an>>at; if(c==sn){ int b=((st[0]-'0')*10+(st[1]-'0')...
a.cc: In function 'int main()': a.cc:26:18: error: ambiguous overload for 'operator[]' (operand types are 'std::map<int, std::__cxx11::basic_string<char> >' and 'const char [3]') 26 | a["sn"]=b-k; | ^ In file included from /usr/include/c++/14/map:63, from a.cc:...
s709549947
p01627
C++
#include <iostream> #include <cmath> #include <vector> #include <map> using namespace std; int main(){ int n,t; int m=0; int k=0; string sn,st,an,at; string c=""; cin>>n>>t; vector<string> name; map<int,string> a; for(int i=0;i<n;i++){ cin>>st>>sn>>an>>at; if(c==sn){ int b=((st[0]-'0')*10+(st[1]-'0')...
a.cc: In function 'int main()': a.cc:26:18: error: no match for 'operator[]' (operand types are 'std::map<int, std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 26 | a[sn]=b-k; | ^ In file included from /usr/include/c++/14/map:63, ...
s434242640
p01627
C++
#include <iostream> #include <cmath> #include <vector> #include <map> using namespace std; int main(){ int n,t; int m=0; int k=0; string sn,st,an,at; string c=""; cin>>n>>t; vector<string> name; map<string,int> a; for(int i=0;i<n;i++){ cin>>st>>sn>>an>>at; if(c==sn){ int b=((st[0]-'0')*10+(st[1]-'0')...
a.cc: In function 'int main()': a.cc:33:28: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length' 33 | for(int i=0;i<name.length();i++){ | ^~~~~~
s770112698
p01627
C++
#include <iostream> #include <cmath> #include <vector> #include <map> using namespace std; int main(){ int n,t; int m=0; int k=0; string sn,st,an,at; string c=""; cin>>n>>t; vector<string> name; map<string,int> a; for(int i=0;i<n;i++){ cin>>st>>sn>>an>>at; if(c==sn){ int b=((st[0]-'0')*10+(st[1]-'0')...
a.cc: In function 'int main()': a.cc:33:23: error: 'neme' was not declared in this scope; did you mean 'name'? 33 | for(int i=0;i<neme.size();i++){ | ^~~~ | name
s546650422
p01627
C++
#include<iostream> #include<string> #include<vector> using namespace std; int a[10000], b[10000], cnt; char c; string S[10000]; vector<int>A; vector<string>B; int n, m; int main() { cin >> n >> m; for (int i = 0; i < n * 2; i++) { cin >> a[i] >> c >> b[i] >> S[i]; if (i >= 1 && i % 2 == 0) { if ((a[i] * 60 + b...
a.cc: In function 'int main()': a.cc:16:109: error: expected ']' before ')' token 16 | B.push_back(S[i]); A.push_back((a[i] * 60 + b[i]) - (a[i - 1] * 60 + b[i - 1)); | ^ ...
s928737400
p01627
C++
#include <iostream> #include <vector> #include <string> using namespace std; typedef pair<int, int> P; class Data { public: string station; P start; P arrival; }; class Ans { public: string station; int time; Ans(string station, int time) : station(station), time(time){} }; void solve() { int N, T; cin >> N >...
a.cc: In function 'void solve()': a.cc:30:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 30 | scanf_s("%d:%d", &data[i].start.first, &data[i].start.second); | ^~~~~~~ | scanf
s909429782
p01627
C++
#include<bits/stdc++.h> using namespace std; int main(){ vector<string>tt; int a,b; cin>>a>>b; string c,d; cin>>c>>d; for(int e=0;e<a-1;e++){ string f,g; cin>>f>>g; int i=(f[0]-48)*600+(f[1]-48)*60+(f[3]-48)*10+(f[4]-48); cin>>f; int j=(f[0]-48)*600+(f[1]-48)*60+(f[3]-48)*10+(f[4]-48); if(j-i>=d)tt.push_back(g);...
a.cc: In function 'int main()': a.cc:16:15: error: no match for 'operator>=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 16 | if(j-i>=d)tt.push_back(g); | ~~~^~~ | | | | int std::string {aka std::__cxx11::basic_st...
s098781839
p01628
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std; #define MAX_N 10 int x[MAX_N][MAX_N]; int N, A[MAX_N]; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; x[i + 1][A[i]] = 1; } int P[MAX_N]; for (int i = 1; i <= N; i++) { int cx = i; for (int j = 1; j <= N; j++) { ...
a.cc: In function 'int main()': a.cc:55:9: error: jump to label 'E' 55 | E:; | ^ a.cc:47:50: note: from here 47 | if (P[j] != D[j]) { goto E; } | ^ a.cc:49:21: note: crosses initialization of 'int maxv' 49 ...
s263382304
p01628
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std; #define MAX_N 10 int x[MAX_N][MAX_N]; int N, A[MAX_N]; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; x[i + 1][A[i]] = 1; } int P[MAX_N]; for (int i = 1; i <= N; i++) { int cx = i; for (int j = 1; j <= N; j++) { ...
a.cc: In function 'int main()': a.cc:55:9: error: jump to label 'E' 55 | E:; | ^ a.cc:47:50: note: from here 47 | if (P[j] != D[j]) { goto E; } | ^ a.cc:49:31: note: crosses initialization of 'int S' 49 | ...
s237961067
p01628
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std; #define MAX_N 10 int x[MAX_N][MAX_N]; int N, A[MAX_N]; int main() { cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; x[i + 1][A[i]] = 1; } int P[MAX_N]; for (int i = 1; i <= N; i++) { int cx = i; for (int j = 1; j <= N; j++) { ...
a.cc: In function 'int main()': a.cc:55:9: error: jump to label 'E' 55 | E:; | ^ a.cc:33:58: note: from here 33 | if (y[i][j] >= 2) { goto E; } | ^ a.cc:37:21: note: crosses initialization of '...
s094188490
p01628
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std; int x[9][9]; int N, M, A[9], P[9], cx, pows[9][9]; int power2(int a, int b) { int res = 1; for (int i = 0; i < b; i++) { res *= a; }return res; } int main() { for (int i = 0; i < 9; i++) { for (int j = 0; j < MAX_N; j++) { pows[i][j] = power2(...
a.cc: In function 'int main()': a.cc:8:59: error: 'MAX_N' was not declared in this scope 8 | for (int i = 0; i < 9; i++) { for (int j = 0; j < MAX_N; j++) { pows[i][j] = power2(i, j); } } | ^~~~~
s302130308
p01628
C++
#include <algorithm> #include <cstdlib> #include <iostream> #include <vector> using namespace std; template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; } int n, m; vector<int> amida(const vector<int>& a) { vector<int> res; res.reserve(n); for(int i = 0; i < n; ++i) { int pos = i; for(int j...
a.cc: In function 'int main()': a.cc:44:19: error: 'INT_MAX' was not declared in this scope 44 | int ans = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <vector> +++ |+#include ...
s431005228
p01628
C++
#include <iostream> #include <vector> using namespace std; int n, m; int ans; vector<int> p, fa; vector<int> getPerm(const vector<int> &a){ vector<int> res; for(int i = 0; i < n; i++){ res.push_back(i); } for(int i = 0; i < m; i++){ swap(res[a[i]], res[a[i] + 1]); } return res; } int getMinStep(c...
a.cc: In function 'void solve()': a.cc:72:3: error: 'memset' was not declared in this scope 72 | memset(used, 0, sizeof(used)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <vector> +++ |+#include <cstring> ...
s497907724
p01628
C++
#include <iostream> #include <string> using namespace std; int main() { int n, m; cin >> n >> m; int a[m+1]; for (int i=1; i<=m; ++i) { cin >> a[i]; } int max_height = 0; int h[n+1]; memset(h, 0, sizeof h); for (int i=1; i<=m; ++i) { h[a[i]] = max(h[a[i]-1], h[a...
a.cc: In function 'int main()': a.cc:18:5: error: 'memset' was not declared in this scope 18 | memset(h, 0, sizeof h); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2...
s991180403
p01629
C++
#include<iostream> #include<math.h> using namespace std; int main(){ int N,D; int p[50][50]; int choice[50][50]; int P = 0; int M,a; int room[50]; int num[50]; int money = 10000; int b = 0; cin >> N >> D; if(1 <= N && N <= 50 && 1 <= D && D <= 50){ // ((input for(int m=1;m<=N;m++) { for(int n=1;...
a.cc:67:1: error: expected declaration before '}' token 67 | } | ^
s947186037
p01629
C++
#include<iostream> #include<math.h> using namespace std; int main(){ int N,D; int p[50][50]; int choice[50][50]; int P = 0; int M,a; int room[50]; int num[50]; int money = 10000; int b = 0; cin >> N >> D; if(1 <= N && N <= 50 && 1 <= D && D <= 50){ // ((input for(int m=1;m<=N;m++) { for(int n=1;...
a.cc:68:1: error: expected declaration before '}' token 68 | } | ^
s695946906
p01629
C++
#include <iostream> #include <algorithm> #define REP(i,s,n) for(int i=s;i<n;i++) #define rep(i,n) REP(i,0,n) #define inf (1<<29) using namespace std; int N, D; int p[50][50]; int minp[50]; int dp[100][100]; int main() { cin >> N >> D; int i,j; for (i = 0; i < N; i++) { for(j = 0; j ...
a.cc: In function 'int main()': a.cc:32:5: error: 'memset' was not declared in this scope 32 | memset(count_min, 100, sizeof(count_min)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#inc...
s875653278
p01629
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int d[50][50], p[50][50], M, n, m; vector<int>dp[50][50]; int g[50][50]; int main() { cin >> n >> m; int S = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> d[i][j]; M = min(M, d[i][j]); } for (int j = 0; j < m...
a.cc: In function 'int main()': a.cc:49:29: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript 49 | cout << Y[0][i] + 1 << endl; | ^
s232111856
p01629
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int d[50][50], p[50][50], M, n, m; vector<int>dp[50][50]; int g[50][50]; int main() { cin >> n >> m; int S = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> d[i][j]; M = min(M, d[i][j]); } for (int j = 0; j < m...
a.cc: In function 'int main()': a.cc:49:29: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript 49 | cout << Y[0][i] + 1 << endl; | ^
s198198431
p01629
C++
#include <iostream> using namespace std; typedef pair<int,int> P; #define INF P(999999, 999999) int N, D; int p[100][100]; int rev[100][100]; P dp[100][100]; void solve(){ memset(rev, -1, sizeof(rev)); for(int i = 0; i <= D; i++){ for(int j = 0; j <= N; j++){ dp[i][j] = INF; } } dp[D][N] = P(...
a.cc: In function 'void solve()': a.cc:14:3: error: 'memset' was not declared in this scope 14 | memset(rev, -1, sizeof(rev)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> ...
s891891973
p01634
Java
import java.util.regex.Pattern; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String S = sc.next(); String regex = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{6})"; Pattern p = Pattern.compile(regex); ...
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner locati...
s522688893
p01634
C++
#include <iostream> #include <string> using namespace std; int main(){ string input; cin >> input; if (input.length < 6){ cout << "INVALID" << endl; return 0; } int flag = 0; for (int i = 0; i < input.length; i++){ if (input[i] >= '0'&&input[i] <= '9'){ flag = 1; break; } } if (!flag){ cout <<...
a.cc: In function 'int main()': a.cc:9:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsi...
s778795040
p01634
C++
#include <bits/stdc++.h> using namespace std; int main(){ string str; int a=0,b=0,c=0,d=0; cin>>str; if(str.size()>=6){ d=1; for(int i=0;i<str.size();++i){ if(str.at[i]>='A'||str.at(i)<='Z') a=1; if(str.at[i]>='a'||str.at(i)<='z') b=1; if(str.at[i]>='0'||str.at(i)<='9...
a.cc: In function 'int main()': a.cc:12:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 12 | if(str.at[i]>='A'||str.at(i)<='Z') | ^ a.cc:14:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 14 | if(s...
s396578542
p01634
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;i++) using namespace std; int main() { string s;cin>>s; bool s=false,ca=false,sm=false; for(char c:s){ if('0'<=c&&c<='9')s=true; if('a'<=c&&c<='z')sm=true; if('A'<=c&&c<='Z')ca=true; } if(s&&sm&&ca&&s.size()>=6)puts("INVALID"); else puts("VALID"); }
a.cc: In function 'int main()': a.cc:7:14: error: conflicting declaration 'bool s' 7 | bool s=false,ca=false,sm=false; | ^ a.cc:6:16: note: previous declaration as 'std::string s' 6 | string s;cin>>s; | ^ a.cc:13:13: error: no match for 'operator&&' (opera...
s304267078
p01634
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; bool c, d, e; int main() { char a[20]; scanf("%s", a); int b = strlen(a); for (int i = 0; i < b; i++) { if (a[i] >= '0'&&a[i] <= '9')c = true; else if (a[i] >= 'a'&&a[i] <= 'z')d = true; else if (a[i] >= 'A'&&a[i] <= 'Z')e = true; ...
a.cc: In function 'int main()': a.cc:10:17: error: 'strlen' was not declared in this scope 10 | int b = strlen(a); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> +++ |+#include <cs...
s797025402
p01634
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; bool f = true; if(s.length() < 6) f = false; if(any(begin(s), end(s), [](char c) { return isdigit(c); }) == false) f = false; if(any(begin(s), end(s), [](char c) { return isupper(c); }) == false) f = false; if(any(be...
a.cc: In function 'int main()': a.cc:8:63: error: no matching function for call to 'std::any::any(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, main()::<lambda(char)>)' 8 | if(any(begin(s), end(s), [](char c) { return isdigit(c); }) == false) f = false; | ...
s828998298
p01635
C++
#include<bits/stdc++.H> using namespace std; int main(int argc, char *argv[]){ int n, t; string s; cin >> n >> t >> s; vector<int> p; for (int i = 2; i < s.length(); i+=4) { char tmp = s[i]; p.push_back(atoi(&tmp)); } long long int ans = 1; for (int i = 0; i < p.size(); i++) { try{ i...
a.cc:1:9: fatal error: bits/stdc++.H: No such file or directory 1 | #include<bits/stdc++.H> | ^~~~~~~~~~~~~~~ compilation terminated.
s858686455
p01635
C++
import java.util.Scanner; public class Main { static String fn; static int id; static int n; static int poly() { int res = mono(); if(fn.charAt(id) == '+') { id++; res += poly(); } return res; } static int mono() { int res; int temp = 1; if(fn.charAt(id) == 'n' && fn.charAt(id+1) == '^') ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s455030069
p01636
C
#include<stdio.h> int strint(char* a){ int n,i; for(i=n=0;a[i];i++)n=n*10+a[i]-'0'; return n; } int main(){ char s[15]; int i,n,c,m; scanf("%s",s); for(i=n=c=0;s[i];i++){ if(s[i]-'0'){ m=strint(s+i); if(m>n)c+=1-(m-n)%2; }//printf("%d %d\n",n,m); n=n*10+s[i]-'0'; } printf("%d\n...
main.c: In function 'main': main.c:19:12: error: stray '#' in program 19 | return 0;#include<stdio.h> | ^ main.c:19:13: error: 'include' undeclared (first use in this function) 19 | return 0;#include<stdio.h> | ^~~~~~~ main.c:19:13: note: each undeclared identifier is report...
s374910204
p01636
C++
int main(){ int co=0; string a; cin >> a; string b=""; while(a!=""){ //cout << 1 << endl;; stringstream ssa(a); long long ai; ssa>>ai; if(a=="")ai=0; stringstream ssb(b); long long bi; ssb>>bi; if(b=="")bi=0; if((ai+bi)%2==0){ long long x=(ai+bi)/2; //cout ...
a.cc: In function 'int main()': a.cc:3:3: error: 'string' was not declared in this scope 3 | string a; | ^~~~~~ a.cc:4:3: error: 'cin' was not declared in this scope 4 | cin >> a; | ^~~ a.cc:4:10: error: 'a' was not declared in this scope 4 | cin >> a; | ^ a.cc:5:9: erro...
s808193727
p01637
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
s311473370
p01637
C++
#include <iostream> #include <math.h> using namespace std; int main() { long double M, cD, cR, rD, rR, D, R; cin >> M >> rD >> rR >> cD >> cR; D = cD * 100 / rD; D = round(D); R = cR * 100 / rR; R = round(R); (long)M = M - D - R; if(M < 0) cout << -1 << endl; else cout << M << endl; retur...
a.cc: In function 'int main()': a.cc:14:3: error: lvalue required as left operand of assignment 14 | (long)M = M - D - R; | ^~~~~~~
s878357605
p01637
C++
#include<deque> #include<stack> #include<queue> #include<sstream> #include<cstdlib> #define INF 16777216 typedef long long llong; using namespace std; llong EN2D(llong,llong); llong EN2R(llong,llong); llong D2EN(llong,llong); llong R2EN(llong,llong); int main(){ llong M,Cd,Cr,MD,MR,RA,DA; int rD,rR; cin >> M >> ...
a.cc: In function 'int main()': a.cc:17:3: error: 'cin' was not declared in this scope 17 | cin >> M >> rD >> rR >> Cd >> Cr; | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include<cstdlib> +++ |+#include <iostream> ...
s972798986
p01638
Java
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; import static java.util.Collections.*; // Pie Chart is as easy as pie. public class Main{ Scanner sc=new Scanner(System.in); double r, cx, cy; int n; double[] ps; void ...
Main.java:81: error: class, interface, enum, or record expected package acpc2013.day3.p2526; ^ Main.java:83: error: class, interface, enum, or record expected import java.util.*; ^ Main.java:84: error: class, interface, enum, or record expected import java.lang.*; ^ Main.java:85: error: class, interface, enum, or recor...
s455516981
p01638
C++
#include <bits/stdc++.h> #include <cmath> using namespace std; namespace { typedef double real; typedef long long ll; template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) { if (vs.empty()) return os << "[]"; os << vs[0]; for (int i = 1; i < vs.size(); i++) os <...
In file included from /usr/include/c++/14/cmath:47, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114, from a.cc:1: a.cc:40:16: error: expected unqualified-id before numeric constant 40 | const real M_PI = acos(-1); | ^~~~
s001834966
p01638
C++
#include<iostream> #include<vector> using namespace std; long double r, x, y, p[100], PI = 3.14159265358979l; int n; struct Point { long double px, py; }; long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; } long double area(vector<Point> v) { long double ret = 0.0L; for (int i = 0; i...
a.cc: In function 'int main()': a.cc:20:32: error: 'sin' was not declared in this scope 20 | Point p2 = { r*sin(s*PI / 180.0l),r*cos(s*PI / 180.0l) }; | ^~~ a.cc:20:53: error: 'cos' was not declared in this scope; did you mean 'crs'? 20 | Point ...
s884995442
p01638
C++
#include <iostream> using namespace std; const double pi = acos(-1); int r, x, y, n, p[109]; double sum[109], cx[109], cy[109]; int main() { cin >> r >> x >> y >> n; for (int i = 0; i < n; i++) { cin >> p[i]; sum[i + 1] = sum[i] + p[i] * 0.02 * pi; } for (int i = 0; i <= n; i++) { cx[i] = cos(sum[i]) * r; c...
a.cc:3:19: error: 'acos' was not declared in this scope 3 | const double pi = acos(-1); | ^~~~ a.cc: In function 'int main()': a.cc:12:25: error: 'cos' was not declared in this scope 12 | cx[i] = cos(sum[i]) * r; | ^~~ a.cc:13:25: error: 'sin'...
s242027935
p01639
C++
#include <iostream> #include <vector> #include <algorithm> #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) #define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x) template <typename F> auto compare_with(F const & f) { return [=](auto x, auto y) { return f(x) < f(y); }; }...
a.cc: In function 'int main()': a.cc:15:9: error: 'uint64_t' was not declared in this scope 15 | uint64_t x = x0; | ^~~~~~~~ a.cc:4:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 3 | #include <algorithm> +++ |+#include <cstdin...
s011819499
p01639
C++
#include "bits/stdc++.h" using namespace std; const int SP = 8192; int main() { long long int N, K;long long int X0; cin >> N >> K >> X0; unsigned long long int x = X0; if (N < 1e6) { vector<long long int>nums(N); for (int i = 0; i < N; ++i) { nums[i] = long long int(x); x ^= x << 13; x ^= x >> 7; ...
a.cc: In function 'int main()': a.cc:11:35: error: expected primary-expression before 'long' 11 | nums[i] = long long int(x); | ^~~~ a.cc:28:29: error: expected primary-expression before 'long' 28 | if (long long int(x) <= u) ...
s833487266
p01641
C++
#include<iostream> using namespace std; p; main() { string c,s,u="++++++++++"; int t[10]={},i,j,k,a,b,d; c=">+++++[<++++++>-]>+++++[<++++++++>-]>+++++[<"+u+">-]>++++++[<"+u+">-]>+++++++[<"+u+">-]>++++++++[<"+u+">-]>+++++++++[<"+u+">-]>"+u+"[<"+u+">-]>+++++++++++[<"+u+">-]>++++++++++++[<"+u+">-]<<<<<<<<<<"; for(cin>...
a.cc:3:1: error: 'p' does not name a type 3 | p; | ^ a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:9:35: error: 'p' was not declared in this scope 9 | a=(s[i]/10)-3,b=a-p,p=a,d=s[i]-(...
s716161675
p01646
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int n; int order[128][128]; vector<string> t; //[from, to] not [from, to) bool check(int x, int from, int to){ for(int i = from; i <= to; i++){ if(t[i].size() <= x) continue; for(int j = i + 1; j <= to; j++){ if(t[j].size...
a.cc: In function 'int main()': a.cc:52:5: error: 'memset' was not declared in this scope 52 | memset(order, -1, sizeof(order)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cst...
s805763306
p01646
C++
#include<bits/stdc++.h> using namespace std; int g[30][30]; int main(){ int n; while(cin >> n, n){ vector<string> s(n); for(int i=0;i<n;i++)cin >> s[i]; for(int i=0;i<26;i++){ for(int j=0;j<26;j++){ g[i][j] = 1e9; } g[i][i] = 0; } bool f = true; for(int i=1;i<n;i++){...
a.cc:53:5: error: redefinition of 'int g [30][30]' 53 | int g[30][30]; | ^ a.cc:4:5: note: 'int g [30][30]' previously declared here 4 | int g[30][30]; | ^ a.cc:55:5: error: redefinition of 'int main()' 55 | int main(){ | ^~~~ a.cc:6:5: note: 'int main()' previously defined here ...
s635327823
p01646
C++
#include<bits/stdc++.h> using namespace std; int g[30][30]; int main(){ int n; while(cin >> n, n){ vector<string> s(n); for(int i=0;i<n;i++)cin >> s[i]; for(int i=0;i<26;i++){ for(int j=0;j<26;j++){ g[i][j] = 1e9; } g[i][i] = 0; } bool f = true; for(int i=1;i<n;i++){...
a.cc:53:5: error: redefinition of 'int g [30][30]' 53 | int g[30][30]; | ^ a.cc:4:5: note: 'int g [30][30]' previously declared here 4 | int g[30][30]; | ^ a.cc:55:5: error: redefinition of 'int main()' 55 | int main(){ | ^~~~ a.cc:6:5: note: 'int main()' previously defined here ...
s182485398
p01646
C++
#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include <cstring> #include <queue> #include <string> using namespace std; string arr[501]; string arr2[501],arr3[501]; // a 譏ッ b 逧?燕郛?inline bool startswith(const string &a, const string &b) { if (a.size()>b.size()) return false; if...
a.cc:15:1: error: expected unqualified-id before '{' token 15 | { | ^ a.cc: In function 'bool cmp(const std::string&, const std::string&)': a.cc:21:50: error: 'startswith' was not declared in this scope 21 | bool cmp(const string &a, const string &b) { if (startswith(a,b)) return true; else return a>b;} ...
s101035366
p01646
C++
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; char a[502][12]; int main() { int n; while(scanf("%d",&n)!=EOF) { if(n==0) break; for(int i=0;i<n;i++) { scanf("%s",a[i]); //printf("%s\n",a[i]); } //蛻、譁ュ譏ッ蜷ヲ...
a.cc: In function 'int main()': a.cc:41:25: error: 'flag' was not declared in this scope; did you mean 'flag1'? 41 | flag=1; | ^~~~ | flag1 a.cc:61:25: error: 'flag' was not declared in this scope; did you mean 'flag5'? 61 | ...
s602288059
p01647
C
#include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include <cmath> #include <cstdio> #include <cctype> #include <ctime> #include <cstdlib> #include <cstring> #include <cassert> #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #inclu...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s045273388
p01647
C++
#include<bits/stdc++.h> using namespace std; char c1[4]={'S','H','D','C'}; char c2[13]={'>','=','<',';',':','9','8','7','6','5','4','3','2'}; vector<string> cards; set<string> used; void init(){ for(int i=0;i<4;i++) for(int j=0;j<13;j++){ string s, t; s+=c1[i]; t+=c2[j]; cards.push_back...
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAcc...
s930699678
p01648
C
#include<bits/stdc++.h> using namespace std; const int MAXN = 1000 + 10, MAXM = 1e5 + 100; int fa[MAXN], ans[MAXN], tot, n, m; struct lnk { int a, b, l; const operator < (const lnk p) { return l < p.l; } }l[2 * MAXM]; int findfa(int x) { return (fa[x] == x ? x : (fa[x] = findfa(fa[x]))); } int main() { whi...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s084437523
p01648
C++
#include <bits/stdc++.h> using namespace std; class UnionFind { private: vector<int> par; // 隕ェ vector<int> rank; // 譛ィ縺ョ豺ア縺? public: // n隕∫エ?〒蛻晄悄蛹? UnionFind(int n) { par.resize(n); rank.resize(n); for(int i = 0; i < n; ++i) { par[i] = i; rank[i] = 0; } } // 譛ィ縺ョ譬ケ繧呈アゅa繧? i...
a.cc:10:5: error: 'par' does not name a type 10 | par.resize(n); | ^~~ a.cc:11:5: error: 'rank' does not name a type 11 | rank.resize(n); | ^~~~ a.cc:12:5: error: expected unqualified-id before 'for' 12 | for(int i = 0; i < n; ++i) { | ^~~ a.cc:12:20: error: 'i' does n...
s696799785
p01648
C++
2 1 1 2 5 4 6 1 2 1 1 3 2 1 4 3 2 3 4 2 4 5 3 4 6 8 17 1 4 767 3 1 609 8 3 426 6 5 972 8 1 607 6 4 51 5 1 683 3 6 451 3 4 630 8 7 912 3 7 43 4 7 421 3 5 582 8 4 538 5 7 832 1 6 345 8 2 608 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 1 | ^
s675990310
p01648
C++
#include <iostream> #include <vector> #include <queue> using namespace std; int solve(int n, vector< vector< pair<int,int> > > &G){ vector<bool> connected(n,false); priority_queue< pair<int,int> > wait; vector<int> costs; wait.emplace(0,0); while(!wait.empty()){ int c = -wait.top().first, v = wait.top()....
a.cc: In function 'int solve(int, std::vector<std::vector<std::pair<int, int> > >&)': a.cc:24:3: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort(costs.begin(),costs.end()); | ^~~~ | short
s013301245
p01648
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; struct Edge { int from, to, cost; Edge(int a, int b, int c) : from(a), to(b), cost(c) {} bool operator<(const Edge &x) const { return cost < x.cost; } }; struct UnionFind { int node[1010]; UnionFind() { ...
a.cc: In function 'int main()': a.cc:40:9: error: 'vector' was not declared in this scope 40 | vector<Edge> edges; | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include <algorithm> +++ |+#include <vector...
s220719905
p01648
C++
#include <stdio.h> #include <queue> #include <iostream> #include <stdlib.h> #include <string> #include <string.h> #include <algorithm> #include <cmath> using namespace std; #define MAX 1005 int father[MAX]; /* father[x]陦ィ遉コx逧?宛闃らせ*/ int Rank[MAX]; /*Rank[x]陦ィ遉コx逧?キア蠎ヲ*/ struct Edge{ int from,to,c; }edge[10005...
a.cc: In function 'void Make_Set(int)': a.cc:39:1: error: a function-definition is not allowed here before '{' token 39 | { | ^ a.cc:58:1: error: a function-definition is not allowed here before '{' token 58 | { | ^ a.cc:63:1: error: a function-definition is not allowed here before '{' token 63 | {...
s575458893
p01649
C++
#include<bits/stdc++.h> #define double long double using namespace std; typedef complex<double> P; typedef pair<P,P> L; const double EPS=1e-8; double dot(P a, P b){ return real(conj(a)*b); } double cross(P a, P b){ return imag(conj(a)*b); } bool isIntersectSP(L s, P p){ return abs(s.first-p) + abs(s.second-p) -...
a.cc:201:14: error: redefinition of 'const long double EPS' 201 | const double EPS=1e-8; | ^~~ a.cc:8:14: note: 'const long double EPS' previously defined here 8 | const double EPS=1e-8; | ^~~ a.cc:203:8: error: redefinition of 'long double dot(P, P)' 203 | double dot(P a, ...
s934976116
p01650
Java
import java.util.Arrays; import java.util.Scanner; public class StackMaze { static Scanner sc = new Scanner(System.in); static int H, W; static char[][] f; static int[][][] hole = new int[26][50][51]; static boolean[][][][] reach; static int[][][][] dp; public static void main(String[] args) { while (true) {...
Main.java:4: error: class StackMaze is public, should be declared in a file named StackMaze.java public class StackMaze { ^ 1 error
s033502892
p01650
C
#include <iostream> #include <algorithm> #include <cstdio> #include <string.h> #include <map> #include <cmath> #include <vector> #include <set> #include <queue> using namespace std; const int maxn=55; int h,w; char maze[maxn][maxn]; int ans=0; struct Node{ int x,y; }; struct Node2{ int x,y; int cnt; cha...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s544707388
p01650
C++
// ConsoleApplication22.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include <cstdio> #include<iostream> #include<vector> #include<utility> #include<cctype> #include<algorithm> using namespace std; int H, W; char C[50][52]; vector<pair<int, int> > p[256]; bool m...
a.cc: In function 'int rec(int, int, int, int)': a.cc:22:33: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 22 | if (memed[hy][hx][ty][tx]++)return mem[hy][hx][ty][tx]; | ~~~~~~~~~~~~~~~~~~~~^
s518984254
p01650
C++
#include <bits/stdc++.h> #define N 55 #define int short using namespace std; typedef vector<vector<bool> > V; typedef pair<int,int> P; typedef pair<P,P> PP; string mp[N]; vector<PP> A; int h,w; bool compare(PP &a,PP &b){ int w1 = a.second.first - a.first.first+1; int h1 = a.second.second - a.first.second+1; int...
a.cc: In function 'short int dfs(short int, PP)': a.cc:72:14: error: no matching function for call to 'max(short int&, int)' 72 | res = max(res,a+b+c+1); | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc...
s842402903
p01650
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:115:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 115 | cout << ans[h-1][w-1] << endl; | ^~~ | abs
s712528604
p01652
C++
#include <iostream> #include <vector> #include <string> using namespace std; struct Term { enum TermType { GLYPH, SEQUENCE, } type; Term(TermType type) : type(type) {} virtual ~Term() {} virtual void print() = 0; }; struct Glyph : public Term { vector<string> pattern; ch...
a.cc: In member function 'void Sequence::reverse()': a.cc:49:11: error: '::reverse' has not been declared 49 | ::reverse(terms.begin(), terms.end()); | ^~~~~~~
s755940057
p01653
Java
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() #define fi first #define se second typedef vector<int>vint; typedef pair<int,int>pint; typedef vector<pint>vpint; template<typename A,typename B>inlin...
Main.java:1: error: illegal character: '#' #include<bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<bits/stdc++.h> ^ Main.java:5: error: illegal character: '#' #define int long long ^ Main.java:5: error: class, interface, enum, or record expected #define int long long ...
s594060322
p01653
C++
#include <bits/stdc++.h> #define INF 100000000000007LL using namespace std; typedef long long ll; typedef pair<int,int> P; typedef pair<ll,P> PP; typedef pair<ll,int> PPP; struct edge{ int t; ll c; edge(){} edge(int tt,ll cc){ t=tt; c=cc; } }; int n,m,s1,s2,t; ll a[2001],b[2001]; string w[2001]; vector<edge>...
a.cc: In function 'void solve()': a.cc:101:27: error: return-statement with a value, in function returning 'void' [-fpermissive] 101 | if(ag2>100)return 0; | ^
s597594085
p01656
C++
#include<iostream> #include<algorithm> #include<string> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) using namespace std; int main(){ int n,q; cin>>n>>q; string ans="kogakubo10goukan"; rep(i,n){ int y; string name; cin>>y>>name; if(y<=q)ans=name; } cout<<ans<<end; }
a.cc: In function 'int main()': a.cc:19:18: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 19 | cout<<ans<<end; | ~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr...
s903718762
p01656
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<vector> #include<cmath> #include<cstdio> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb push_back #define mp make_pair #define it ::iterator #define all(in) in.begin(),in.end...
a.cc: In function 'int main()': a.cc:24:14: error: expected unqualified-id before 'int' 24 | string s,int n; | ^~~ a.cc:25:10: error: 'n' was not declared in this scope 25 | cin>>n>>s; | ^
s885486564
p01656
C++
#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <utility> #include <cstdio> #include <cstring> #include <cmath> #include <ctime> #include <cstdlib> #include <map> #include <set> #include <stack> #include <queue> using namespace std; #define pb(n) push_back(n)...
a.cc: In function 'int main()': a.cc:57:10: error: invalid types 'int[int]' for array subscript 57 | m[0] = "kogakubu10gokan"; | ^
s076660629
p01656
C++
#include <stdio.h> #include <algorithm> #include <stdlib.h> #include <string.h> #include <queue> #define rep(i,n) for(int i = 0; i < n; ++i) #define rrep(i,n) for(int i = 1; i <= n; ++i) using namespace std; typedef pair<int,int> P; const int INF = 1000000000; int main(){ int n,q,a; char s[50],e[50]; rep(i,n){ sa...
a.cc: In function 'int main()': a.cc:16:17: error: 'sacnf' was not declared in this scope; did you mean 'scanf'? 16 | sacnf("%d%s",a,s); | ^~~~~ | scanf
s431774575
p01656
C++
using System; using System.Linq; namespace Aizu { public class OnlineJudge { static void Main() { var name = "kogakubu10gokan"; var input = Console.ReadLine().Split().Select(int.Parse).ToArray(); for (var i = 0; i < input[0]; ++i) { var year = Console.Re...
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.Linq; | ^~~~~~ a.cc:5:5: error: expected unqualified-id before 'public' 5 | public class OnlineJudge { ...
s873138330
p01657
C
#include<stdio.h> int N,X,M,L[11],R[11],S[11],i,C[11],dp[11]; int dfs(int d) { int i; if(d==N) { for(i=0,dp[0]=0;i<N;i++)dp[i+1]=dp[i]+C[i]; for(i=0;i<M;i++) { if(dp[R[i]]-dp[L[i]]!=S[i])return 0; } for(i=0;i<N;i++) printf("%d%s",dp[i+1],i==N-1?"\n":" "); return 1; } for(i=0;i<=X;i++) { C[d]...
main.c: In function 'main': main.c:31:36: error: expected expression before 'void' 31 | for(i=0;i<M;i++)javascript:void(0) | ^~~~
s925253698
p01657
C++
#include<iostream> #include<vector> using namespace std; #define f(a) for(a=0;a<=x;a++) struct com{ bool operator()(const vector<int>& v1,const vector<int>& v2){ int s1=0,s2=0; for(int i=0;i<v1.size();i++)s1+=v1[i]; for(int i=0;i<v2.size();i++)s2+=v2[i]; return s1>s2; } } com; in...
a.cc: In function 'int main()': a.cc:45:5: error: 'sort' was not declared in this scope; did you mean 'short'? 45 | sort(vec.begin(),vec.end(),com); | ^~~~ | short
s293049088
p01657
C++
#include<string> #include<cstring> #include<vector> #include<set> #include<list> #include<queue> #include<cmath> #include<functional> #include<algorithm> #define INF (1<<29) #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int n,x,m; int l[10],r[10],s[10]; int lion[7]={}; int ans[6]={-1},ma=-1; bool ok...
a.cc: In function 'int main()': a.cc:44:9: error: 'cin' was not declared in this scope 44 | cin>>n>>x>>m; | ^~~ a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 9 | #include<algorithm> +++ |+#include <iostream> 10 |...
s487216804
p01657
C++
#include <cstdio> #include <algorithm> using namespace std; #define MAX_N 7 #define MAX_M 11 struct P{ int l, r, s; bool operator < (const P p)const{ if(l != p.l){ return l < p.l; }else{ return r < p.r; } } }; int N, X, M; P p[MAX_M]; bool check(int lion[]){ for(int i = 0 ; i < M ;...
a.cc: In function 'void solve()': a.cc:59:3: error: 'memset' was not declared in this scope 59 | memset(lion, 0, sizeof(lion)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring>...
s454798555
p01658
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define mp(a,b) make_pair((a),(b)) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define dump(x) #endif typedef long...
In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_F...
s988687955
p01659
C++
#include <stdio.h> int n, a[200000], ret; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%d", &a[i]); if(i) if(a[i - 1] < a[i]) ret++; } printf("%d\n", ret + (N ? a[0] > a[1] ? 1 : 0 : 0) + 1); }
a.cc: In function 'int main()': a.cc:9:31: error: 'N' was not declared in this scope 9 | printf("%d\n", ret + (N ? a[0] > a[1] ? 1 : 0 : 0) + 1); | ^
s088403293
p01659
C++
#include <stdio.h> int n, a[200000], ret; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%d", &a[i]); if(i) if(a[i - 1] < a[i]) ret++; } printf("%d\n", ret + (N ? (a[0] > a[1] ? 1 : 0) : 0) + 1); }
a.cc: In function 'int main()': a.cc:9:31: error: 'N' was not declared in this scope 9 | printf("%d\n", ret + (N ? (a[0] > a[1] ? 1 : 0) : 0) + 1); | ^
s113405473
p01659
C++
#include <stdio.h> #include <algorithm> using namespace std; int n, ptr, ret, a[200000], b[200000], prev[200001]; int main() { scanf("%d", &n); ret = n; for(int i = 0; i < n; i++) scanf("%d", &a[i]), b[i] = a[i]; sort(b, b + n); for(int i = 0; i < n; i++) ptr = lower_bound(b, b + n, a[i]), a[i] = ptr + 1; for(int ...
a.cc: In function 'int main()': a.cc:9:53: error: invalid conversion from 'int*' to 'int' [-fpermissive] 9 | for(int i = 0; i < n; i++) ptr = lower_bound(b, b + n, a[i]), a[i] = ptr + 1; | ~~~~~~~~~~~^~~~~~~~~~~~~~~~ | ...
s271201174
p01659
C++
#include <stdio.h> #include <algorithm> using namespace std; int n, ptr, ret, a[200000], b[200000], prev[200001]; int main() { scanf("%d", &n); ret = n; for(int i = 0; i < n; i++) scanf("%d", &a[i]), b[i] = a[i]; sort(b, b + n); for(int i = 0; i < n; i++) ptr = lower_bound(b, b + n, a[i]) - b, a[i] = ptr + 1; for(...
a.cc: In function 'int main()': a.cc:10:37: error: reference to 'prev' is ambiguous 10 | for(int i = 1; i <= n; i++) prev[i] = -1; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, ...
s271161678
p01659
C++
//import java.io.File; import java.util.Scanner; class Main{ static int[] arr; public static void main(String[] args) { try{ //Scanner scan = new Scanner(new File("in.txt")); Scanner scan = new Scanner(System.in); int input1 = scan.nextInt(); arr = new int[input1]; for(int i = 0; i < input1; i++) { ar...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:19: error: expected unqualified-id before '[' token 5 | static int[] arr; | ^ a.cc:6:15: error: expected ':' before...
s904365438
p01660
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define loop(i,a,b) for(ll i=(a);i<ll(b);i++) #define rep(i,b) loop(i,0,b) #ifdef DEBUG #define dump(x) cerr << #x << " = " << x << endl; #endif int get(){ int dice; scanf("%d", &dice); return dice-1; } void put(int dir){ printf("%d...
a.cc: In function 'int main()': a.cc:34:9: error: 'dump' was not declared in this scope; did you mean 'dup'? 34 | dump(step); | ^~~~ | dup
s530866483
p01660
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define loop(i,a,b) for(ll i=(a);i<ll(b);i++) #define rep(i,b) loop(i,0,b) #ifdef DEBUG #define dump(x) cerr << #x << " = " << x << endl; #endif #else #define dump(...) #endif int get(){ int dice; scanf("%d", &dice); return dice-1; } vo...
a.cc:10:2: error: #else without #if 10 | #else | ^~~~ a.cc:12:2: error: #endif without #if 12 | #endif | ^~~~~