submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s899147511 | p00223 | C++ | #include <bits/stdc++.h>
using namespace std;
int table[52][52];
bool memo[52][52][52][52];
const int leftmove = -1;
const int rightmove = 1;
const int upmove = -1;
const int downmove = 1;
int main() {
while(1){
int w,h;
//scanf(" %d %d",&w,&h);
cin >> w >> h;
if(w==0&&h==0)... | a.cc: In function 'int main()':
a.cc:71:13: error: 'check' was not declared in this scope
71 | check = true;
| ^~~~~
|
s458885114 | p00223 | C++ | #include<string.h>
using namespace std;
struct Y{
int hx,hy,rx,ry,tim;
};
int mp[52][52],vh[52][52],vr[52][52];
int main(){
int n,w,h,i,j,a[2]={1,-1},b[2],g,k;
Y e;
queue<Y> q;
while(1){
g=0;
k=0;
cin>>w>>h;
if(w==0&&h==0)break;
cin>>e.hx>>e.hy>>e.rx>>e.ry;
e.tim=0;
q.push(e);
memset(mp,0,sizeof(mp));
memset(v... | a.cc: In function 'int main()':
a.cc:10:1: error: 'queue' was not declared in this scope
10 | queue<Y> q;
| ^~~~~
a.cc:2:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
1 | #include<string.h>
+++ |+#include <queue>
2 | using namespace std;
a... |
s396999545 | p00223 | C++ | #include<iostream>
#include<queue>
#include<cstring>
using namespace std;
bool went[50 + 10][50 + 10][50 + 10][50 + 10] = { 0 };
int map[50 + 10][50 + 10]/* = { 0 }*/;
int gx[] = { 1,0,-1,0,-1,0,1,0 };
int gy[] = { 0,1,0,-1,0,-1,0,1 };
struct ST
{
int tx, ty;
int kx, ky;
int tim=0;
};
bool ChekNow(ST);
ST GoM... | a.cc: In function 'int main()':
a.cc:89:44: error: expected ';' before '.' token
89 | while (!nx.empty()) && now.tim<100)
| ^
| ;
a.cc:89:41: error: label 'now' used but not defined
89 | ... |
s775141521 | p00223 | C++ | package main
import (
"fmt"
"math"
)
type Position struct {
X int64
Y int64
}
func (one Position) Distance(another Position) int64 {
return int64(math.Abs(float64(one.X-another.X)) + math.Abs(float64(one.Y-another.Y)))
}
type PersonPosition struct {
Takayuki Position
Kazuyuki Position
}
func (one PersonPosi... | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
a.cc:13:6: error: expected constructor, destructor, or type conversion before '(' token
13 | func (one Position) Distance(another Position) int64 {
| ^
a.cc:17:1: error: 'type' does not name a type; did you mean 'typeof'?... |
s761134812 | p00223 | C++ | #include <iostream>
#include <queue>
using namespace std;
const int INF=100000000;
class Point{
public:
int tx;
int ty;
int kx;
int ky;
};
int main(){
while(true){
int X,Y;
cin>>X>>Y;
if(X==0&&Y==0){
break;
}
char F[X+2][Y+2];
int D[X+1][Y+1];
for(int x=1;x<=X;x++){
... | a.cc: In function 'int main()':
a.cc:149:21: error: expected primary-expression before '=' token
149 | que.push(q);=1;y<=Y;y++){
| ^
a.cc:149:24: error: 'y' was not declared in this scope
149 | que.push(q);=1;y<=Y;y++){
| ^
a.cc:157:2: error: ex... |
s804078732 | p00223 | 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
| |
s894728158 | p00223 | C++ | #include <iostream>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <map>
using namespace std;
typedef long long ll;
int x, y;
int time[51][51][51][51];
char field[51][51];
int dx[] = {
0, -1, 0, 1
};
int dy[] = {
1, 0, -1, 0
};
s... | a.cc:14:24: error: 'int time [51][51][51][51]' redeclared as different kind of entity
14 | int time[51][51][51][51];
| ^
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/... |
s039417296 | p00223 | C++ | #include <iostream>
#include <queue>
using namespace std;
struct PointPair {
int step;
int tx, ty, kx, ky;
};
const int dx[] = { -1, 1, 0, 0 };
const int dy[] = { 0, 0, -1, 1 };
bool passed[50][50][50][50];
bool field[50][50];
int main(){
while(true){
memset(passed, 0, sizeof... | a.cc: In function 'int main()':
a.cc:18:17: error: 'memset' was not declared in this scope
18 | memset(passed, 0, sizeof(passed));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <queue>... |
s071333476 | p00223 | C++ | g#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long LL;
stat... | a.cc:1:2: error: stray '#' in program
1 | g#include <cstdio>
| ^
a.cc:1:1: error: 'g' does not name a type
1 | g#include <cstdio>
| ^
In file included from /usr/include/c++/14/cmath:45,
from a.cc:3:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cx... |
s492822018 | p00223 | C++ | #include<iostream>
#include<queue>
using namespace std;
#define MAX 51
int xy[MAX][MAX];
int cost[MAX][MAX][MAX][MAX];
int X,Y;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
struct state{
int tx;
int ty;
int kx;
int ky;
int co;
state(){}
state(int tx,int ty,int kx,int ky,int co):
tx(tx),ty(ty),kx(k... | a.cc: In function 'int solve(int, int, int, int)':
a.cc:28:3: error: 'memset' was not declared in this scope
28 | memset(cost,101,sizeof(cost));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<queue>
+++ |+#inclu... |
s727454251 | p00223 | C++ | #include<iostream>
#include<queue>
using namespace std;
#define MAX 51
int xy[MAX][MAX];
int cost[MAX][MAX][MAX][MAX];
int X,Y;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
struct state{
int tx;
int ty;
int kx;
int ky;
int co;
state(){}
state(int tx,int ty,int kx,int ky,int co):
tx(tx),ty(ty),kx(k... | a.cc: In function 'int solve(int, int, int, int)':
a.cc:28:3: error: 'memset' was not declared in this scope
28 | memset(cost,101,sizeof(cost));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<queue>
+++ |+#inclu... |
s780292612 | p00223 | C++ | #include<cstdio>
#include<string.h>
using namespace std;
#define MAX 51
int xy[MAX][MAX];
int cost[MAX][MAX][MAX][MAX];
int X,Y;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
struct state{
int tx;
int ty;
int kx;
int ky;
int co;
state(){}
state(int tx,int ty,int kx,int ky,int co):
tx(tx),ty(ty),kx(... | a.cc: In function 'int solve(int, int, int, int)':
a.cc:30:3: error: 'queue' was not declared in this scope
30 | queue<state> q;
| ^~~~~
a.cc:3:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
2 | #include<string.h>
+++ |+#include <queue>
... |
s138355795 | p00223 | C++ | #include <iostream>
#include <queue>
#include <map>
#define INF 100000000
#define MAX_X 1000
#define MAX_Y 1000
using namespace std;
typedef pair<pair<int,int>,pair<int,int> > P;
int d[MAX_Y][MAX_X][MAX_Y][MAX_X];
int tx,ty,kx,ky,ntx,nty,nkx,nky;
int ans;
short maze[MAX_Y][MAX_X];
int Y,X;
int dx[4]={1,0,-1,0},d... | /tmp/ccvd5Gl5.o: in function `bfs()':
a.cc:(.text+0x2d): relocation truncated to fit: R_X86_64_PC32 against symbol `kx' defined in .bss section in /tmp/ccvd5Gl5.o
a.cc:(.text+0x37): relocation truncated to fit: R_X86_64_PC32 against symbol `ky' defined in .bss section in /tmp/ccvd5Gl5.o
a.cc:(.text+0x4a): relocation tr... |
s093458009 | p00223 | C++ | #include <iostream>
#include <queue>
#include <map>
#define INF 100000000
#define MAX_X 1000
#define MAX_Y 1000
using namespace std;
typedef pair<pair<int,int>,pair<int,int> > P;
int d[MAX_Y][MAX_X][MAX_Y][MAX_X];
int tx,ty,kx,ky,ntx,nty,nkx,nky;
int ans;
short maze[MAX_Y][MAX_X];
int Y,X;
int dx[4]={1,0,-1,0},d... | /tmp/ccsKjFln.o: in function `bfs()':
a.cc:(.text+0x2d): relocation truncated to fit: R_X86_64_PC32 against symbol `kx' defined in .bss section in /tmp/ccsKjFln.o
a.cc:(.text+0x37): relocation truncated to fit: R_X86_64_PC32 against symbol `ky' defined in .bss section in /tmp/ccsKjFln.o
a.cc:(.text+0x4a): relocation tr... |
s666717151 | p00223 | C++ | #include <iostream>
#include <queue>
#include <map>
#define MAX_X 1000
#define MAX_Y 1000
using namespace std;
typedef pair<int,int> P;
typedef pair<P,P> PP;
int d[MAX_Y][MAX_X][MAX_Y][MAX_X];
int tx,ty,kx,ky,ntx,nty,nkx,nky;
int ans;
short maze[MAX_Y][MAX_X];
int Y,X;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
boo... | /tmp/cc0G4e3U.o: in function `bfs()':
a.cc:(.text+0x2d): relocation truncated to fit: R_X86_64_PC32 against symbol `kx' defined in .bss section in /tmp/cc0G4e3U.o
a.cc:(.text+0x37): relocation truncated to fit: R_X86_64_PC32 against symbol `ky' defined in .bss section in /tmp/cc0G4e3U.o
a.cc:(.text+0x4a): relocation tr... |
s411827051 | p00223 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define INF (1 << 30)
int xs[] = {0, 1, 0, -1}, ys[] = {1, 0, -1, 0};
int x, y;
int field[50][50];
char dp[50][50][50][50];
int solve(int tx, int ty, int kx, int ky){
int ntx, nty, nkx, nky;
if(dp[tx][ty][kx][ky] != -1){
return dp[tx]... | a.cc: In function 'int solve(int, int, int, int)':
a.cc:5:16: warning: overflow in conversion from 'int' to 'char' changes value from '1073741824' to '0' [-Woverflow]
5 | #define INF (1 << 30)
| ~~~^~~~~~
a.cc:17:24: note: in expansion of macro 'INF'
17 | dp[tx][ty][kx][ky] = INF;
| ... |
s929570644 | p00223 | C++ | #include <cstdio>
#include <queue>
#include <map>
#include <algorithm>
#define Z(n)get<n>(z)
#define M make_pair
#define F first
#define S second
using namespace std;
typedef pair<int,int> pii;
typedef tuple<pii,pii,int> T;
int t[51][51],dx[]={-1,0,1,0},dy[]={0,-1,0,1},a,b,x,y,X,Y,i,j,k;
int main(){
for(;scanf("%d%d",... | a.cc: In function 'int main()':
a.cc:5:19: error: no matching function for call to 'get<(k = 0)>(T&)'
5 | #define Z(n)get<n>(z)
| ~~~~~~^~~
a.cc:24:50: note: in expansion of macro 'Z'
24 | pii c1=make_pair(Z(k=0).F+dx[i],Z(0).S+dy[i]);
| ... |
s458448621 | p00223 | C++ | #include <cstdio>
#include <utility>
#include <queue>
using namespace std;
typedef pair<int,int> __P;
typedef pair<__P,__P> _P;
typedef pair<_P,int> P;
#define C(A,B) (0<=(A)&&(A)<(B))
int main() {
queue<P> que;
int X,Y;
int tx,ty;
int kx,ky;
int count;
int d[50][50];
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
w... | a.cc:31:40: error: macro "__P" passed 2 arguments, but takes just 1
31 | que.push(P(_P(__P(tx,ty),__P(kx,ky)),0));
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
... |
s154499820 | p00223 | C++ | #include <cstdio>
#include <utility>
#include <queue>
#include <map>
using namespace std;
typedef pair<int,int> __P;
typedef pair<__P,__P> _P;
typedef pair<_P,int> P;
#define C(A,B) (0<=(A)&&(A)<(B))
int main() {
queue<P> que;
map<P,bool> mp;
int X,Y;
int tx,ty;
int kx,ky;
int count;
int d[50][50];
int dx[4]... | a.cc:33:40: error: macro "__P" passed 2 arguments, but takes just 1
33 | que.push(P(_P(__P(tx,ty),__P(kx,ky)),0));
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
... |
s467130665 | p00223 | C++ | #include <cstdio>
#include <utility>
#include <queue>
#include <map>
using namespace std;
typedef pair<int,int> __P;
typedef pair<__P,__P> _P;
typedef pair<_P,int> P;
#define C(A,B) (0<=(A)&&(A)<(B))
int main() {
queue<P> que;
map<P,bool> mp;
int X,Y;
int tx,ty;
int kx,ky;
int count;
int d[50][50];
int dx[4]... | a.cc:33:40: error: macro "__P" passed 2 arguments, but takes just 1
33 | que.push(P(_P(__P(tx,ty),__P(kx,ky)),0));
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
... |
s148524232 | p00223 | C++ | #include <iostream>
#include <utility>
#include <queue>
#include <map>
using namespace std;
typedef pair<int,int> __P;
typedef pair<__P,__P> _P;
typedef pair<_P,int> P;
#define C(A,B) (0<=(A)&&(A)<(B))
int main() {
queue<P> que;
map<P,bool> mp;
int X,Y;
int tx,ty;
int kx,ky;
int count;
int d[50][50];
int dx[... | a.cc:33:40: error: macro "__P" passed 2 arguments, but takes just 1
33 | que.push(P(_P(__P(tx,ty),__P(kx,ky)),0));
| ^
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
... |
s666840560 | p00223 | C++ | #include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
struct S {
int tx,ty;
int kx,ky;
int turn;
S::S(int tx,int ty,int kx,int ky,int turn);
};
S::S(int _tx,int _ty,int _kx,int _ky,int _turn) {
tx=_tx;
ty=_ty;
kx=_kx;
ky=_ky;
turn=_turn;
}
bool d[50][50];
bool vst[50][50][50][50];
int d... | a.cc:10:9: error: extra qualification 'S::' on member 'S' [-fpermissive]
10 | S::S(int tx,int ty,int kx,int ky,int turn);
| ^
|
s626483546 | p00223 | C++ | #include<iostream>
#include<queue>
#include<map>
using namespace std;
struct node
{
int step;
int tx,ty;
int kx,ky;
node(int s,int ttx,int tty,int kkx,int kky):
step(s),tx(ttx),ty(tty),kx(kkx),ky(kky){}
};
int main()
{
int x,y;
for(;cin>>x>>y,x;)
{
bool data[52][52];
int tx,ty,kx,k... | a.cc: In function 'int main()':
a.cc:23:7: error: 'memset' was not declared in this scope
23 | memset(data,false,sizeof(data));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<map>
+++ |+#include <cstring... |
s268480631 | p00224 | Java |
ツ鳴セツ禿コツ閉淞督?づ可帰ツづィツづ慊つキツ?卍(ツゝツε鳴・ツ)vツキツャテ凝?
ツづ?づ債づ?づ催可シ | Main.java:154: error: class, interface, enum, or record expected
??????????????????????????????????v???????
^
Main.java:154: error: illegal character: '\uff08'
??????????????????????????????????v???????
^
Main.java:154: error: illegal character: '\u30fb'
??????????????????????????????????v?????... |
s755861761 | p00224 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#define MIN(x,y) (((x)<(y))?(x):(y))
#define INFTY (1<<21)
int m, n, k, d, C[7], G[110][110], N, D[110][64];
int getID(char *str);
int isC(int x);
int bellman(void);
int main(void){
char source[16], target[16];
int cost,s,t;
int i,j;... | main.c: In function 'bellman':
main.c:61:27: error: 'b' undeclared (first use in this function)
61 | if (isC(i3) && (b&(1<<(i3-1))) != 0 ) continue;
| ^
main.c:61:27: note: each undeclared identifier is reported only once for each function it appears in
|
s792734213 | p00224 | C | cn,cake[6];wn,wg[106][106];ln,lg[8][8];getid(){char s[9];int r;scanf("%s",s);if(*s=='C')r=atoi(s+1)-1;else if(*s=='H')r=cn;else if(*s=='D')r=cn+1;elser=cn+1+atoi(s+1);return r;}dijkstra(s){int cost[106],d[106]={0},c,n,i,t;memset(cost,1,sizeof(cost));c=s;cost[c]=0;for(;c>=0;){d[c]=1;n=-1;for(i=0;i<wn;i++){if(!d[i]){if(c... | main.c:1:1: warning: data definition has no type or storage class
1 | cn,cake[6];wn,wg[106][106];ln,lg[8][8];getid(){char s[9];int r;scanf("%s",s);if(*s=='C')r=atoi(s+1)-1;else if(*s=='H')r=cn;else if(*s=='D')r=cn+1;elser=cn+1+atoi(s+1);return r;}dijkstra(s){int cost[106],d[106]={0},c,n,i,t;memset(cost,1,sizeof(cos... |
s209201636 | p00224 | C++ | #include <iostream>
#include <map>
#include <vector>
#define MAX_INT 100000000
using namespace std;
map<string, map<string, int>> data;
map<string, int> cals;
// 再帰関数で使用
map<string, bool> pass;
map<string, int> mins;
int min_value = MAX_INT;
void recursive(string curr, int cal)
{
map<string, int>::iterator it... | a.cc: In function 'void recursive(std::string, int)':
a.cc:20:37: error: reference to 'data' is ambiguous
20 | map<string, int>::iterator it = data[curr].begin();
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/l... |
s385660039 | p00224 | C++ | #include <iostream>
#include <map>
#include <vector>
#define MAX_INT 100000000
using namespace std;
map<string, map<string, int>> data;
map<string, int> cals;
// 再帰関数で使用
map<string, bool> pass;
map<string, int> mins;
int min_value = MAX_INT;
void recursive(string curr, int cal)
{
map<string, int>::iterator it... | a.cc: In function 'void recursive(std::string, int)':
a.cc:20:37: error: reference to 'data' is ambiguous
20 | map<string, int>::iterator it = data[curr].begin();
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/l... |
s807519177 | p00224 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
w... | a.cc: In function 'int main()':
a.cc:69:34: error: no matching function for call to 'min(int&, long long int&)'
69 | ans = min(ans, dis);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux... |
s151575266 | p00224 | C++ | #include<bits/stdc++.h>
using namespace std;
#define INF (1<<30)
typedef pair< int , int > P;
typedef pair< int , P > Pi;
int m,n,k,d;
vector<int> cal;
struct Edge {
int to,cost;
Edge(){}
Edge(int to,int cost):to(to),cost(cost){};
};
vector< Edge > Graph[110];
int min_cost[110][1<<6];
int Bellman_Ford(){
int re... | a.cc: In function 'int Bellman_Ford()':
a.cc:39:10: error: 'cost' was not declared in this scope; did you mean 'cosl'?
39 | if(cost < min_cost[e.to][bit]){
| ^~~~
| cosl
a.cc: In function 'int judge(std::string)':
a.cc:53:1: warning: control reaches end of non-void function [-Wret... |
s264672681 | p00224 | C++ | #include <stdio.h>
#include <stdlib.h>
#define INF (10000000)
#define REP(i, n) for (int i = 0; i < (n); i++)
int route[110][110];
int quick[110];
int cake_cal[6];
int k;
void set_route(char start[], char end[], int dist)
{
int s, e;
if (start[0] == 'H'){
s = 0;
}
else if (start[0] == 'D'){
s = 109;
}
else... | a.cc: In function 'int track_back(int, int, int)':
a.cc:55:22: error: 'min' was not declared in this scope
55 | quick[pos] = min(quick[pos], cost);
| ^~~
|
s329305320 | p00224 | C++ | #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
class Edge
{... | a.cc: In function 'int main()':
a.cc:62:62: error: no matching function for call to 'std::vector<std::vector<Edge> >::vector(int, int)'
62 | vector<vector<Edge> > edges((m+n+2)*(1<<m), 0);
| ^
In file included from /usr/include/c++/14... |
s018355729 | p00224 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<stdlib>
using namespace std;
struct edge{
int from,to,cost;
edge(int a,int b,int c){from = a , to = b , cost = c;}
};
int m,n,k,dd;
vector<edge> es;
const int INF=100000;
int d[209];
int cake[9];
int root(string s){
if(s[0]=='H')return 0;
if(s[0]=='... | a.cc:4:9: fatal error: stdlib: No such file or directory
4 | #include<stdlib>
| ^~~~~~~~
compilation terminated.
|
s176925036 | p00224 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <complex>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <f... | a.cc: In function 'int main()':
a.cc:108:48: error: call of overloaded 'stoi(std::__cxx11::basic_string<char>)' is ambiguous
108 | if(src[0]=='C') si=stoi(src.substr(1))-1;
| ~~~~^~~~~~~~~~~~~~~
a.cc:57:5: note: candidate: 'int stoi(const std::s... |
s941916027 | p00225 | Java |
import java.util.Scanner;
public class main{
static String term = new String();
static char t[][];
static int n;
static boolean bt(int m,int cnt){
if(cnt == n-1) {
if(t[0][0] == t[m][1]) return true;
else return false;
}
for(int i=0; i<n; i++){
if(i != m && t[m][1] == t[i][0]){
if(bt(i,cnt... | Main.java:5: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s018603621 | p00225 | Java | import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
void run() {
Scanner in = new Scanner(System.in);
while(true) {
int N = Integer.parseInt(in.next());
if (N == 0) break;
List<String> wordList = new ArrayList<String>... | Main.java:54: error: cannot find symbol
new Main.run();
^
symbol: class run
location: class Main
1 error
|
s468352108 | p00225 | Java |
import java.io.*;
import java.util.*;
// 2011/10/19
//@0225 ±Ô½Ê«Â˱
public class Main {
// 檶Æö¶Ìªêv
// ·×ĪÂȪÁÄ¢éÅOK
// C return falseŨµÜ¢
boolean main() throws IOException {
int N = readIntArray()[0];
if (N == 0)
return false; // ¨µÜ¢
L... | Main.java:76: error: cannot find symbol
System.out.printf("%s\n", dame ? "NG" : "OK");
^
symbol: variable dame
location: class Main
1 error
|
s591530893 | p00225 | C | #define M 26
P[M],A[M],B[M];
int R(a){return P[a]==a?a:(P[a]=R(P[a]));}
char s[99];main(k,l,x,y){for(;scanf("%d",&l),l;puts(k<M?"NG":"OK")){
for(k=0;k<M;k++)A[k]=B[k]=0,P[k]=k;
for(k=0;k<l;k++)scanf("%s",s),x=*s-97,y=s[strlen(s)-1]-97,A[x]++,B[y]++,P[R(x)]=R(y);
for(d=k=0;k<M;k++){if(abs(A[k]-B[k])||((A[k]|B[k])&&R(... | main.c:2:1: warning: data definition has no type or storage class
2 | P[M],A[M],B[M];
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'P' [-Wimplicit-int]
main.c:2:6: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
2 | P[M],A[M],B[M];
| ^
main.c:2:11: error:... |
s084940434 | p00225 | C++ | #include <iostream>
#include <string>
#include <utility>
#include <stack>
using namespace std;
bool check(pair<char,char>* words, int num);
int main() {
int num;
char buf[33];
pair<char,char> words[10000];
while(true) {
cin >> num;
if(!num)
break;
for(int i=0; i<num; i++) {
cin >> bu... | a.cc: In function 'int main()':
a.cc:22:29: error: 'strlen' was not declared in this scope
22 | words[i].second = buf[strlen(buf)-1];
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <s... |
s923278617 | p00225 | C++ | #include <iostream>
#include <string>
#include <stack>
using namespace std;
bool check(pair<char,char>* words, int num);
int main() {
int num;
char buf[33];
pair<char,char> words[10000];
while(true) {
cin >> num;
if(!num)
break;
for(int i=0; i<num; i++) {
cin >> buf;
words[i].f... | a.cc: In function 'int main()':
a.cc:21:34: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
21 | words[i].second = buf[std::strlen(buf)-1];
| ^~~~~~
| mbrlen
|
s357816086 | p00225 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<map>
#include<list>
#include<cctype>
#include<climits>
#include<bitset>
using namespace std;
#define int long long
int N;
vector<int> e[26];
int graphSize;
int CountVertex(int v, bool isUsed[26])
{
if ... | a.cc: In function 'int main()':
a.cc:55:51: error: expected unqualified-id before '[' token
55 | int a = s[0] - 'a', b = s.[s.size() - 1] - 'a';
| ^
|
s789303690 | p00225 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
string S[10000]; int x, n; char T[10000][2];
//Class.
vector<int> list[100000];
int N, M, E, P;
int match[100000];
bool used[100000];
int x[100000], y[100000];
bool DFS(int V) {
used[V] = true;
for (int i = 0; i < list[V].size(); i++) {
int... | a.cc:12:5: error: conflicting declaration 'int x [100000]'
12 | int x[100000], y[100000];
| ^
a.cc:5:22: note: previous declaration as 'int x'
5 | string S[10000]; int x, n; char T[10000][2];
| ^
a.cc: In function 'int supermatching()':
a.cc:29:9: error: 'memset' was not decl... |
s283183790 | p00225 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
string S[10000]; int n; char T[10000][2];
//Class.
vector<int> list[100000];
int N, M, E, P;
int match[100000];
bool used[100000];
int x[100000], y[100000];
bool DFS(int V) {
used[V] = true;
for (int i = 0; i < list[V].size(); i++) {
int u ... | a.cc: In function 'int supermatching()':
a.cc:29:9: error: 'memset' was not declared in this scope
29 | memset(match, -1, sizeof(match));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<vector>
+++ |+... |
s062167756 | p00225 | C++ | #include<iostream>
#include<string>
#include<map>
using namespace std;
int n, flag; string S, U;
map<string, int>M;
int backtruck(string T, int a) {
if (a == n - 1) {
if (T[1] == U[0]) { flag = 1; }
}
if (flag == 1) { return; }
for (map<string, int>::iterator it = M.begin(); it != M.end(); it++) {
if (T[1] == (... | a.cc: In function 'int backtruck(std::string, int)':
a.cc:11:26: error: return-statement with no value, in function returning 'int' [-fpermissive]
11 | if (flag == 1) { return; }
| ^~~~~~
a.cc:19:1: warning: control reaches end of non-void function [-Wreturn-type]
19 | }
... |
s074741579 | p00225 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
template<int MV> class DirectedEulerPath {
public:
vector<int> path;
multiset<int> E[MV];
void add_path(int x, int y) { E[x].insert(y); }
void dfs(int cur) {
while (E[cur].size()) {
int tar = *E[cur].begin();
E[cur].erase... | a.cc: In member function 'bool DirectedEulerPath<MV>::GetPath(int)':
a.cc:37:64: error: expected primary-expression before 'break'
37 | rep(i, 0, MV) if (deg[i] == 1) dfs(i), break;
| ^~~~~
a.cc:37:64: error: expected ';' be... |
s987875043 | p00225 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef pair<char, char>P;
vector<int>E[10000];
bool used[10000];
int in[10000], out[10000;
void dfs(int u) {
used[u] = true;
for (int v : E[u]) {
if (!used[v])dfs(v);
}
}
int main() {
int n;
while (scanf("%d", &n), n) {
vect... | a.cc:8:25: error: expected ']' before ';' token
8 | int in[10000], out[10000;
| ^
| ]
a.cc: In function 'int main()':
a.cc:22:24: error: 'out' was not declared in this scope
22 | memset(out, 0, sizeof(out));
| ... |
s955012803 | p00225 | C++ | #include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#de... | a.cc: In function 'int main()':
a.cc:33:27: error: 'c' was not declared in this scope
33 | ++c[gomi[0] - 'a'];
| ^
a.cc:38:28: error: 'c' was not declared in this scope
38 | if(c[i] != d[i]) {
| ^
a.cc... |
s627489238 | p00225 | C++ | #include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#de... | a.cc: In function 'int main()':
a.cc:38:36: error: 'd' was not declared in this scope
38 | if(s[i] != d[i]) {
| ^
|
s550621465 | p00225 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <complex>
#include <cctype>
#include <cassert>
#include <sstream>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include ... | a.cc:115:46: error: redefinition of 'template<class A, class B> bool chmax(A&, B)'
115 | template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
| ^~~~~
a.cc:28:46: note: 'template<class A, class B> bool chmax(A&, B)' p... |
s346139071 | p00225 | C++ | #include<iostream>
#include<string>
#include<vector>
char str[10000][32];
int n;
char first;
bool isFst = 1;
//øÌ¶©çnÜéPêð`FbN
int isUsed[10000] = {0};
int check(char str[], int num);
using namespace std;
int main()
{
for(;;){
int ok = 0;
scanf("%d",&n);
if(n == 0){
break;
}
for(i... | a.cc: In function 'int check(char*, int)':
a.cc:68:21: error: 'strlen' was not declared in this scope
68 | char ch = s[strlen(s+1)];
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<vector>
... |
s874376137 | p00225 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<cstdlib>
char str[10000][32];
int n;
char first;
bool isFst = 1;
//øÌ¶©çnÜéPêð`FbN
int isUsed[10000] = {0};
int check(char str[], int num);
using namespace std;
int main()
{
for(;;){
int ok = 0;
scanf("%d",&n);
if(n == 0){
... | a.cc: In function 'int check(char*, int)':
a.cc:69:21: error: 'strlen' was not declared in this scope
69 | char ch = s[strlen(s+1)];
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include<cstdlib>
... |
s347999136 | p00225 | C++ | #include <iostream>
#include <string>
#include <queue>
using namespace std;
int table[26][26];
int main(){
while(true){
int n;
cin >> n;
if(n == 0){ break; }
memset(table, 0, sizeof(table));
for(int i = 0; i < n; ++i){
... | a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
14 | memset(table, 0, sizeof(table));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
... |
s253703935 | p00225 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();... | a.cc: In function 'int main()':
a.cc:26:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'siz'; did you mean 'size'?
26 | num[s[s.siz()-1]-'a']--;
| ^~~
| size
|
s316670339 | p00225 | C++ | #include<iostream>
#include<string.h>
int n;
char** s;
bool* f;
int count1,count2;
char* a;
bool solve(){
a = s[0];
count = 0;
while(true){
count1 = 1;
count2++;
for(int i=1; i<n; i++){
if(f[i]){
count1++;
if(count1 == n && a[1] == s[0][0])
return true;
continue;
}
if(a[1] == s[i][0... | a.cc: In function 'bool solve()':
a.cc:12:9: error: 'count' was not declared in this scope; did you mean 'count2'?
12 | count = 0;
| ^~~~~
| count2
|
s433048373 | p00225 | C++ | #include<iostream>
//#include<map>
using namespace std;
//map<bool*,bool> memo;
int n;
char *f,*l;
string tmp;
bool *tf;
bool DFU(char s, int c){
if(c == 0){
if(s == f[0])
return true;
else
return false;
}
for(int i=1; i<n; i++){
if(tf[i])
continue;
if(f[i] == s){
tf[i] = true;
// if(memo[tf... | a.cc: In function 'int main()':
a.cc:58:17: error: 'memo' was not declared in this scope
58 | memo.clear();
| ^~~~
a.cc: In function 'bool DFU(char, int)':
a.cc:35:1: warning: control reaches end of non-void function [-Wreturn-type]
35 | }
| ^
|
s827239520 | p00225 | C++ | #include<cstdio>
using namespace std;
bool visit[26],g[26][26];
bool dfs(int v){
visit[v] = true;
bool f = false;
for(int i=0;i<26;i++)
if(g[v][i]){
f = true;
if(!visit[i])dfs(i);
}
return f;
}
int graph_num(void){
int res = 0;
for(int i=0;i<26;i++)
if(!visit[i] && dfs(i))res++;
... | a.cc: In function 'int main()':
a.cc:37:17: error: 'strlen' was not declared in this scope
37 | int len = strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstri... |
s941114195 | p00225 | C++ | #include <iostream>
#include <set>
#include <string>
using namespace std;
int t[26][26];
//m[hid©ç¢ÂÌm[hÉÚ®Â\©
//·ÅÉTõÏÝÌm[hÍÊçÈ¢
int reachableNode(int id,bool *used){
int res = 1;
used[id] = true;
for(int i=0;i<26;i++){
if(t[id][i] > 0 && !used[i]){
res += reachabl... | a.cc: In function 'int main()':
a.cc:31:5: error: 'memset' was not declared in this scope
31 | memset(t,0,sizeof(t));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <set>
+++ |+#include <cstring>
3 | #in... |
s161537662 | p00225 | C++ | #include <iostream>
#include <cstdlib>
#include <set>
#include <string>
using namespace std;
int t[26][26];
//m[hid©ç¢ÂÌm[hÉÚ®Â\©
//·ÅÉTõÏÝÌm[hÍÊçÈ¢
int reachableNode(int id,bool *used){
int res = 1;
used[id] = true;
for(int i=0;i<26;i++){
if(t[id][i] > 0 && !used[i]){
... | a.cc: In function 'int main()':
a.cc:32:5: error: 'memset' was not declared in this scope
32 | memset(t,0,sizeof(t));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <set>
+++ |+#include <cstring>
4 | #in... |
s653134894 | p00225 | C++ | #include <iostream>
#include <set>
#include <string>
using namespace std;
int t[26][26];
//ノードidからいくつのノードに移動可能か
//すでに探索済みのノードは通らない
int reachableNode(int id,bool *used){
int res = 1;
used[id] = true;
for(int i=0;i<26;i++){
if(t[id][i] > 0 && !used[i]){
res += reachableNode(i,used);
}
}
return... | a.cc: In function 'int main()':
a.cc:31:5: error: 'memset' was not declared in this scope
31 | memset(t,0,sizeof(t));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <set>
+++ |+#include <cstring>
3 | #in... |
s392590365 | p00225 | C++ | 5
apple
yellow
georgia
king
email
7
apple
yellow
georgia
king
email
wink
lucky
0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5
| ^
|
s404478929 | p00225 | C++ | import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
label:for(;;){
int N=cin.nextInt();
if(N==0)break;
int[] node=new int[27];
int[][] edge=new int[27][27]... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
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.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s037656145 | p00225 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<map>
#include<stack>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<sstream>
#define reps(i,f,n) for(int i = f; i < int(n); i++)
#define rep(i,n) reps(i,0,n)
using namespace std;
int in[3... | a.cc: In function 'int main()':
a.cc:83:19: error: request for member 'clear' in 'x', which is of non-class type 'std::vector<int> [32]'
83 | x.clear();
| ^~~~~
|
s333962106 | p00225 | C++ | include<cstdio>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<map>
#include<stack>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<sstream>
#define reps(i,f,n) for(int i = f; i < int(n); i++)
#define rep(i,n) reps(i,0,n)
using namespace std;
int in[32];
int main(v... | a.cc:1:1: error: 'include' does not name a type
1 | include<cstdio>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 ... |
s019398614 | p00226 | C | #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a|b){
int c[50]={},z=0,x=0;
for(int i=0;i<4;i++){
if(a%10==b%10)z++;
c[a%10] |= 1;c[b%10] |= 2;
a/=10; b/=10;
}
for(int i=0;i<10;i++){
if(c[i]==3)x++;
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s471971483 | p00226 | C | #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a|b){
int c[10]={},z=0,x=0;
for(int i=0;i<4;i++){
if(a%10==b%10)z++;
c[a%10] |= 1;c[b%10] |= 2;
a/=10; b/=10;
}
for(int i=0;i<10;i++){
if(c[i]==3)x++;
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s751695139 | p00226 | C | #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a|b){
int c[10]={},z=0,x=0;
for(int i=0;i<4;i++){
if(a%10==b%10)z++;
c[a%10]/= 1;c[b%10] |= 2;
a/=10;b/=10;
}
for(int i=0;i<10;i++){
if(c[i]==3)x++;
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s668448371 | p00226 | C | #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a|b){
int c[10]={},d=0,f=0;
for(int i=0;i<4;i++){
if(a%10==b%10)d++;
c[a%10] |=1;
c[b%10] |=2;
a/=10;
b/=10;
}
for(int i=0;i<10;i++){if(c[i]=... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s606731116 | p00226 | C | #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a|b){
int c[10]={},d=0,f=0;
for(int i=0;i<4;i++){
if(a%10==b%10)d++;
c[a%10] |=1;
c[b%10] |=2;
a/=10;
b/=10;
}
for(int i=0;i<10;i++){
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s423118255 | p00226 | C | #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a|b){
int c[10]={},d=0,f=0;
for(int i=0;i<4;i++){
if(a%10==b%10)d++;
c[a%10] |= 1;
c[b%10] |= 2;
a/=10;
b/=10;
}
for(int i=0;i<10;i++){
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s657757038 | p00226 | C | #include<stdio.h> #include<string.h> int main(){char x[6],a[6];int h,b,i,j;while(scanf("%s%s",x,a)!=EOF){if(strcmp(x,"0")==0 && strcmp(a,"0")==0)break;h=b=0;for(i=0;i<4;i++){if(x[i]==a[i])h++;for(j=0;j<4;j++){if(j!=i && x[i]==a[j])b++;}}printf("%d %d\n",h,b);}return 0;} | main.c:1:19: warning: extra tokens at end of #include directive
1 | #include<stdio.h> #include<string.h> int main(){char x[6],a[6];int h,b,i,j;while(scanf("%s%s",x,a)!=EOF){if(strcmp(x,"0")==0 && strcmp(a,"0")==0)break;h=b=0;for(i=0;i<4;i++){if(x[i]==a[i])h++;for(j=0;j<4;j++){if(j!=i && x[i]==a[j])b++;}}printf("%d ... |
s737987932 | p00226 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
while(;;){
int a,b;
cin >> a >> b;
if(a==0&&b==0)return 0;
int x[4],y[4];
for(int i=0;i<4;i++){
x[i]=a%10;
a/=10;
y[i]=b%10;
b/=10;
}
int hit=0,blow=0;
for(int i=0;i<4;i++)if(x[i]==y[i])hit++;
}
for(int i=0;i<4;i++){
for(int j=0;j<4;j++)if(x[i]==y[j... | a.cc: In function 'int main()':
a.cc:6:7: error: expected primary-expression before ';' token
6 | while(;;){
| ^
a.cc:6:7: error: expected ')' before ';' token
6 | while(;;){
| ~^
| )
a.cc:6:9: error: expected primary-expression before ')' token
6 | while(;;){
| ... |
s006011586 | p00226 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
while(;;){
int a,b;
cin >> a >> b;
if(a==0&&b==0)return 0;
int x[4],y[4];
for(int i=0;i<4;i++){
x[i]=a%10;
a/=10;
y[i]=b%10;
b/=10;
}
int hit=0,blow=0;
for(int i=0;i<4;i++)if(x[i]==y[i])hit++;
for(int i=0;i<4;i++){
for(int j=0;j<4;j++)if(x[i]==y[j]... | a.cc: In function 'int main()':
a.cc:6:7: error: expected primary-expression before ';' token
6 | while(;;){
| ^
a.cc:6:7: error: expected ')' before ';' token
6 | while(;;){
| ~^
| )
a.cc:6:9: error: expected primary-expression before ')' token
6 | while(;;){
| ... |
s570143378 | p00226 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
while(;;){
int a,b;
cin >> a >> b;
if(a==0&&b==0)return 0;
int x[4],y[4];
for(int i=0;i<4;i++){
x[i]=a%10;
a/=10;
y[i]=b%10;
b/=10;
}
int hit=0,blow=0;
for(int i=0;i<4;i++)if(x[i]==y[i])hit++;
for(int i=0;i<4;i++){
for(int j=0;j<4;j++)if(x[i]==y[j]... | a.cc: In function 'int main()':
a.cc:6:7: error: expected primary-expression before ';' token
6 | while(;;){
| ^
a.cc:6:7: error: expected ')' before ';' token
6 | while(;;){
| ~^
| )
a.cc:6:9: error: expected primary-expression before ')' token
6 | while(;;){
| ... |
s621088550 | p00226 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
while(){
int a,b;
cin >> a >> b;
if(a==0&&b==0)return 0;
int x[4],y[4];
for(int i=0;i<4;i++){
x[i]=a%10;
a/=10;
y[i]=b%10;
b/=10;
}
int hit=0,blow=0;
for(int i=0;i<4;i++)if(x[i]==y[i])hit++;
for(int i=0;i<4;i++){
for(int j=0;j<4;j++)if(x[i]==y[j])b... | a.cc: In function 'int main()':
a.cc:6:7: error: expected primary-expression before ')' token
6 | while(){
| ^
|
s743389405 | p00226 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int hit,brow;
char a[5],b[5];
for(;;){
hit=0,brow=0;
cin>>a>>b;
if(a[0]=='0'&&b[0]=='0')break;
for(int i=0;i<3;i++){
for(int j=i+1;j<4;j++){
if(a[i]==b[j]||b[i... | a.cc: In function 'int main()':
a.cc:21:6: error: expected '}' at end of input
21 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s860815991 | p00226 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int hit,brow;
char a[5],b[5];
for(;;){
hit=0,brow=0;
cin>>a>>b;
if(a[0]=='0'&&a[1]=='\0')break;
for(int i=0;i<3;i++){
for(int j=i+1;j<4;j++){
if(a[i]==b[j]||b[... | a.cc: In function 'int main()':
a.cc:21:6: error: expected '}' at end of input
21 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s138803076 | p00226 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
//char a[10],b[10];
string a,b;
while(true){
cin>>a>>b;
if(/*strcmp(a,"0")==0&&strcmp(b,"0")==0*/a==0&&b==0)break;
int x=0,y=0;
for(int i=0;i<4;i++){
for(int j=0;j<4;j++){
if(i<j)continue;
if(a[i]==b[j]){
if(i==j)x++;
else y++;
... | a.cc: In function 'int main()':
a.cc:9:51: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
9 | if(/*strcmp(a,"0")==0&&strcmp(b,"0")==0*/a==0&&b==0)break;
| ~^~~
| ... |
s014968164 | p00226 | C++ | #include<iostream>
int main(){
int a[4],b[4],i,j,H,B;
while(std::cin>>a[0]){
for(i=0;i<4;i++){
std::cin>>a[i];
}
for(j=0;j<4;j++){
std::cin>>b[j];
}
H=0;
B=0;
for(i=0;i<4;i++){
for(j=0;j<4;j++){
if(a[i]==b[j]){
if(i==j){
H++;
}
else(){
B++;
}
}
}
}
... | a.cc: In function 'int main()':
a.cc:20:46: error: expected primary-expression before ')' token
20 | else(){
| ^
|
s991304379 | p00226 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#de... | a.cc: In function 'int main()':
a.cc:51:34: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'vi' {aka 'std::vector<int>'})
51 | cout << b << " " << e << endl;
| ~~~~~~~~~~~~~~~~ ^~ ~
| | |
| ... |
s523542707 | p00226 | C++ | #include<iostream>
#include<string>
using namespace std;
string S, T, U; int a[4], b[4], h, v;
int main() {
while (cin >> S >> T) {
h = 0; b = 0;
if (S == "0") { break; }
for (int i = 0; i < 4; i++) {
U = S[i] + '0';
a[i] = stoi(U) / 10;
}
for (int i = 0; i < 4; i++) {
U = T[i] + '0';
b[i] = stoi... | a.cc: In function 'int main()':
a.cc:7:26: error: incompatible types in assignment of 'int' to 'int [4]'
7 | h = 0; b = 0;
| ~~^~~
|
s329181408 | p00226 | C++ | #include<iostream>
#include<string>
using namespace std;
string S, T, U; int a[4], b[4], h, v;
int main() {
while (cin >> S >> T) {
h = 0; b = 0;
if (S == "0") { break; }
for (int i = 0; i < 4; i++) {
U = S[i] + '0';
a[i] = stoi(U) / 10;
}
for (int i = 0; i < 4; i++) {
U = T[i] + '0';
b[i] = stoi... | a.cc: In function 'int main()':
a.cc:7:26: error: incompatible types in assignment of 'int' to 'int [4]'
7 | h = 0; b = 0;
| ~~^~~
|
s081969908 | p00226 | C++ | #include <stdio.h>
#include <algorithm>
#pragma warning(disable : 4996)
using namespace std;
char a[4], b[4]; int hit, blow;
int main() {
while (true) {
scanf("%s %s", a, b);
if (strlen(a) == 1 && strlen(b) == 1) break;
hit = 0; blow = 0;
for (int i = 0; i < 4; i++) {
if (a[i] == b[i]) hit++;
for (int j... | a.cc: In function 'int main()':
a.cc:9:21: error: 'strlen' was not declared in this scope
9 | if (strlen(a) == 1 && strlen(b) == 1) break;
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #in... |
s010294745 | p00226 | C++ | #include<iostream>
using namespace std;
int main(){
char qwe[6],ans[6];
int hit,blow,count;
cin >> qwe >> ans;
while(hit == 4){
hit = 0 ;
blow = 0;
for(int i=0; i<4; i++){
for(int g=0; g<4; g++){
if(qwe[i] == ans[g]){
if(i == g)
... | a.cc: In function 'int main()':
a.cc:31:11: error: expected ';' before '}' token
31 | count++
| ^
| ;
32 | }
| ~
|
s150402875 | p00226 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main(){
int length = 4
char[length+1] taroNomber;
char[length+1] hanakoNomber;
int hitCount = 0;
int blowCount = 0;
while(true){
cin >> taroNomber;
cin >> hanakoNomber;
hitCount = 0;
blowCount = 0;
if(strlen(taroNomber)==1){
break;
}
... | a.cc: In function 'int main()':
a.cc:7:9: error: expected ',' or ';' before 'char'
7 | char[length+1] taroNomber;
| ^~~~
a.cc:8:20: error: expected ']' before '+' token
8 | char[length+1] hanakoNomber;
| ^
| ]
a.cc:8:13: error: stru... |
s721774034 | p00226 | C++ | #include<iostream>
#include<cstring>
using namespace std;
int hit(char* s1,char* s2){
int n=0;
for(int i=0;i<4);i++){
if(s1[i]==s2[i]){
n++:
}
}
return n;
}
int blow(char* s1,char* s2){
int n=0;
for(int i=0;i<4;i++){
if(s1[i]==s2[0]){
n++:
}
if(s1[i]==s2[1]){
n++:
}
if(s1[i]==s2[2]){
n++:
... | a.cc: In function 'int hit(char*, char*)':
a.cc:7:24: error: expected ';' before ')' token
7 | for(int i=0;i<4);i++){
| ^
| ;
a.cc:7:26: error: 'i' was not declared in this scope
7 | for(int i=0;i<4);i++){
| ... |
s117325214 | p00226 | C++ | #include<iostream>
#include<cstring>
using namespace std;
int main()
{
while{
char stra[10], strb[10];
int hit,bro;
cin>>stra>>strb;
for(int i=0;i<4;i++){
if(stra[i]==strb[i]){
hit++;}
for(int j=0;j<4;j++){
if(stra[i]==strb[j])
bro++;}
}
if(stra==0&&strb==0){break;}
bro=bro-hit;
cout<<hit<<' '<<bro<<'\n'... | a.cc: In function 'int main()':
a.cc:7:6: error: expected '(' before '{' token
7 | while{
| ^
| (
a.cc:7:6: error: expected primary-expression before '{' token
a.cc:7:6: error: expected ')' before '{' token
7 | while{
| ^
| )
|
s598516310 | p00226 | C++ | #include<string>
using namespace std;
int main(){
while(1){
string stra,strb;
cin>>stra>>strb;
int h=0,b=0;
if((stra=="0")&&(strb=="0")){
break;}
for(int i=0;i<4;i++){
if(stra[i]==strb[i]){
h++;
}
for(int j=0;j<4;j++){
if(stra[i]==strb[j]){
b++;
}
}
}
b=b-h;
cout<<h<<' '<<b<<'\n';
}
r... | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin>>stra>>strb;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<string>
+++ |+#include <iostream>
2 | u... |
s746492326 | p00226 | C++ | #include<string>
using namespace std;
int main(){
while(1){
string stra,strb;
cin>>stra>>strb;
int h=0,b=0;
if((stra=="0")&&(strb=="0")){
break;}
for(int i=0;i<4;i++){
if(stra[i]==strb[i]){
h++;
}
for(int j=0;j<4;j++){
if(stra[i]==strb[j]){
b++;
}
}
}
b=b-h;
cout<<h<<' '<<b<<'\n';
}
r... | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin>>stra>>strb;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<string>
+++ |+#include <iostream>
2 | u... |
s898465827 | p00226 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
char buf[10];
int main() {
int a[4], b[4];
while (gets(buf), strcmp(buf, "0 0")) {
char*s = buf;
rep(i, 4) { sscanf(s, "%1d", &a[i]); s += 1; }s += 1;
rep(i, 4) { sscanf(s, "%1d", &b[i]); s += 1; }
int hit = 0, blow = 0;
rep(... | a.cc: In function 'int main()':
a.cc:8:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | while (gets(buf), strcmp(buf, "0 0")) {
| ^~~~
| getw
|
s032903235 | p00226 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
char buf[10];
int main() {
int a[4], b[4];
while (gets_s(buf), strcmp(buf, "0 0")) {
char*s = buf;
rep(i, 4) { sscanf(s, "%1d", &a[i]); s += 1; }s += 1;
rep(i, 4) { sscanf(s, "%1d", &b[i]); s += 1; }
int hit = 0, blow = 0;
re... | a.cc: In function 'int main()':
a.cc:8:16: error: 'gets_s' was not declared in this scope; did you mean 'getsid'?
8 | while (gets_s(buf), strcmp(buf, "0 0")) {
| ^~~~~~
| getsid
|
s817025758 | p00226 | C++ | <?php
for( $loop_cnt = 0;12000 > $loop_cnt; $loop_cnt++ )
{
$input = explode(" ", trim(fgets(STDIN)));
if( 0 == $input[0] &&
0 == $input[1]
)
{
break;
}
$r = str_split($input[0]);
$a = str_split($input[1]);
$hit = 0;
$brow = 0;
$loop_r = 0;
foreach( $r as $r_char )
{
$loop_a = 0... | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:2:28: error: expected unqualified-id before numeric constant
2 | for( $loop_cnt = 0;12000 > $loop_cnt; $loop_cnt++ )
| ^~~~~
a.cc:2:47: error: '$loop_cnt' does not name a type
2 | ... |
s033652518 | p00226 | C++ | <?php
for( $loop_cnt = 0;12000 > $loop_cnt; $loop_cnt++ )
{
$input = explode(" ", trim(fgets(STDIN)));
if( 0 == $input[0] &&
0 == $input[1]
)
{
break;
}
$r = str_split($input[0]);
$a = str_split($input[1]);
$hit = 0;
$brow = 0;
$loop_r = 0;
foreach( $r as $r_char )
{
$loop_a = 0... | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:2:28: error: expected unqualified-id before numeric constant
2 | for( $loop_cnt = 0;12000 > $loop_cnt; $loop_cnt++ )
| ^~~~~
a.cc:2:47: error: '$loop_cnt' does not name a type
2 | ... |
s651041115 | p00226 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string r, a;
while(cin >> r >> a , r || a){
int hit = 0, blow = 0;
for(int i=0; i < 4; i++){
for(int j=0; j<4; j++){
if(r[i] == a[j]){
if(i == j){
hit++;
... | a.cc: In function 'int main()':
a.cc:7:33: error: no match for 'operator||' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
7 | while(cin >> r >> a , r || a){
| ~ ^~ ~
| ... |
s047245100 | p00226 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string r, a;
while(cin >> r >> a, ans=="0" && forecast=="0"){
int hit = 0, blow = 0;
for(int i=0; i < 4; i++){
for(int j=0; j<4; j++){
if(r[i] == a[j]){
if(i == j){
hit+... | a.cc: In function 'int main()':
a.cc:7:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
7 | while(cin >> r >> a, ans=="0" && forecast=="0"){
| ^~~
| abs
a.cc:7:42: error: 'forecast' was not declared in this scope
7... |
s111498310 | p00226 | C++ | char a[17]="0 0";main(i,j){for(;a[2]=*a=48,scanf("%[^\n]\n",a+5),a[8];puts(a)){for(i=4;++i<9;)for(j=4;++j<9;)a[j+5]-a[i]||a[(i!=j)*2]++;}i=0;} | a.cc:1:22: error: expected constructor, destructor, or type conversion before '(' token
1 | char a[17]="0 0";main(i,j){for(;a[2]=*a=48,scanf("%[^\n]\n",a+5),a[8];puts(a)){for(i=4;++i<9;)for(j=4;++j<9;)a[j+5]-a[i]||a[(i!=j)*2]++;}i=0;}
| ^
|
s006082981 | p00226 | C++ | #include<iostream>
int main(){
while(1){
int a,b;
std::cin>>a>>b;
if(a==0&&b==0)break;
std::vector<int> vec(4);
std::vector<int> vec2(4);
int n=1000;
for(int i=0;i<4;i++){
int x=a/n;
int y=b/n;
vec[i]=x;
vec2[i]=y;
x*=n;
y*=n;
a-=x;
b-=y;
n/=10;
}
int c=0,d=0;
for(int i=... | a.cc: In function 'int main()':
a.cc:7:22: error: 'vector' is not a member of 'std'
7 | std::vector<int> vec(4);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ ... |
s174099973 | p00226 | C++ | #include<iostream>
int main(){
while(1){
int a,b;
std::cin>>a>>b;
if(a==0&&b==0)break;
std::vector<int> vec(4);
std::vector<int> vec2(4);
int n=1000;
for(int i=0;i<4;i++){
int x=a/n;
int y=b/n;
vec[i]=x;
vec2[i]=y;
x*=n;
y*=n;
a-=x;
b-=y;
n/=10;
}
int c=0,d=0;
for(int i=... | a.cc: In function 'int main()':
a.cc:7:22: error: 'vector' is not a member of 'std'
7 | std::vector<int> vec(4);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ ... |
s555113862 | p00226 | C++ | #include<stdio.h>
void main(){
int i,j,hit,blow;
int a,b,d;
int aa[4],bb[4];
while(1){
d=1000;
hit=0;
blow=0;
scanf("%d %d",&a,&b);
if(a==0 && b==0) break;
for(i=0;i<4;i++){
aa[i]=a/d;
a=a%d;
bb[i]=b/d;
b=b%d;
d=d/10;
}
for(i=0;i<4;i++){
if(aa[i]==bb[i]) hit++;
for(j=0;j<4;j++)... | a.cc:2:1: error: '::main' must return 'int'
2 | void main(){
| ^~~~
|
s364704148 | p00227 | Java | import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Thanksgiving {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while(s.hasNextLine()) {
int purchaceCnt = s.nextInt();
int canPackCnt = s.nextInt();
s.nextLine();
String[] value... | Main.java:6: error: class Thanksgiving is public, should be declared in a file named Thanksgiving.java
public class Thanksgiving {
^
Main.java:17: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
value[i] = new Integer(values[i]);
^
1 error
1 warning
|
s981526164 | p00227 | Java | import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Thanksgiving {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while(s.hasNextLine()) {
int purchaceCnt = s.nextInt();
int canPackCnt = s.nextInt();
s.nextLine();
String[] value... | Main.java:6: error: class Thanksgiving is public, should be declared in a file named Thanksgiving.java
public class Thanksgiving {
^
Main.java:17: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
value[i] = new Integer(values[i]);
^
1 error
1 warning
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.