submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s390546869
p00736
C++
#include<iostream> #include<vector> #include<string> #include<cstring> #include<algorithm> using namespace std; #define INF (1<<29) int not[3]={2,1,0}; int and[3][3]={{0,0,0},{0,1,1},{0,1,2}}; int or[3][3]={{0,1,2},{1,1,2},{2,2,2}}; int p,q,r; char s[128],*pos; int formula(){ char c=*pos++; switch(c){ case '0':retu...
a.cc:9:5: error: expected unqualified-id before 'not' token 9 | int not[3]={2,1,0}; | ^~~ a.cc:10:9: error: expected identifier before numeric constant 10 | int and[3][3]={{0,0,0},{0,1,1},{0,1,2}}; | ^ a.cc:10:9: error: expected ']' before numeric constant 10 | int and[3][3]={{0,0,0},{...
s631336312
p00736
C++
#include <stdio.h> #include <ctype.h> #include <string.h> #define or(a,b) a > b ? a : b #define and(a,b) a > b ? b : a #define not(n) 1 - (n - 1) int p[3]; char str[81]; int formula(int i){ if(isupper(str[i])) return p[str[i] - 'P']; else if(isdigit(str[i])) return str[i] - '0'; else if(str[i] == '-') return...
a.cc:4:9: error: "or" cannot be used as a macro name as it is an operator in C++ 4 | #define or(a,b) a > b ? a : b | ^~ a.cc:5:9: error: "and" cannot be used as a macro name as it is an operator in C++ 5 | #define and(a,b) a > b ? b : a | ^~~ a.cc:6:9: error: "not" cannot be used as ...
s369911808
p00736
C++
#include <algorithm> #include <string> #include <queue> #include <cctype> #include <cstdio> #include <vector> using namespace std; #define reps(i,f,n) for(int i=f; i<int(n); ++i) #define rep(i,n) reps(i,0,n) typedef vector<int> vi; typedef vector<vi> vvi; const int INF = 1001001001; int formula(const string& str, i...
a.cc: In function 'int main()': a.cc:45:25: error: 'strlen' was not declared in this scope 45 | int n = strlen(str); | ^~~~~~ a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <cstdio> ++...
s795390052
p00737
Java
import java.util.Scanner; public class TwirlingRobot { Scanner in = new Scanner(System.in); int n, m; int[][][] dp; int[][] map; int[] cost; int[] vx = {1, 0, -1, 0}; int[] vy = {0, 1, 0, -1}; void dijkstra(int dir, int x, int y) { if (dp[dir][y][x] == -1) return; //debug(dir); int order = map[y-1][x-1...
Main.java:3: error: class TwirlingRobot is public, should be declared in a file named TwirlingRobot.java public class TwirlingRobot { ^ 1 error
s919574521
p00737
C
#include <iostream> #include <algorithm> #include <queue> using namespace std; const int INF = 100000000; class S{ public: int y, x, d, cost; S(){} S(int y, int x, int d, int cost) : y(y), x(x), d(d), cost(cost) {} }; int h, w; int map[30][30]; int cost[4]; int vis[30][30][4]; int dy[] = {-1, 0, 1, 0}; int dx...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s569308463
p00737
C
#include<iostream> #include<algorithm> #include<queue> #include<vector> #include<string> #include<map> #define INF 1000000000 #define all(c) c.begin(),c.end() #define uni(c) c.erase(unique(all(c)),c.end()) #define pb push_back using namespace std; typedef pair<int,int> P; typedef pair<int,P> PP; typedef pair<int,PP> PP...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s526684322
p00737
C
#include <iostream> #include <queue> #include <cstring> using namespace std; int w, h; int s[35][35]; int c[4]; int vx[4][4] = {{1, 0, -1, 0}, {0, 1, 0, -1}, {-1, 0, 1, 0}, {0, -1, 0, 1}}; int vy[4][4] = {{0, 1, 0, -1}, {-1, 0, 1, 0}, {0, -1, 0, 1}, {1, 0, -1, 0}}; int vv[4][4] = {{0, 3, 2, 1}, {1, 0, 3, 2}, {2, 1, 0,...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s498062720
p00737
C++
#include <algorithm> #include <cassert> #include <cstdlib> #include <iostream> #include <queue> #include <tuple> using namespace std; enum { STRAIGHT, RIGHT, BACK, LEFT, D }; constexpr int dx[] = {1, 0, -1, 0}; constexpr int dy[] = {0, 1, 0, -1}; constexpr int MAX_SIZE = 30; int w, h; int s[MAX_SIZE][MAX_SIZE]; int ...
a.cc: In function 'int dijkstra()': a.cc:29:57: error: 'INT_MAX' was not declared in this scope 29 | fill_n((int *)dist, sizeof(dist) / sizeof(int), INT_MAX); | ^~~~~~~ a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably f...
s209187135
p00737
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; const int MAX_V = 4000; const int INF = 9999999; int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; int cost[MAX_V][MAX_V]; int d[MAX_V]; bool used[MAX_V]; int V; int h, w; bool in(int i, i...
In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/includ...
s080133850
p00737
C++
#include <iostream> #include <queue> using namespace std; #define INF INT_MAX int G[30][30]; int c[4]; // const int dirx[] = {-1, 0, 1, 0}; const int diry[] = { 0,-1, 0, 1}; class State{ public: int x; int y; int dir; int cost; State(int x, int y, int dir, int cost){ this->x=x;this->y=y;thi...
a.cc: In function 'int main()': a.cc:4:13: error: 'INT_MAX' was not declared in this scope 4 | #define INF INT_MAX | ^~~~~~~ a.cc:39:38: note: in expansion of macro 'INF' 39 | fill(d[0][0], d[0][0] + 30*30*4, INF); | ^~~ a.cc:3:1: note: 'INT_MAX' i...
s225903434
p00737
C++
#include<iostream> #include<iomanip> #include<cstdlib> #include<stdio.h> #include<time.h> #include<math.h> #include<algorithm> #include<string> #include<vector> #include<list> #include<queue> #include<stack> #include<deque> #include<set> #include<map> #define REP(i, N) for(ll i = 0; i < N; ++i) #define FOR(i, a, b) for...
a.cc: In function 'int main()': a.cc:132:28: error: 'hoge' was not declared in this scope 132 | if(hoge.first && hoge.second) break; | ^~~~
s388417080
p00737
C++
#include <iostream> #include <climits> #include <queue> #include <functional> int field[30][30] = { 0 }; int m[4][30][30]; //[??????][y][x] = ????°?????????? int costs[4] = { 0 }; int dx[] = { 1, 0, -1, 0, 1, 0, -1, 0 }, dy[] = {0, 1, 0, -1, 0, 1, 0, -1 }; struct Node{ int x, y, cost = 0, d; bool operator < (const N...
a.cc: In function 'int main()': a.cc:29:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'? 29 | std::memset(m, 0x7f, sizeof(int) * 4 * 30 * 30); | ^~~~~~ | wmemset
s482761443
p00737
C++
#include <iostream> #include <queue> using namespace std; #define MAXH 31 #define MAXW MAXH #define MAXC 4 #define INF (1<<20) typedef enum {STRA=0,RIGHT=1,BACK=2,LEFT=3,STOP=4} TYPE; int W,H; int F[MAXH][MAXW]; int cost[MAXC+1]; // cost[STOP]=0; int D[MAXH][MAXW][4]; bool visited[MAXH][MAXW][4]; class State { public:...
a.cc: In function 'int solve()': a.cc:37:3: error: 'memset' was not declared in this scope 37 | memset(visited,0,sizeof(visited)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +++ |+#include <cstring> ...
s943469771
p00737
C++
#include <iostream> #include <queue> using namespace std; class Node{ public: int x, y, d, cost; Node(int x, int y, int d, int cost) : x(x), y(y), d(d), cost(cost) {} bool operator < (const Node &n) const { return cost > n.cost; } }; char dx[] = {0,1,0,-1}; char dy[] = {1,0,-1,0}; int main(){ int w, h; int op[...
a.cc: In function 'int main()': a.cc:23:17: error: 'memset' was not declared in this scope 23 | memset(c, -1, sizeof(c)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <queue> +++ |+...
s967362024
p00737
C++
#include <iostream> #include <vector> #include <queue> #include <string> #include <algorithm> using namespace std; typedef pair<int, pair<int, int> > pip; int dx[] = { 1, 0, -1, 0 }; int dy[] = { 0, 1, 0, -1 }; int w, h; int area[31][31]; int min_cost[31][31][4]; int c[4]; void bfs(){ queue<pip> qp; qp.push(mak...
a.cc: In function 'int main()': a.cc:47:17: error: 'memset' was not declared in this scope 47 | memset(min_cost, -1, sizeof(min_cost)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <a...
s792635751
p00737
C++
#include <iostream> #include <cstlib> #include <cstdio> #include <vector> #include <queue> #include <string> #include <algorithm> using namespace std; typedef pair<int, pair<int, int> > pip; int dx[] = { 1, 0, -1, 0 }; int dy[] = { 0, 1, 0, -1 }; int w, h; int area[31][31]; int min_cost[31][31][4]; int c[4]; void...
a.cc:2:10: fatal error: cstlib: No such file or directory 2 | #include <cstlib> | ^~~~~~~~ compilation terminated.
s935672137
p00737
C++
#include <iostream> #include <cstdlib> #include <memory> #include <cstdio> #include <vector> #include <queue> #include <string> #include <algorithm> using namespace std; typedef pair<int, pair<int, int> > pip; int dx[] = { 1, 0, -1, 0 }; int dy[] = { 0, 1, 0, -1 }; int w, h; int area[31][31]; int min_cost[31][31][...
a.cc: In function 'int main()': a.cc:50:17: error: 'memset' was not declared in this scope 50 | memset(min_cost, -1, sizeof(min_cost)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <a...
s388555240
p00737
C++
// ACM-ICPC‘“à—\‘I2008 D. ‚¿‚å‚ë‚¿‚å‚냍ƒ{ƒbƒg #include <iostream> #include <queue> using namespace std; class Node{ public: int x, y, d, cost; Node(int x, int y, int d, int cost) : x(x), y(y), d(d), cost(cost) {} bool operator < (const Node &n) const { return cost > n.cost; } }; char dx[] = {0, 1, 0, -1}; char...
a.cc: In function 'int main()': a.cc:24:17: error: 'memset' was not declared in this scope 24 | memset(c, -1, sizeof(c)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <queue> +++ |+...
s212397189
p00737
C++
//SPFA #include <cstdio> #include <cstring> #include<queue> using namespace std; #define INF (10*900*4) #define rep(i,n) for(i=0;i<(n);i++) int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; struct Node{ int y,x,dir; }; void _a(Node *a){a->y+=dy[a->dir];a->x+=dx[a->dir];} void _b(Node *a){a->dir=(a->dir+1)%4;_a(a);} void _c(...
a.cc: In function 'int main()': a.cc:46:25: error: 'qu' was not declared in this scope; did you mean 'que'? 46 | qu.pop(); | ^~ | que
s616214078
p00737
C++
//SPFA #include <cstdio> #include <cstring> #include<queue> using namespace std; #define INF (10*900*4) #define rep(i,n) for(i=0;i<(n);i++) int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; struct Node{ int y,x,dir; }; void _a(Node *a){a->y+=dy[a->dir];a->x+=dx[a->dir];} void _b(Node *a){a->dir=(a->dir+1)%4;_a(a);} void _c(...
a.cc: In function 'int main()': a.cc:69:32: error: 'min_element' was not declared in this scope 69 | printf("%d\n",*min_element(dst[h-1][w-1],dst[h-1][w-1]+4)); | ^~~~~~~~~~~
s041606716
p00737
C++
#include <iostream> #include <queue> #include <algorithm> using namespace std; const int dx[] = {1,0,-1,0}; const int dy[] = {0,1,0,-1}; const int SIZE = 31; const int INF = 1<<27; int G[SIZE][SIZE], C[4]; int H, W; struct dijkstra { int x, y, d, cost; State() {} State(int x, int y, int d, int cost) : x(x), y(y),...
a.cc:13:3: error: ISO C++ forbids declaration of 'State' with no type [-fpermissive] 13 | State() {} | ^~~~~ a.cc:14:3: error: ISO C++ forbids declaration of 'State' with no type [-fpermissive] 14 | State(int x, int y, int d, int cost) : x(x), y(y), d(d), cost(cost) {} | ^~~~~ a.cc:15:24: erro...
s159138579
p00737
C++
#include <iostream> #include <queue> #include <algorithm> using namespace std; const int dx[] = {1,0,-1,0}; const int dy[] = {0,1,0,-1}; const int SIZE = 31; const int INF = 1<<27; int G[SIZE][SIZE], C[4]; int H, W; struct dijkstra { int x, y, d, cost; State() {} State(int x, int y, int d, int cost) : x(x), y(y),...
a.cc:13:3: error: ISO C++ forbids declaration of 'State' with no type [-fpermissive] 13 | State() {} | ^~~~~ a.cc:14:3: error: ISO C++ forbids declaration of 'State' with no type [-fpermissive] 14 | State(int x, int y, int d, int cost) : x(x), y(y), d(d), cost(cost) {} | ^~~~~ a.cc:15:24: erro...
s749899826
p00737
C++
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; const int dx[] = {1,0,-1,0}; const int dy[] = {0,1,0,-1}; const int SIZE = 31; const int INF = 1<<27; int G[SIZE][SIZE], C[4]; int H, W; struct State { int x, y, d, cost; State() {} State(int x, int y, int d, int c...
In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/includ...
s211308788
p00737
C++
#include <iostream> #include <vector> #include <queue> using namespace std; #define MAX_COST 100 #define INF 999999999 typedef pair<int, int> P; typedef pair<P, P> PP; // h, w, cost, direction struct { int to; int cost; }; int dx[4] = {0, 1, 0, -1}; int dy[4] = {-1, 0, 1, 0}; void solve() { int w, h; while(cin >>...
a.cc:14:1: error: abstract declarator '<unnamed struct>' used as declaration 14 | }; | ^
s804378546
p00738
C++
#include<cstdio> #include<complex> #include<utility> #include<vector> #include<cmath> #include<cassert> using namespace std; double eps=1e-9; typedef complex<double> Point; typedef complex<double> Vector; template<class T> bool eq(T a,T b){ return abs(a-b)<eps; } template<class T> int sgn(T r){ return eq(r,0.0)?...
a.cc: In function 'int main()': a.cc:272:25: error: 'inputPoint' was not declared in this scope 272 | Point s=inputPoint(); | ^~~~~~~~~~
s794837896
p00738
C++
import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Inp...
a.cc:2:1: error: 'import' does not name a type 2 | import java.awt.geom.Line2D; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.awt.geom.Rectangle2D; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with ...
s427116872
p00738
C++
import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.Scanner; public class Main{ public static void main(String[] args) throws IOExcepti...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedWriter; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.FileWriter; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmo...
s586775838
p00738
C++
// cpp_range (generic range class, very small equivalent of boost::irange) // (C) @cielavenir under Boost Software License. // note: end position is exclusive. #include <iterator> template<typename T> class range{ public: struct iterator{ const T a,b; T p; const long long d; //because T might be unsigned. ite...
a.cc: In function 'val_t distanceSS(const VP&, const VP&)': a.cc:105:32: error: expected ';' before ')' token 105 | return intersectSS(s,t)) ? 0 : min( | ^ | ; a.cc:105:32: error: expected primary-expression before ')' token a.cc:106:10...
s958240807
p00738
C++
// cpp_range (generic range class, very small equivalent of boost::irange) // (C) @cielavenir under Boost Software License. // note: end position is exclusive. #include <iterator> template<typename T> class range{ public: struct iterator{ const T a,b; T p; const long long d; //because T might be unsigned. ite...
a.cc: In function 'bool intersectSS(const VP&, const VP&)': a.cc:98:17: error: request for member 'abs' in 'a', which is of non-class type 'val_t' {aka 'double'} 98 | VP pt=a.abs<EPS ? b.abs<EPS ? VP({l[0],l[1],m[0],m[1]}) : VP() : VP({m[0]+b/a*(m[1]-m[0])}); | ^~~ a.cc:98:29: error: re...
s544567053
p00738
C++
#include <iostream> #include <cmath> #include <complex> #include <tuple> #include <vector> using namespace std; using vec = complex<double>; using line = pair<vec,vec>; using polygon = vector<vec>; const double eps = 0.0000001; double inner_product(vec u,vec v){ return real(u*conj(v)); } double cross_product(vec ...
a.cc: In function 'int main()': a.cc:146:27: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 146 | double d = min({distSeg2Seg(L,l0),distSeg2Seg(L,l1),distSeg2Seg(L,l2),distSeg2Seg(L,l3)}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s914361578
p00738
C++
#include <iostream> #include <iomanip> #include <cmath> #include <vector> using namespace std; inline double sq(double x) { return x * x; } struct point { double x, y, z; point() {} point(double x, double y, double z): x(x), y(y), z(z) {} point operator + (const point& o) const { return point(x+o.x, y...
a.cc: In function 'double solve()': a.cc:62:33: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 62 | if (fabs(min({d1, d2, d3, d4})) < 1e-8) { | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, ...
s925372153
p00738
C++
#include <iostream> #include <iomanip> #include <cmath> #include <vector> using namespace std; inline double sq(double x) { return x * x; } struct point { double x, y, z; point() {} point(double x, double y, double z): x(x), y(y), z(z) {} point operator + (const point& o) const { return point(x+o.x, y...
a.cc: In function 'double solve()': a.cc:62:28: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 62 | if (min({d1, d2, d3, d4}) == 0) { | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from ...
s180645447
p00738
C++
#include <iostream> #include <cstdio> #include <vector> #include <queue> #include <string> #include <cmath> #include <set> #include <map> #include <algorithm> #include <sstream> #include <complex> using namespace std; #define vec vector #define pb push_back #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(...
a.cc:47:1: error: 'define' does not name a type 47 | define ZEROP(x) (fabs(x) < EPS) | ^~~~~~ a.cc:57:27: error: 'P' does not name a type; did you mean 'PI'? 57 | bool operator < (const P& a, const P& b) { | ^ | PI a.cc:57:39: error: 'P' doe...
s704166851
p00738
C++
#include <iostream> #include <cstdio> #include <vector> #include <queue> #include <string> #include <cmath> #include <set> #include <map> #include <algorithm> #include <sstream> #include <complex> using namespace std; #define vec vector #define pb push_back #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(...
a.cc:47:1: error: 'define' does not name a type 47 | define ZEROP(x) (fabs(x) < EPS) | ^~~~~~ a.cc:57:27: error: 'P' does not name a type; did you mean 'PI'? 57 | bool operator < (const P& a, const P& b) { | ^ | PI a.cc:57:39: error: 'P' doe...
s086376990
p00738
C++
#include <iostream> #include <cstdio> #include <vector> #include <queue> #include <string> #include <cmath> #include <set> #include <map> #include <algorithm> #include <sstream> #include <complex> using namespace std; #define vec vector #define pb push_back #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(...
a.cc: In function 'double solve()': a.cc:133:14: error: 'INT_MAX' was not declared in this scope 133 | double r = INT_MAX; | ^~~~~~~ a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 11 | #include <complex> +++ |+#include <cl...
s983083530
p00738
C++
#include <iostream> #include <cstdio> #include <vector> #include <queue> #include <string> #include <cmath> #include <set> #include <map> #include <algorithm> #include <sstream> #include <complex> #include <limit.h> using namespace std; #define vec vector #define pb push_back #define FOR(i,c) for(__typeof((c).begin()...
a.cc:12:10: fatal error: limit.h: No such file or directory 12 | #include <limit.h> | ^~~~~~~~~ compilation terminated.
s175481661
p00738
C++
include <iostream> #include <cstdio> #include <vector> #include <queue> #include <string> #include <cmath> #include <set> #include <map> #include <algorithm> #include <sstream> #include <complex> #include <limits.h> using namespace std; #define ZEROP(x) (fabs(x) < EPS) #define EQ(x, y) ZEROP((x) - (y)) #define LT(x, ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s511043638
p00738
C++
#include <iostream> #include <limits.h> #include <algorithm> #include <vector> #include <queue> #include <stdlib.h> #include <string.h> #include <complex> using namespace std; typedef complex<double> P; double EPS = 1e-8; typedef struct { P s,e; double h; }RECT; void P_cin(P& p){ double x,y; cin >>x >> y; p.r...
a.cc: In function 'bool is_intersected_ls(P, P, P, P)': a.cc:30:20: error: cannot bind non-const lvalue reference of type 'P&' {aka 'std::complex<double>&'} to an rvalue of type 'std::complex<double>' 30 | return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) && | ~~^~~ a.cc:27:17: note...
s667271712
p00738
C++
//二次元幾何ライブラリ #include <iostream> #include <cstdio> #include <complex> #include <map> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define ML make_pair typedef long double D; typedef bool B; typedef complex<D> P; //点 typedef complex<D> V; //ベクトル typedef pair<P,P> L; ...
a.cc: In function 'int main()': a.cc:138:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long double') 138 | cin >> root1.real() >> root1.imag() >> root2.real() >> root2.imag(); | ~~~ ^~ ~~~~~~~~~~~~ | ...
s106385891
p00739
C++
#include<iostream> #include<set> #include<tuple> #include<vector> using namespace std; typedef pair<char,char> PII; typedef tuple<set<PII>,set<PII>,set<PII> > T; bool neighbor(const set<PII> &s,PII p){ for(int i=0;i<4;i++){ static int d[]={0,1,0,-1,0}; auto pp=make_pair(p.first+d[i],p.second+d[i+1]); i...
a.cc: In function 'int main()': a.cc:63:21: error: no match for 'operator!=' (operand types are 'std::pair<int, int>' and 'std::pair<char, char>') 63 | if(d!=f&&rs.count(d)&&neighbor(get<0>(cs),f)&&neighbor(get<1>(cs),d)){ | ~^~~ | | | | ...
s500519791
p00739
C++
#include<iostream> #include<set> #include<tuple> #include<vector> using namespace std; typedef pair<char,char> PII; typedef tuple<set<PII>,set<PII>,set<PII> > T; bool neighbor(const set<PII> &s,PII p){ for(int i=0;i<4;i++){ static int d[]={0,1,0,-1,0}; auto pp=make_pair(p.first+d[i],p.second+d[i+1]); i...
a.cc: In function 'int main()': a.cc:69:30: error: no matching function for call to 'std::set<std::set<std::pair<char, char> > >::count(std::tuple<std::set<std::pair<char, char>, std::less<std::pair<char, char> >, std::allocator<std::pair<char, char> > >, std::set<std::pair<char, char>, std::less<std::pair<char, char> ...
s600593529
p00739
C++
#include<iostream> #include<unordered_set> #include<tuple> #include<vector> using namespace std; typedef pair<char,char> PII; typedef tuple<unordered_set<PII>,unordered_set<PII>,unordered_set<PII> > T; bool neighbor(const unordered_set<PII> &s,PII p){ for(int i=0;i<4;i++){ static int d[]={0,1,0,-1,0}; auto...
a.cc: In function 'int main()': a.cc:34:24: error: use of deleted function 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<char, char>; _Hash = std::hash<std::pair<char, char> >; _Pred = std::equal_to<std::pair<char, char> >; _Alloc = std::allocator<std::pair<char, char> >]' ...
s748028401
p00739
C++
#include<iostream> #include<algorithm> #include<set> #include<map> using namespace std; typedef set<int> Shape; #define MAX 12 int W, H, C[MAX][MAX], ncell, sx, sy, tx, ty, sd, td, flip; bool V[MAX][MAX]; map<Shape, bool> U; void rotate( int &x, int &y ){ if ( td == 1 ){ swap( x, y ); x *= (-1);} ...
a.cc: In function 'int main()': a.cc:87:44: error: 'a' was not declared in this scope 87 | for ( int x = 0; x < H + 2; x++ ){a | ^ a.cc:88:31: error: 'y' was not declared in this scope 88 | for ( int y = 0; y < W + 2; y++ ){ | ...
s638255451
p00740
Java
mport java.util.Scanner; import java.util.ArrayList; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=1,p=1,judge=0; ArrayList<Integer> mayor =new ArrayList<Integer>(); for(int i=0;i<50;i++){ mayor.add(i,0); } ArrayList<Integer> winner =new ArrayList<I...
Main.java:1: error: class, interface, enum, or record expected mport java.util.Scanner; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.ArrayList; ^ 2 errors
s549621886
p00740
Java
class main { public static void main(String[] args) { while (true) { Scanner s = new Scanner(System.in); String[] line = s.nextLine().split(" "); int n = Integer.parseInt(line[0]); int p = Integer.parseInt(line[1]); //int n = s.nextInt(); //int p = s.nextInt(); if (n == 0 &...
Main.java:4: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class main Main.java:4: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class main 2 errors
s547072332
p00740
Java
import java.util.Scanner; public class main { public static void main(String[] args) { while (true) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int p = s.nextInt(); if (n == 0 && p == 0) { break; } int pos = 0; int wan = p; int person[] = new int[n]; for (int i = 0; i <...
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s235577791
p00740
Java
class Main { public static void main(String[] args) { while (true) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int p = s.nextInt(); if (n == 0 && p == 0) { break; } int pos = 0; int wan = p; int person[] = new int[n]; for (int i = 0; i < n; i++) { person[i] = 0; }...
Main.java:4: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s850362795
p00740
Java
public class Main { public static void main(String[] args) { solve2440(); } public static void solve2440() { Scanner sc = new Scanner(System.in); while(true){ int n = sc.nextInt(); int p = sc.nextInt(); int pfst = p; int out = 0; if(0 == n&&0 ...
Main.java:54: error: reached end of file while parsing } ^ 1 error
s371038651
p00740
Java
public class Main { public static void main(String[] args) { solve2440(); } public static void solve2440() { Scanner sc = new Scanner(System.in); while(true){ int n = sc.nextInt(); int p = sc.nextInt(); int pfst = p; int out = 0; if(0 == n&&0 ...
Main.java:8: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:8: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s260852546
p00740
Java
public class Main { public static void main(String[] args) { solve2440(); } public static void solve2440() { Scanner sc = new Scanner(System.in); while(true){ int n = sc.nextInt(); int p = sc.nextInt(); int pfst = p; int out = 0; if(0 == n&&0 ...
Main.java:8: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:8: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s815509946
p00740
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int n = sc.nextInt(); int p = sc.nextInt(); if(n == 0 && p == 0) break; int[] a = new int[n]; int b = p; int...
Main.java:18: error: ';' expected a[k] = 0: ^ 1 error
s046474937
p00740
Java
import java.util.Scanner; public class AOJ1159 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); while(true){ int n = stdIn.nextInt(); int p = stdIn.nextInt(); if(n==0&&p==0){ return; } int[] te = new int[n]; int table = p; for(int i=0;i<n;i++){ te[i]...
Main.java:3: error: class AOJ1159 is public, should be declared in a file named AOJ1159.java public class AOJ1159 { ^ 1 error
s541963713
p00740
Java
import java.util.Scanner; public class AOJ1159 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); while(true){ int n = stdIn.nextInt(); int p = stdIn.nextInt(); if(n==0&&p==0){ return; } int[] te = new int[n]; int table = p; for(int i=0;i<n;i++){ te[i]...
Main.java:3: error: class AOJ1159 is public, should be declared in a file named AOJ1159.java public class AOJ1159 { ^ 1 error
s704452778
p00740
Java
package icpc2009; import java.util.ArrayList; import java.util.Scanner; public class NextMayor { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int kohosha, wan; kohosha = scn.nextInt(); //候補者数 wan = scn.nextInt(); //小石数 while (kohosha != 0 || wan != 0) { int[] temoto = ...
Main.java:6: error: class NextMayor is public, should be declared in a file named NextMayor.java public class NextMayor { ^ 1 error
s501973055
p00740
Java
import java.util.ArrayList; import java.util.Scanner; public class NextMayor { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int kohosha, wan; kohosha = scn.nextInt(); //候補者数 wan = scn.nextInt(); //小石数 while (kohosha != 0 || wan != 0) { int[] temoto = new int[kohosha]; ...
Main.java:4: error: class NextMayor is public, should be declared in a file named NextMayor.java public class NextMayor { ^ 1 error
s575190491
p00740
Java
import java.util.Scanner; public class NextMayor { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int kohosha, wan; kohosha = scn.nextInt(); //候補者数 wan = scn.nextInt(); //小石数 while (kohosha != 0 || wan != 0) { int[] temoto = new int[kohosha]; int turn = 0; while(tru...
Main.java:3: error: class NextMayor is public, should be declared in a file named NextMayor.java public class NextMayor { ^ 1 error
s953000083
p00740
C
#include<stdio.h> int main(void){ int n,p; int mem[50]={0}; int num,i,j; while(1){ scanf("%d %d",&n,&p); for(i=0;i<n;i++){ mem[i]=0; } num=p; if(n==0&&p==0){ break; } while(1){ for(i=0;i<n;i++){ if(num==0&&mem[i]!=p){ num=mem[i]; mem[i]=0; } else{ mem[i]++; ...
main.c: In function 'main': main.c:35:9: error: expected declaration or statement at end of input 35 | } | ^
s304615048
p00740
C
#include <stdio.h> int main() { int i, j, k, n, p; int d[50]; while(1) { for ( i = 0; i < 50; i++) { d[i] = 0; } scanf("%d %d", &n, &p); if ( n == 0 && p == 0 ) return 0; t = p; while(1) { for ( i = 0; i < n; i++) { if ( p != 0 ) { d[i] += 1; p--; } else if( p ...
main.c: In function 'main': main.c:16:17: error: 't' undeclared (first use in this function) 16 | t = p; | ^ main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in main.c:30:33: error: label 'owari' used but not defined 30 | ...
s770864972
p00740
C
#include <stdio.h> int candid[50] = {0}; int n, p, i, mark; while(1){ scanf("%d %d",&n,&p); if(n == 0 && p == 0) break; mark = p; for(i =0;i <= 1000000;i++){ if(p!=0){ if(candid[i%n] == 0){ candid[i%n] = p; p = 0; } else{ candid[i%n]++; p--; } } else{ if(candid[i%n] != 0){ p=candid[i%n]; candid[i%n...
main.c:6:1: error: expected identifier or '(' before 'while' 6 | while(1){ | ^~~~~ main.c:36:1: error: expected identifier or '(' before 'return' 36 | return 0; | ^~~~~~ main.c:37:1: error: expected identifier or '(' before '}' token 37 | } | ^
s521982194
p00740
C
#include<stdio.h> int game(int n, int p){ int x[50]={0}; //n??????????£???? int loop = 0; //n??????????£????????????????????????? int stones = p; //?????£?????????????????° while(1){ if(loop == n) //loop???n?????§?????£??????0????????? loop = 0; if(stones > 0){ //???????????£???????????? x[loop...
main.c: In function 'main': main.c:31:9: error: expected declaration or statement at end of input 31 | return 0; | ^~~~~~
s052552496
p00740
C
#include<stdio.h> #define MAX 50 // ????£?????????????????¢??????\??£???????°????????????§??° int main() { int n; // ????£??????°???3 <= n <= 50??? int p; // ?°????????????°???2 <= p <= 50??? int candidate[MAX]; // ???????£????????????£??????????°?????????° int wan; ...
main.c: In function 'main': main.c:21:19: error: 'i' undeclared (first use in this function) 21 | candidate[i] = {}; /* ??????????????°????°????????????£???????????? */ | ^ main.c:21:19: note: each undeclared identifier is reported only once for each function it appears in main.c:21...
s899418882
p00740
C
#include<stdio.h> #define MAX 50 // ????£?????????????????¢??????\??£???????°????????????§??° int main() { int n; // ????£??????°???3 <= n <= 50??? int p; // ?°????????????°???2 <= p <= 50??? int candidate[MAX]; // ???????£????????????£??????????°?????????° int wan; ...
main.c: In function 'main': main.c:21:19: error: 'i' undeclared (first use in this function) 21 | candidate[i] = {}; /* ??????????????°????°????????????£???????????? */ | ^ main.c:21:19: note: each undeclared identifier is reported only once for each function it appears in main.c:21...
s184184494
p00740
C
#include <stdio.h> int main() { ????int i=0, l,?? p, q, j=0; ????int d[50]; ?? ????while(1) ????????{ ????????????for ( i = 0; i < 50; i++) ????????{ ????????????d[i] = 0; ????????}???? ????????????scanf("%d %d", &l, &p); ????????????if( l == 0 && p == 0 ) break; ????????????q = p; ????????????while(1) ????????{ ?????...
main.c: In function 'main': main.c:4:1: error: expected expression before '?' token 4 | ????int i=0, l,?? p, q, j=0; | ^ main.c:5:1: error: expected expression before '?' token 5 | ????int d[50]; | ^ main.c:6:1: error: expected expression before '?' token 6 | ?? | ^
s893614560
p00740
C
#include <stdio.h> int main() { ????int i=0, l,?? p, q, j=0; ????int d[50]; ?? ????while(1) ????????{ ????????????for ( i = 0; i < 50; i++) ????????{ ????????????d[i] = 0; ????????}???? ????????????scanf("%d %d", &l, &p); ????????????if( l == 0 && p == 0 ) break; ????????????q = p; ????????????while(1) ????????{ ?????...
main.c: In function 'main': main.c:4:1: error: expected expression before '?' token 4 | ????int i=0, l,?? p, q, j=0; | ^ main.c:5:1: error: expected expression before '?' token 5 | ????int d[50]; | ^ main.c:6:1: error: expected expression before '?' token 6 | ?? | ^
s037531945
p00740
C
#include<stdio.h> #include<stdlib.h> int main(void) { int i,j,c; int a[50]; int n,p; while(1) { scanf("%d %d",&n,&p); scanf("%d",&p); if(n == 0 && p == 0)break; for(i=0;i<n;i++){ a[i] = 0; } i = 0; while(1){ while(1){ a[i++] += 1; if(i==n)i -= n; p--; if(p==0){break;} ...
main.c: In function 'main': main.c:34:41: error: 'braek' undeclared (first use in this function) 34 | if(c==2)braek; | ^~~~~ main.c:34:41: note: each undeclared identifier is reported only once for each function it appears in
s581410859
p00740
C
#include<stdio.h> #include<stdlib.h> int main(void) { int i,j,c; int a[50]; int n,p; while(1) { scanf("%d %d",&n,&p); scanf("%d",&p); if(n == 0 && p == 0)break; for(i=0;i<n;i++){ a[i] = 0; } i = 0; while(1){ while(1){ a[i++] += 1; if(i==n)i -= n; p--; if(p==0){break;} ...
main.c: In function 'main': main.c:34:41: error: 'braek' undeclared (first use in this function) 34 | if(c==2)braek; | ^~~~~ main.c:34:41: note: each undeclared identifier is reported only once for each function it appears in
s329877122
p00740
C
#include<stdio.h> main(){ int s[100],p,n,t; int i,j,sum; while(1){ scanf("%d %d",&n,&p); if(n==0&&p==0){ break; } t=p; for (int i = 0; i < 100; i++) s[i] = 0; for(i=0;;i++){ if(p==0){ p=s[i%n]; s[i%n]=0; }else{ ...
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~
s221470513
p00740
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
s466267413
p00740
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
s183975228
p00740
C++
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(true){ int n=sc.nextInt(); int p=sc.nextInt(); if(n==0) break; int i=0; int[] a=new int[n]; while(true){ if(p>0){ p--; a[i]++; } else{ p+=a[i]; a[i]=0; } i...
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{ | ^~~~~~
s106610456
p00740
C++
#! /usr/bin/env python # -*- coding: utf-8 -*- import copy (n, p) = map(int, raw_input().split()) while n!=0 and p!=0: bawl = copy.copy(p) peb = [0]*n for i in range(1000000): if bawl > 0: bawl -= 1 peb[i%n] += 1 else: bawl += peb[i%n] peb[i%n...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #! /usr/bin/env python | ^ a.cc:2:3: error: invalid preprocessing directive #- 2 | # -*- coding: utf-8 -*- | ^ a.cc:3:1: error: 'import' does not name a type 3 | import copy | ^~~~~~ a.cc:3:1: note: C++20 'import' only available wi...
s045646384
p00740
C++
#include<stdio.h> #include<iostream> using namespace std; intmain(){ int N,M; int n[51]={}; int i=0,p=0; while(1){ scanf("%d %d",&N,&M); if(N==0&&M==0)break; p=M;i=0; while(n[i]!=M) { if(p==0&&n[i]>0){p=n[i];n[i]=0;} //else if(p==0&&n[i]==0) else if(p>0){p--;n[i]++;} i++; if(i==N-1)i=0; } cout<<i<<endl; } return 0; }
a.cc:5:1: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive] 5 | intmain(){ | ^~~~~~~
s008853945
p00740
C++
#include <iostream> //#include <algorithm> //#include <vector> //#include <stack> //#include <queue> //#include <map> //#include <cmath> //#include <string> //#include <sstream> //#include <iomanip> //#include <complex> using namespace std; //#define ll long long //#define vvi vector< vector<int> > //#define All(X) X...
a.cc: In function 'int main()': a.cc:34:22: error: 'lend' was not declared in this scope 34 | cout << k << lend; | ^~~~
s890057442
p00740
C++
#include <iostream> using namespace std; void main() { int n, p; while (1) { int flag = 0; int player[50] = { 0 }; cin >> n >> p; if (n == 0 && p == 0) break; int p_max = p; while (1) { for (int j = 0; j < n; j++) { if (p != 0) player[j] += 1, p--; else p = player[j], player[j] = 0; if...
a.cc:4:1: error: '::main' must return 'int' 4 | void main() { | ^~~~
s623027874
p00740
C++
#include <iostream> using namespace std; void main() { int n, p; while (1) { int flag = 0; int player[50] = { 0 }; cin >> n >> p; if (n == 0 && p == 0) break; int p_max = p; while (1) { for (int j = 0; j < n; j++) { if (p != 0) player[j] += 1, p--; else p = player[j], player[j] = 0; if...
a.cc:4:1: error: '::main' must return 'int' 4 | void main() { | ^~~~
s576260510
p00740
C++
#include <iostream> using namespace std; void main() { int n, p; while (1) { int flag = 0; int player[50] = { 0 }; cin >> n >> p; if (n == 0 && p == 0) break; int p_max = p; while (1) { for (int j = 0; j < n; j++) { if (p != 0) player[j] += 1, p--; else p = player[j], player[j] = 0; if...
a.cc:4:1: error: '::main' must return 'int' 4 | void main() { | ^~~~
s550054348
p00740
C++
#include <iostream> using namespace std; void main() { int n, p; while (1) { int flag = 0; int player[50] = { 0 }; cin >> n >> p; if (n == 0 && p == 0) break; int p_max = p; while (1) { for (int j = 0; j < n; j++) { if (p != 0) player[j] += 1, p--; else p = player[j], player[j] = 0; if...
a.cc:4:1: error: '::main' must return 'int' 4 | void main() { | ^~~~
s059610849
p00740
C++
#include <iostream> using namespace std; void main() { int n, p; while (1) { int flag = 0; int player[50] = { 0 }; cin >> n >> p; if (n == 0 && p == 0) break; int p_max = p; while (1) { for (int j = 0; j < n; j++) { if (p != 0) player[j] += 1, p--; else p = player[j], player[j] = 0; if...
a.cc:4:1: error: '::main' must return 'int' 4 | void main() { | ^~~~
s199054705
p00740
C++
#include <iostream> using namespace std; void main() { int n, p; while (1) { int flag = 0; int player[50] = { 0 }; cin >> n >> p; if (n == 0 && p == 0) break; int p_max = p; while (1) { for (int j = 0; j < n; j++) { if (p != 0) player[j] += 1, p--; else p = player[j], player[j] = 0; if (...
a.cc:4:1: error: '::main' must return 'int' 4 | void main() { | ^~~~
s939539335
p00740
C++
#include <stdio.h> int main() { ????int i=0, l,?? p, q, j=0; ????int d[50]; ?? ????while(1) ????????{ ????????????for ( i = 0; i < 50; i++) ????????{ ????????????d[i] = 0; ????????}???? ????????????scanf("%d %d", &l, &p); ????????????if( l == 0 && p == 0 ) break; ????????????q = p; ????????????while(1) ????????{ ?????...
a.cc: In function 'int main()': a.cc:4:1: error: expected primary-expression before '?' token 4 | ????int i=0, l,?? p, q, j=0; | ^ a.cc:4:2: error: expected primary-expression before '?' token 4 | ????int i=0, l,?? p, q, j=0; | ^ a.cc:4:3: error: expected primary-expression before '?' token 4 |...
s355129157
p00740
C++
#include <iostream> using namespace std; int main(){ int n,p; for(;;){ cin >>n >> p; if(n == 0 && p == 0)break; int human[n]; for(int i = 0;i < n;i++){ human=0; } int stone = p; int turn = 0; for(;;){ if(!stone){ stone += human[turn]; human[turn] = 0; ...
a.cc: In function 'int main()': a.cc:10:12: error: incompatible types in assignment of 'int' to 'int [n]' 10 | human=0; | ~~~~~^~
s827753550
p00740
C++
#include <iostream> using namespace std; int main(void){ while(1){ int stone[50]; for(int k = 0 ; k < 50 ; k++){stone[k] = 0;} int bowl; int n, p; // n:候補者人数,p:小石の総数 cin >> n; cin >> p; if(n == 0 && p == 0){return 0;} bowl = p; bool flg = true; int ans; for(int i = 0...
a.cc:36:1: error: '\U00003042\U00003063\U0000306f\U00003063\U0000306f' does not name a type 36 | あっはっは | ^~~~~~~~~~
s387721496
p00740
C++
//YukiOtake-2018/03/04 //time:12:11 import java.util.Scanner; class Main{ public static void main(String args[]){ Scanner scan = new Scanner(System.in); while(true){ int n=scan.nextInt(); int p=scan.nextInt(); // int n=3,p=2; if(n==0 && p==0){ break; } int[] data=new int...
a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Scanner; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:15: error: expected ':' before 'static' 5 | public static void main(String args[]){ | ^~~~~~~ | : a...
s539716920
p00740
C++
#include <iostream> #include <map> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int n, p, all; vector<int> r; while (cin >> n >> p && n && p) { bool flag = false; all = p; map<int, int> m; rep(i, n) m[i] = 0; while (!flag) { // cout...
a.cc: In function 'int main()': a.cc:26:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 26 | int main() { | ^~ a.cc:26:9: note: remove parentheses to default-initialize a variable 26 | int main() { | ^~ | -- a.cc:26:9: note: or ...
s299616261
p00740
C++
import numpy as np while True: try: l = list(map(int, input().split())) S = l[0] p = np.zeros(S) M = l[1] i = 0 N = M while True: if N == M and i != 0: ans = i % S - 1 if ans < 0: ans = S + ans ...
a.cc:1:1: error: 'import' does not name a type 1 | import numpy as np | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s079157248
p00740
C++
#include <iostream> using namespace std; int main() } int n,p; while(cin >> n >> p, n||p) { int s=p; int snum[64] = {0}; for(int i=0; true; i=(i+1)%n) { if(s) { snum[i]++; if(snum[i]==p) { cout << i << endl; break; } } else { s=snum[i]; snum[i]=0; } } ...
a.cc:5:1: error: expected initializer before '}' token 5 | } | ^ a.cc:5:1: error: expected declaration before '}' token a.cc:7:9: error: expected unqualified-id before 'while' 7 | while(cin >> n >> p, n||p) | ^~~~~ a.cc:31:1: error: expected declaration before '}' token 31 | } ...
s941659763
p00740
C++
#include<iostream> using namespace std; int main(){ int n,p; int c[50]; for(;;){ cin >> n >> p; if(!n && !p)break; for(int i=0;i<n;i++)c[i] = 0; int cnt = 0; int pos = -1; while(cnt!=1 || p){ pos = (pos+1)%n; if(p){ if(!c[pos])cnt++; c[pos]++; p--; }else{ if(!c[pos]) p = c[pos]; c[pos] = 0; } pos = (pos+1)%n; } cout ...
a.cc: In function 'int main()': a.cc:27:13: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 27 | cout << pos << end;; | ~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/includ...
s418830675
p00740
C++
#include<iostream> using namespace std; int main(){ int n,p; int c[50]; for(;;){ cin >> n >> p; if(!n && !p)break; for(int i=0;i<n;i++)c[i] = 0; int pos = -1; for(;;){ pos = (pos+1)%n; if(p){ c[pos]++; p--; }else{ p = c[pos]; c[pos] = 0; } if(!P){ int cnt = 0; for(int i=0;i<n;i++) if(c[i])cnt++; if(cnt==1)break; } } ...
a.cc: In function 'int main()': a.cc:22:5: error: 'P' was not declared in this scope 22 | if(!P){ | ^
s814363180
p00740
C++
#include<cstdio> using namespace std; int main(){ int n,p; int c[50]; for(;;){ scanf("%d,%d",&n,&p); if(!n && !p)break; for(int i=0;i<n;i++)c[i] = 0; int cnt = 0; int pos = -1; for(;;){ pos = (pos+1)%n; if(p){ if(!c[pos])cnt++; c[pos]++; p--; }else{ if(c[pos])cnt--; p = c[pos]; c[pos] = 0; } if(!p && cntt==1)break; }...
a.cc: In function 'int main()': a.cc:25:10: error: 'cntt' was not declared in this scope; did you mean 'cnt'? 25 | if(!p && cntt==1)break; | ^~~~ | cnt
s753064545
p00740
C++
import java.util.*; public class Main { int[] N; int n,p; Main(){ n=-1;p=-1; } void run(){ Scanner sc=new Scanner(System.in); while(true){ n=sc.nextInt(); p=sc.nextInt(); if(n==0&&p==0)break; N=new int[n]; System.out.println(solve(0,p)); } } int solve(int current,int remains){ while(t...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s578520629
p00740
C++
include<iostream> #include<cstring> using namespace std; int main() { int n,p; for(;cin>>n>>p,n||p;) { int count[n]; memset(count,0,sizeof(count)); int pp=p; for(int i=0;;i++) { if(i>=n) i=0; if(pp!=0) { count[i]++; pp--; } else { pp=c...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:9:8: error: 'cin' was not declared in this scope 9 | for(;cin>>n>>p,n||p;) | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by add...
s230735969
p00740
C++
null
a.cc:1:1: error: 'null' does not name a type 1 | null | ^~~~
s528003986
p00740
C++
null
a.cc:1:1: error: 'null' does not name a type 1 | null | ^~~~
s157316689
p00741
Java
import java.util.Scanner; public class AC1 { static int a,b; static int[][] field; public static void main(String args[]){ Scanner s=new Scanner(System.in); while(true){ b=s.nextInt(); a=s.nextInt(); if(a==0)System.exit(0); field = new int[a][b]; for(int i=0; i<a; i++) { for(int j=0; j<...
Main.java:3: error: class AC1 is public, should be declared in a file named AC1.java public class AC1 { ^ 1 error
s707339863
p00741
Java
import java.util.Scanner; public class AC1 { static int a,b; static int[][] field; public static void main(String args[]){ Scanner s=new Scanner(System.in); while(true){ b=s.nextInt(); a=s.nextInt(); if(a==0)System.exit(0); field = new int[a][b]; for(int i=0; i<a; i++) { for(int j=0; j<...
Main.java:3: error: class AC1 is public, should be declared in a file named AC1.java public class AC1 { ^ 1 error
s703161021
p00741
Java
import java.util.Scanner; public class AC1 { static int a,b; static int[][] field; public static void main(String args[]){ Scanner s=new Scanner(System.in); while(true){ b=s.nextInt(); a=s.nextInt(); if(a==0)System.exit(0); field = new int[a][b]; for(int i=0; i<a; i++) { for(int j=0; j<...
Main.java:3: error: class AC1 is public, should be declared in a file named AC1.java public class AC1 { ^ 1 error
s342125503
p00741
Java
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /** * Created by YuyaKita on 2015/05/18. */ public class Main { static final int MAX_W = 50, MAX_H = 50; static int W, H; static int[][] world = new int[MAX_H + 1][MAX_W + 1]; static int count = 0; static int[] d...
Main.java:18: error: no suitable constructor found for File(InputStream) Scanner sc = new Scanner(new File(System.in)); ^ constructor File.File(String) is not applicable (argument mismatch; InputStream cannot be converted to String) constructor File.File(URI) is no...
s993225482
p00741
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigDecimal; import java.math.BigInteger; public cl...
Main.java:36: error: incompatible types: int[][] cannot be converted to char[][] dfs(i,j,map,h,w); ^ Main.java:57: error: bad operand types for binary operator '&&' if(nx>=0&&nx<h&&ny=0&&ny<w&&map[nx][ny]==1) dfs(nx,ny,map,h,w); ^ first type: boolean second type: int Main.java:5...
s631885202
p00741
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigDecimal; import java.math.BigInteger; public cl...
Main.java:57: error: bad operand types for binary operator '&&' if(nx>=0&&nx<h&&ny=0&&ny<w&&map[nx][ny]==1) dfs(nx,ny,map,h,w); ^ first type: boolean second type: int Main.java:57: error: bad operand types for binary operator '&&' if(nx>=0&&nx<h&&ny=0&&ny<w&&map[nx][ny]==1) dfs(nx,ny,map,h,w); ...
s316700172
p00741
Java
package self_question; import java.util.ArrayList; import java.util.Scanner; public class MAIN { // ??¶?????????????????\?????????????????????????????£??? static Scanner sc = new Scanner(System.in); // ??¶????§???????????´?????????????????????? static int[][] map; // ??¶???????????° static int...
Main.java:6: error: class MAIN is public, should be declared in a file named MAIN.java public class MAIN { ^ 1 error