submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s707086662 | p00242 | C++ | #include<string>
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
using namespace std;
int main()
{
for(;;){
int n;
vector<string> str;
char c_string[1000];
vector<string> find_moji;
string temp;
int sub_begin;
int cont;
char moji;
bool cont_flg = false;
i... | a.cc: In function 'int main()':
a.cc:37:25: error: 'gets' was not declared in this scope; did you mean 'getw'?
37 | gets(c_string);
| ^~~~
| getw
|
s545705766 | p00242 | C++ | #include <algorithm>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <functional>
#include <queue>
#include <string>
#include <map>
#include <vector>
using namespace std;
bool cmp(pair<string, int> a, pair<string, int> b) {
return a.second > b.second || (a.second == b.second && a.f... | a.cc: In function 'int main()':
a.cc:49:30: error: no matching function for call to 'min(std::vector<std::pair<std::__cxx11::basic_string<char>, int> >::size_type, unsigned int)'
49 | for (int i = 0; i < min(v.size(), 5u); i++)
| ~~~^~~~~~~~~~~~~~
In file included from /usr/incl... |
s231633416 | p00242 | C++ | #include <algorithm>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <functional>
#include <queue>
#include <string>
#include <map>
#include <vector>
using namespace std;
bool cmp(pair<string, int> a, pair<string, int> b) {
return a.second > b.second || (a.second == b.second && a.f... | a.cc: In function 'int main()':
a.cc:49:30: error: no matching function for call to 'min(std::vector<std::pair<std::__cxx11::basic_string<char>, int> >::size_type, int)'
49 | for (int i = 0; i < min(v.size(), 5); i++)
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/... |
s566256396 | p00242 | C++ | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using nam... | a.cc: In function 'int main()':
a.cc:55:35: error: no matching function for call to 'min(unsigned int, std::vector<std::pair<int, std::__cxx11::basic_string<char> > >::size_type)'
55 | rep(i, min(5u, a.size()))
| ~~~^~~~~~~~~~~~~~
a.cc:21:40: note: in defi... |
s519178422 | p00242 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <deque>
using namespace std;
int main(void)
{
int n,k;
char c;
string str,s;
map<string,int> words;
map<string,int>::iterator it;
deque< pair<string,int> > choice;
while(1){
cin >> n;
cin.ignore();
if(n==0) break;
for(int i=0... | a.cc: In function 'int main()':
a.cc:35:25: error: 'sort' was not declared in this scope; did you mean 'short'?
35 | sort(choice.begin(),choice.end());
| ^~~~
| short
|
s335592759 | p00242 | C++ | #include<iostream>
#include<algorithm>
#include<iterator>
#include<string>
#include<sstream>
#include<vector>
#include<map>
using namespace std;
struct pard {
bool operator()(const pair<string, int>& _Left, const pair<string, int>& _Right) {
return _Left.second != _Right.second ? _Left.second > _Right.second : _Le... | a.cc: In function 'int main()':
a.cc:23:28: error: 'numeric_limits' was not declared in this scope
23 | cin.ignore(numeric_limits<streamsize>::max(), '\n');
| ^~~~~~~~~~~~~~
a.cc:23:53: error: expected primary-expression before '>' token
23 | cin.ig... |
s984861120 | p00242 | C++ | #include <bits/stdc++.h>
#include <map>
using namespace std;
int main(){
int n;
while(cin >> n, n){
cin.ignore();
map<string, int> dic;
for(int i=0; i < n; i++){
string s;
getline(cin, s);
s += " ";
while(s.size() != 0){
st... | a.cc: In function 'int main()':
a.cc:37:21: error: expected '}' at end of input
37 | dic.clear();
| ^
a.cc:7:23: note: to match this '{'
7 | while(cin >> n, n){
| ^
a.cc:37:21: error: expected '}' at end of input
37 | dic.clear();
... |
s553726799 | p00243 | Java |
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class Main {
int INF = 1 << 28;
int w, h;
int min;
// char[][] p;
void run() {
Scanner sc = new Scanner(System.in);
for(;;) {
w = sc.nextInt();
h = sc.nextInt();
if( (w|h) == 0 ) break;
p = new cha... | Main.java:20: error: cannot find symbol
p = new char[h+2][w+2];
^
symbol: variable p
location: class Main
1 error
|
s202037485 | p00243 | C | #include <stdio.h>
#include <time.h>
char s[100];
int main(void){
int x, y;
char c;
for(; scanf("%d%d%c", &x, &y, &c);,y){
if( c != '\n' ){
clock_t c1 = clock() + CLOCKS_PER_SEC * 0.02 * c;
while( clock() < c1 );
return 0;
}
for( int i = 0; i < y; ++i ){
fgets( s, 50, stdin);
}
}
return 0;
... | main.c: In function 'main':
main.c:9:43: error: expected expression before ',' token
9 | for(; scanf("%d%d%c", &x, &y, &c);,y){
| ^
|
s118155191 | p00243 | C++ | #include<iostream>
#include<queue>
using namespace std;
struct Grid{
char g[11][11];
int cnt;
};
void draw(Grid& grid,char f,char c,int x,int y){
if(grid.g[x][y] != f){
return;
}
grid.g[x][y] = c;
draw(grid,f,c,x-1,y);
draw(grid,f,c,x+1,y);
draw(grid,f,c,x,y-1);
draw(grid,f,c,x,y+1);
}
int main(){
int x,y;
... | a.cc: In function 'int main()':
a.cc:38:22: error: 'start' was not declared in this scope
38 | cin >> start.g[j][i];
| ^~~~~
a.cc:42:17: error: 'start' was not declared in this scope
42 | char fc = start.g[0][0];
| ^~~~~
|
s814419627 | p00243 | C++ | #include<cstdio>
#include<algorithm>
#include<string>
#include<queue>
#define rep(i,a) for( int i = 0; i != (a); ++i )
const std::string RGB = "RGB";
int x, y;
short fld[10][10];
struct State
{
short st[10][10];
int cnt;
State( short fld[10][10], int cnt )
: cnt( cnt )
{
rep( i, y )
rep( j, x )
st[i][... | a.cc: In function 'int main()':
a.cc:88:41: error: 'memcpy' was not declared in this scope
88 | memcpy( fld, s.st, sizeof( fld ) );
| ^~~~~~
a.cc:5:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by add... |
s066350267 | p00243 | C++ | #include<bits/stdc++.h>
using namespace std;
const int dx[]={-1,0,1,0};
const int dy[]={0,-1,0,1};
int H,W;
int fld[10][10];
int lim;
bool change(int y,int x,int c,int f){
fld[y][x]=c;
for(int d=0;d<4;d++){
int ny=y+dy[d],nx=x+dx[d];
if(ny<0||ny>=H||nx<0||nx>=W||fld[ny][nx]!=f)continue;
... | a.cc: In function 'bool change(int, int, int, int)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
a.cc: In function 'bool dfs(int)':
a.cc:35:32: error: expected ';' before 'ret'
35 | change(0,0,k,fld[0][0])
| ^... |
s363584774 | p00243 | C++ | # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include ... | a.cc:23:10: warning: "M_PI" redefined
23 | # define M_PI 3.141592
| ^~~~
In file included from /usr/include/c++/14/cmath:47,
from a.cc:15:
/usr/include/math.h:1121:10: note: this is the location of the previous definition
1121 | # define M_PI 3.14159265358979323846 /* pi *... |
s599239211 | p00243 | C++ | #include <queue>
#include <vector>
#include <iostream>
using namespace std;
int H, W; char c;
int main() {
ios::sync_with_stdio(false);
while (cin >> W >> H, H | W) {
vector<vector<int> > a(H, vector<int>(W));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> c;
if (c == 'R') a[i][j] =... | a.cc: In function 'int main()':
a.cc:62:25: error: 'sort' was not declared in this scope; did you mean 'short'?
62 | sort(G[i].begin(), G[i].end());
| ^~~~
| short
a.cc:63:35: error: 'unique' was not declared in this scope
63 | ... |
s724568228 | p00243 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
using Mat = vector<vector<char>>;
constexpr char col[] = {'R', 'G', 'B'};
constexpr int MAX = 10;
constexpr int dx[] = {-1, 0, 1, 0};
constexpr int dy[] = {0, -1, 0, 1};
int W, H;
Mat M;
bool visited[MAX][MAX];
bool in_fie... | a.cc: In function 'Mat get_next(const Mat&, char)':
a.cc:44:5: error: 'memset' was not declared in this scope
44 | memset(visited, 0, sizeof(visited));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <map>
++... |
s074444681 | p00243 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
const int INF = 1 << 25;
int ans;
int b[10][10];
int W, H;
int dx[4] = { 1, 0, -1, 0 }, dy[4] = { 0, 1, 0, -1 };
bool in(int x, int y) {
return 0 <= x && x < W && 0 <= y && y < H;
}
void copy_board(int dst[10][10], ... | a.cc: In function 'void color(int (*)[10], int)':
a.cc:28:9: error: 'memset' was not declared in this scope
28 | memset(vis, 0, sizeof vis);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
+++... |
s834942211 | p00243 | C++ | // Filling Game
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
typedef pair<int,int> Pos;
#define NONE -1
struct Data{
  vector< vector<char> >panel;
  int depth;
  Data(){}
  Data(vector< vector<char> >v, int n){panel=v;depth=n;}
};
int h,w;
char color[3]={'R','G','B'}... | a.cc:12:2: error: stray '#' in program
12 |   vector< vector<char> >panel;
| ^
a.cc:13:2: error: stray '#' in program
13 |   int depth;
| ^
a.cc:14:2: error: stray '#' in program
14 |   Data(){}
| ^
a.cc:15:2: error: stray '#' in program
15 |   Data(vector< vector<ch... |
s570106201 | p00243 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <sstream>
#include <algorithm>
using namespace std;
char bt[10][10];
char ne[10][10];
bool dn[10][10];
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
int W,H;
void chg(int x,int y,char a,char b){
if(... | a.cc: In function 'int dfs(int)':
a.cc:52:9: error: 'memcpy' was not declared in this scope
52 | memcpy(prev,dn,sizeof(dn));
| ^~~~~~
a.cc:8:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <sstream>
+++ |+#include <c... |
s698126282 | p00243 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <algorithm>
using namespace std;
char bt[10][10];
char ne[10][10];
bool dn[10][10];
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
int W,H;
int... | a.cc: In function 'int main()':
a.cc:28:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | ans = 1e7;
| ^~~
| abs
|
s571482954 | p00243 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;
typedef pair<int,int> P;
struct state{
char f[11][11];
int c,l;
state(){}
state(int c,int l):c(c),l(l){};
};
char in[11][11];
state ne;
bool used[11][11];
const int dx[4]={0,0,1,-1};
const in... | 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... |
s261522136 | p00243 | C++ | #include<algorithm>
#include<functional>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<climits>
#define al... | a.cc: In function 'void solve()':
a.cc:132:32: error: expected initializer before '.' token
132 | vector<int> vec.reserve(10);
| ^
a.cc:137:25: error: 'vec' was not declared in this scope
137 | vec.pb(change(c));
| ... |
s580901323 | p00243 | C++ | #include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
typedef pair<int, int> P;
struct State {
int turn;
char board[10][10];
};
int main() {
while(true) {
int X, Y;
cin >> X >> Y;
if(X == 0 && Y == 0) break;
char board[10][10];
for(int i = 0; i < ... | a.cc: In function 'int main()':
a.cc:30:5: error: 'memcpy' was not declared in this scope
30 | memcpy(S.board, board, sizeof(board));
| ^~~~~~
a.cc:5:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <queue>
+++ |+#include <cs... |
s202250314 | p00243 | C++ | #include<iostream>
#include<memory>
int field_x, field_y;
int start;
int color;
int res = 10;
bool check(int field[10][10]){
int r = 0, g = 0, b = 0;
for (int i = 0; i < field_y; i++){
for (int j = 0; j < field_x; j++){
field[i][j] == 0 ? r++ : field[i][j] == 1 ? g++ : b++;
}
}
int a = field_x*field_y;
... | a.cc: In function 'void calc(int (*)[10], int)':
a.cc:46:22: error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'?
46 | std::memcpy(copy_field, field, sizeof(copy_field));
| ^~~~~~
| wmemcpy
|
s380453241 | p00243 | C++ | #include<iostream>
#include<memory>
int field_x, field_y;
int start;
int color;
int res = 10;
bool check(int field[10][10]){
int r = 0, g = 0, b = 0;
for (int i = 0; i < field_y; i++){
for (int j = 0; j < field_x; j++){
field[i][j] == 0 ? r++ : field[i][j] == 1 ? g++ : b++;
}
}
int a = field_x*field_y;
... | a.cc: In function 'void calc(int (*)[10], int)':
a.cc:46:17: error: 'memcpy' was not declared in this scope
46 | memcpy(copy_field, field, sizeof(copy_field));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstri... |
s366819344 | p00244 | Java | #include<iostream>
#include<queue>
#include<vector>
#include<utility>
#include<functional>
using namespace std;
typedef pair<int, int> P;
struct Edge
{
int cost, to, f;
Edge(int c, int t){cost = c, to = t;}
};
int E, V, d[10000];
vector<Edge> edge[10000];
priority_queue<P, vector<P>, greater<P>> q;
int main()
{
... | Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<queue>
^
Main.java:3: error: illegal character: '#'
#include<vector>
^
Main.java:4: error: illegal character: '#'
#include<utility>
^
Main.java:5: error: illegal character: '#'
#include<functional>
^
Main... |
s542276912 | p00244 | C | #include <cstdio>
#include <cstring>
#include <vector>
#define MAX_N (100)
#define INF (100000000)
using namespace std;
typedef struct {
int to;
int cost;
} Edge;
vector<Edge> G[MAX_N];
int W[MAX_N][MAX_N];
int ans;
int n, m;
void getMin(int V, int cost, int left, bool used[MAX_N])
{
if (cost >= ans){
return... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s789288594 | p00244 | C++ | #include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cstring>#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cstring>
#include <climits>
#include <cmath>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
typede... | a.cc:5:19: warning: extra tokens at end of #include directive
5 | #include <cstring>#include <algorithm>
| ^
a.cc:72:8: error: redefinition of 'struct edge'
72 | struct edge { int v; ll w; };
| ^~~~
a.cc:18:8: note: previous definition of 'struct edge'
18 | struct edge { i... |
s745668693 | p00244 | C++ | #include<iostream>
#include<queue>
#include<vector>
#include<utility>
#include<functional>
using namespace std;
typedef pair<int, int> P;
struct Edge
{
int cost, to, f;
Edge(int c, int t){cost = c, to = t}
};
int E, V, d[1000];
vector<Edge> edge[1000];
int main()
{
loop:
for(int i = 0; i < 1000; i++)
edge[... | a.cc: In constructor 'Edge::Edge(int, int)':
a.cc:12:38: error: expected ';' before '}' token
12 | Edge(int c, int t){cost = c, to = t}
| ^
|
s548351473 | p00244 | C++ | #include<iostream>
#include<queue>
#include<vector>
#include<utility>
#include<functional>
using namespace std;
typedef pair<int, int> P;
struct Edge
{
int cost, to, f;
Edge(int c, int t){cost = c, to = t}
};
int E, V, d[1000];
vector<Edge> edge[1000];
int main()
{
loop:
for(int i = 0; i < 1000; i++)
edge[... | a.cc: In constructor 'Edge::Edge(int, int)':
a.cc:12:38: error: expected ';' before '}' token
12 | Edge(int c, int t){cost = c, to = t}
| ^
|
s749664137 | p00244 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int n,m,mm;
int a[302],b[302],c[302],mn[302];
int ans;
int slv();
int main(){
while(1){
cin>>n>>m;
if(n==0 && m==0)break;
mm=m;
ans=2000000;
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
memset(c,0,sizeof(c));
for(int i=2;i<=... | a.cc: In function 'int main()':
a.cc:15:5: error: 'memset' was not declared in this scope
15 | memset(a,0,sizeof(a));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#include <cstring>
3 ... |
s594932211 | p00244 | C++ | #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define NUM 2000000000
using namespace std;
int minimum,min_past_num,num_town,m,start,goal;
struct Info{
Info(){
current_town = 0;
index = 0;
pre_town =... | a.cc: In function 'int main()':
a.cc:157:18: error: no match for 'operator[]' (operand types are 'int [(num_town + 1)]' and '__gnu_cxx::__alloc_traits<std::allocator<Data>, Data>::value_type' {aka 'Data'})
157 | D[V[1][i]] = costTable[1][V[1][i]];
| ^
a.cc:157:42: error: no matc... |
s808191126 | p00244 | C++ | #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m,a,b,c,d[101][101];
bool t[101][101];
main(){
cin.tie(0);
sync_with_stdio(false);
while(cin>>n>>m,n){
int ans=1e9;
r(i,n)r(j,n)d[i][j]=i==j?0:1e8;
memset(t,0,sizeof(t));
r(i,m){
cin>>a>>b>>c;a--;b--;
... | a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'sync_with_stdio' was not declared in this scope
8 | sync_with_stdio(false);
| ^~~~~~~~~~~~~~~
|
s789552146 | p00244 | C++ | #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m,a,b,c,d[101][101];
bool t[101][101];
main(){
cin.tie(0);
sync_with_stdio(false);
while(cin>>n>>m,n){
int ans=1e9;
r(i,n)r(j,n)d[i][j]=i==j?0:1e8;
memset(t,0,sizeof(t));
r(i,m){
cin>>a>>b>>c;a--;b--;
... | a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'sync_with_stdio' was not declared in this scope
8 | sync_with_stdio(false);
| ^~~~~~~~~~~~~~~
|
s171258206 | p00244 | C++ | #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m,a,b,c,d[101][101];
bool t[101][101];
cin.tie(0);
sync_with_stdio(false);
main(){
while(cin>>n>>m,n){
int ans=1e9;
r(i,n)r(j,n)d[i][j]=i==j?0:1e8;
memset(t,0,sizeof(t));
r(i,m){
cin>>a>>b>>c;a--;b--;
d[... | a.cc:6:1: error: 'cin' does not name a type
6 | cin.tie(0);
| ^~~
a.cc:7:16: error: expected constructor, destructor, or type conversion before '(' token
7 | sync_with_stdio(false);
| ^
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
8 | main(... |
s102274546 | p00244 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, init, n) for (int i = init; i < (n); i++)
using namespace std;
using ll = long long int;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using edge = struct
{
int to, cost;
edge() {}
edge(int to, int cost) : ... | a.cc:13:5: error: ISO C++ forbids declaration of 'edge' with no type [-fpermissive]
13 | edge() {}
| ^~~~
a.cc:14:5: error: ISO C++ forbids declaration of 'edge' with no type [-fpermissive]
14 | edge(int to, int cost) : to(to), cost(cost) {}
| ^~~~
a.cc: In member function 'int<unnamed... |
s825494746 | p00244 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(void){
int graph[101][101],cpy[101][101],n,m,a,b,c;
while(cin >> n >> m,n|m){
for(int i=0;i<=n;i++){
for(int j=0;j<=n;j++){
graph[i][j]=cpy[i][j]=10000000;
}
graph[i][i]=0;
}
for(int i=0;i<m;i++... | a.cc: In function 'int main()':
a.cc:29:13: error: 'INT_MAX' was not declared in this scope
29 | int ans=INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include<algorithm>
+++ |+#include <climits>
... |
s024991504 | p00244 | C++ | #include <iostream>
#include <vector>
using namespace std;
#define INF (1 << 10)
typedef pair<int, int> P;
int main() {
int n, m;
while (cin >> n >> m, n || m) {
vector< vector<int> > cost(n, vector<int>(n, INF));
vector< vector<int> > connect(n, vector<int>(n, 0));
for (int i = 0; i < n; ++i)
cost[i][i... | a.cc: In function 'int main()':
a.cc:33:29: error: 'unique' was not declared in this scope
33 | koho.erase( unique( koho.begin(), koho.end() ), koho.end() );
| ^~~~~~
|
s698574614 | p00244 | C++ | #include <iostream>
#include <vector>
using namespace std;
#define INF (1 << 10)
typedef pair<int, int> P;
int main() {
int n, m;
while (cin >> n >> m, n || m) {
vector< vector<int> > cost(n, vector<int>(n, INF));
vector< vector<int> > connect(n, vector<int>(n, 0));
for (int i = 0; i < n; ++i)
cost[i][i... | a.cc: In function 'int main()':
a.cc:33:29: error: 'unique' was not declared in this scope
33 | koho.erase( unique( koho.begin(), koho.end() ), koho.end() );
| ^~~~~~
|
s393826916 | p00244 | C++ | #include<iostream>
#include<algorithm>
#define INF 1<<20
using namespace std;
int main(){
int n,m,s,e,c;
while(true){
cin >> n >> m;
if(n+m == 0)break;
int lst[n+1][n+1];
int Graph[n+1][n+1];
for(int i=0;i<n+1;i++)for(int j=0;j<n+1;j++){
lst[j][i] = i==j?0:INF;
Graph[i][j] = INF;
}
... | a.cc: In function 'int main()':
a.cc:26:13: error: 'i' was not declared in this scope
26 | if(Graph[k][i] == INF)continue;
| ^
|
s458334971 | p00245 | C++ | #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0... | a.cc: In function 'void func()':
a.cc:224:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
224 | int main(){
| ^~
a.cc:224:9: note: remove parentheses to default-initialize a variable
224 | int main(){
| ^~
| --
a.cc:224:9: note: o... |
s402137212 | p00245 | C++ | #include <iostream>
#include <map>
#include <vector>
using namespace std;
int dx[] = {0, 0, 0, +1, -1};
int dy[] = {0, +1, -1, 0, 0};
struct Type
{
int value, start, end;
Type(int value = 0, int start = 0, int end = 0) : value(value), start(start), end(end) {}
};
int H, W, N;
Type types[8];
map<char, int> table;... | a.cc: In function 'int solve()':
a.cc:54:9: error: 'memset' was not declared in this scope
54 | memset(memo, -1, sizeof memo);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |+#include <... |
s221020545 | p00245 | C++ | #include <iostream>
#include <map>
#include <vector>
using namespace std;
int dx[] = {0, 0, 0, +1, -1};
int dy[] = {0, +1, -1, 0, 0};
struct Type
{
int value, start, end;
Type(int value = 0, int start = 0, int end = 0) : value(value), start(start), end(end) {}
};
int H, W, N;
Type types[8];
map<char, int> table;... | a.cc: In function 'int solve()':
a.cc:54:9: error: 'memset' was not declared in this scope
54 | memset(memo, -1, sizeof memo);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |+#include <... |
s604450913 | p00245 | C++ | #include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
struct node{
int x,y,bit,t;
node(int x,int y,int bit,int t) : x(x) , y(y) , bit(bit) , t(t) {}
};
int x,y;
int sx,sy;
int n;
char c[22][22];
int num[10],d[10],s[10],e[10];
int value[1<<10];
int done[22][22][1<<10][102];
int dx[5]={0,0,1,-1,0},... | a.cc: In function 'int main()':
a.cc:51:17: error: 'memset' was not declared in this scope
51 | memset(done,0,sizeof(done));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<queue>
+++ ... |
s492023533 | p00245 | C++ | #include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ... | a.cc: In function 'int main()':
a.cc:65:33: error: 'assert' was not declared in this scope
65 | assert(false);
| ^~~~~~
a.cc:15:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
14 | #in... |
s854611183 | p00246 | C++ | #include<iostream>
#include<vector>
#include<cmath>
#include<Windows.h>
using namespace std;
void part(int x, vector<int> &d, vector<vector<int> > &a, int pre)
{
if ( x == 0 ) {
a.push_back(d);
}
for (int i = pre; i >= 1; --i) {
if (x - i >= 0) {
d.push_back(i);
part(x - i, d, a, i);
d.pop_back();
... | a.cc:4:9: fatal error: Windows.h: No such file or directory
4 | #include<Windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s221259489 | p00246 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef pair<int,int> pr;
typedef pair<pr , pr > ppr;
typedef array<int,5> arafi;
int num[5]={},numTimes[5]={},numbers;
vector<array<int,5> > p;
void search(int times,int gets[5]){
if(times==numbers){
int sum=0;
for(i... | a.cc: In function 'void search(int, int*)':
a.cc:18:31: error: variable 'arafi a' has initializer but incomplete type
18 | arafi a={gets[0],gets[1],gets[2],gets[3],gets[4]};
| ^
a.cc: In function 'int findAns(int, int*)':
a.cc:33:15: error: variable 'arafi ... |
s434837071 | p00246 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef pair<int,int> pr;
typedef pair<pr , pr > ppr;
typedef array<int,5> arafi;
int num[5]={},numTimes[5]={},numbers;
vector<array<int,5> > p;
void search(int times,int gets[5]){
if(times==numbers){
int sum=0;
for(i... | a.cc: In function 'void search(int, int*)':
a.cc:18:31: error: variable 'arafi a' has initializer but incomplete type
18 | arafi a={gets[0],gets[1],gets[2],gets[3],gets[4]};
| ^
a.cc: In function 'int findAns(int, int*)':
a.cc:33:15: error: variable 'arafi ... |
s591595472 | p00246 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
#include <cstring>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair
typedef long long ll;
ty... | a.cc: In function 'char rec(int, int, int, int, int, int)':
a.cc:84:19: error: too few arguments to function 'char rec(int, int, int, int, int, int)'
84 | char res = rec(a, b, c, d, index+1);
| ~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:75:6: note: declared here
75 | char rec(int a, int b, int c, int ... |
s521043806 | p00246 | C++ | #include <bits/stdc++.h>
typedef unsigned long long hash_t;
std::mt19937 RND;
std::uniform_int_distribution<hash_t> DST;
#define random() (DST(RND))
hash_t hash_table[10][101];
std::vector<std::vector<int>> T;
std::map<hash_t, int> dp;
void dfs(int i, int s, std::vector<int> &v)
{
if (s == 0){
T.emplace_back(v);... | a.cc: In function 'int main()':
a.cc:73:25: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
73 | dfs(1, 10, std::vector<int>(10, 0));
| ^~~~~~~~~~~~~~~~~~
a.cc:13:42: note: initializing argument 3 of 'void dfs(i... |
s988808814 | p00246 | C++ | using namespace std;
map<vector<int>, int> m;
vector<vector<int> > mp;
int getMax(vector<int> p, int sum)
{
int a;
if (m.find(p) != m.end()){
return (m[p]);
}
if (sum < 10){
return (m[p] = 0);
}
a = 0;
for (int i = 0; i < (int)mp.size(); i++){
vector<int> c = p;
bool flag;
flag = true;
for (... | a.cc:3:1: error: 'map' does not name a type
3 | map<vector<int>, int> m;
| ^~~
a.cc:4:1: error: 'vector' does not name a type
4 | vector<vector<int> > mp;
| ^~~~~~
a.cc:6:12: error: 'vector' was not declared in this scope
6 | int getMax(vector<int> p, int sum)
| ^~~~~~
a.cc:1:1:... |
s492606304 | p00246 | C++ | #include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace ... | a.cc:20:22: error: 'std::vector<std::vector<int> > select' redeclared as different kind of entity
20 | vector<vector<int> > select;
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:514,
from /usr/incl... |
s984971456 | p00246 | C++ | 5
4 9 1 3 8
10
8 5 3 6 2 1 4 5 4 5
9
5 7 3 8 2 9 6 4 1
100
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 4 4 4 4 4
3 3 3 3 3 4 4 4 4 4
5 5 5 5 5 6 6 6 6 6
7 7 7 7 7 8 8 8 8 8
9 9 9 9 9 9 9 9 9 9
0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5
| ^
|
s939705245 | p00246 | C++ | #include <iostream>
using namespace std;
int N;
int manto[11];
bool dfs(int No, int sum)
{
int x = manto[10];
if(sum == 10){
return true;
}
else if(sum > 10)
return false;
for(int i = No; i > 0; i--){
if(manto[i] > 0){
manto[i]--;
if(!dfs(i,sum+i))
manto[i]++;
else{
if(No == 9)
m... | a.cc: In function 'int main()':
a.cc:69:42: error: expected ';' before '}' token
69 | printf("%d\n", manto[10])
| ^
| ;
70 | }
| ~
|
s855763921 | p00246 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int N;
int manto[11];
bool dfs(int No, int sum)
{
int x = manto[10];
if(sum == 10){
return true;
}
else if(sum > 10)
return false;
for(int i = No; i > 0; i--){
if(manto[i] > 0){
manto[i]--;
if(!dfs(i,sum+i))
manto[i]++;
else{
... | a.cc: In function 'int main()':
a.cc:70:42: error: expected ';' before '}' token
70 | printf("%d\n", manto[10])
| ^
| ;
71 | }
| ~
|
s673690288 | p00247 | C++ | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
typedef pair<int, int> Pr;
typedef tuple<int, int, int> Tp;
#define at(t, i) get<i>(t)
int h, w;
int sx, sy, gx, gy;
char grid[14][14];
int dist[14][14];
int group[14][14];
int size[10... | a.cc: In function 'bool search(int, int, int)':
a.cc:20:13: error: reference to 'visit' is ambiguous
20 | if (visit[x][y]) return false;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14/variant:1855:5: not... |
s884109876 | p00247 | C++ | #include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <utility>
#include <cstdio>
#include <algorithm>
using namespace std;
#define fi first
#define se second
typedef pair<int,int> pii;
const int dxy[] = {1, 0, -1, 0, 1};
char maze[15][15];
int ice[15][15];
bitset<1000000> visited[12][12]... | a.cc:18:1: error: 'bitset' does not name a type
18 | bitset<1000000> visited[12][12];
| ^~~~~~
a.cc: In function 'int main()':
a.cc:89:27: error: template argument 1 is invalid
89 | queue<data> q;
| ^
a.cc:89:27: error: template argument 2 is invalid
a.cc:90:1... |
s073862902 | p00247 | C++ | #include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <utility>
#include <cstdio>
#include <algorithm>
#include <bitset>
using namespace std;
#define fi first
#define se second
typedef pair<int,int> pii;
const int dxy[] = {1, 0, -1, 0, 1};
char maze[15][15];
int ice[15][15];
bit set<30000... | a.cc:19:1: error: 'bit' does not name a type
19 | bit set<3000000> visited[12][12];
| ^~~
a.cc: In function 'int main()':
a.cc:90:27: error: template argument 1 is invalid
90 | queue<data> q;
| ^
a.cc:90:27: error: template argument 2 is invalid
a.cc:91:19: er... |
s779749414 | p00247 | C++ | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;
const int INF = 1<<29;
const double EPS = 1e... | a.cc: In function 'int main()':
a.cc:99:27: error: 'class std::priority_queue<State>' has no member named 'front'
99 | State p = que.front(); que.pop();
| ^~~~~
|
s052989578 | p00247 | C++ | #include <algorithm>
#include <iostream>
#include <queue>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)
int h, w;
char fiel... | a.cc:53:8: error: explicit specialization of 'template<class _Tp> struct std::hash' outside its namespace must use a nested-name-specifier [-fpermissive]
53 | struct hash<Data>
| ^~~~~~~~~~
|
s102652848 | p00247 | C++ | #include<iostream>
#include<stack>
#include<queue>
#include<cstring>
#define INF 1 << 15
using namespace std;
struct d{
int x;
int y;
int visited[12][12];
int ic[144];
int cnt;
};
struct b{
int x;
int y;
};
int main(){
int lx,ly,i,j,nc=1,k,a,min=144,gx,gy,ex,ey;
int maps[12][12]={0};
int mx[4]={-1,0,1,0};
in... | a.cc: In function 'int main()':
a.cc:130:67: error: expected primary-expression before '<' token
130 | if(mapc[t.y][t.x]=<r.cnt){
| ^
|
s689381819 | p00247 | C++ | #include<bits/stdc++.h>
using namespace std;
int W, H;
char map[16][16];
char g[16][16];
bool v[16][16];
int maxIce[128];
int ice[128];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int ans;
int px, py;
int sx, sy, gx, gy;
bool getMin(int ty, int tx, int turn){
if (turn + abs(ty - gy) + abs(tx - gx) >= ans){... | a.cc: In function 'bool getMin(int, int, int)':
a.cc:27:55: error: reference to 'map' is ambiguous
27 | if (0 <= mx && mx < W && 0 <= my && my < H && map[my][mx] != '#' && !v[my][mx]){
| ^~~
In file included from /usr/include/c++/14/map:63,
... |
s575813060 | p00247 | C++ | #include<bits/stdc++.h>
using namespace std;
int W, H;
char map[16][16];
char g[16][16];
bool v[16][16];
int maxIce[128];
int ice[128];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int ans;
int px, py;
int sx, sy, gx, gy;
bool getMin(int ty, int tx, int turn)
{
if (turn + abs(ty - gy) + abs(tx - gx)... | a.cc: In function 'bool getMin(int, int, int)':
a.cc:44:55: error: reference to 'map' is ambiguous
44 | if (0 <= mx && mx < W && 0 <= my && my < H && map[my][mx] != '#' && !v[my][mx]){
| ^~~
In file included from /usr/include/c++/14/map:63,
... |
s163443311 | p00247 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int W,H,SX,SY,GX,GY,ice_N;
int field[14][14],ice[14][14],icelife[1000];
bool flag[14][14];
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
void dfs(int x, int y);
bool iddfs(int x, int y, int c);
int main(){
while(cin >>W>>H,W||H){
for(int... | a.cc: In function 'int main()':
a.cc:15:5: error: 'memset' was not declared in this scope
15 | memset(ice,0,sizeof(ice));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
+++ |+#include <cstring>
... |
s983781807 | p00247 | C++ | #include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define each(i,c) for(__typeof(c.begin()) i=c.be... | a.cc:29:11: error: redefinition of 'const int inf'
29 | const int inf = (int) 1e9;
| ^~~
a.cc:25:11: note: 'const int inf' previously defined here
25 | const int inf=(int)1e9;
| ^~~
a.cc: In function 'int main()':
a.cc:80:25: error: reference to 'size' is ambiguous
80 | ... |
s122305874 | p00247 | C++ | #include <iostream>
#include <unordered_set>
#include <string>
#include <array>
#include <vector>
#include <queue>
using namespace std;
typedef unsigned long long ULL;
int ORD, N;
ULL h(const vector<int> &v, int y, int x) {
ULL res = 0;
for(int i : v) {
res *= ORD;
res += i;
}
res *= ... | a.cc: In function 'bool solve()':
a.cc:104:12: error: 'max_element' was not declared in this scope
104 | ORD = *max_element(ice.begin(), ice.end())+1;
| ^~~~~~~~~~~
|
s852970727 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
using nam... | a.cc: In function 'void make_ev()':
a.cc:76:7: error: 'ev' was not declared in this scope
76 | ev[sp][sp] = 0;
| ^~
a.cc: In function 'void compute()':
a.cc:130:29: error: 'ev' was not declared in this scope
130 | int cost = pox.cost + ev[pox.array[ice_number]][st[1]];
| ... |
s937649721 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
using nam... | a.cc: In function 'void make_ev()':
a.cc:76:7: error: 'ev' was not declared in this scope
76 | ev[sp][sp] = 0;
| ^~
a.cc: In function 'void compute()':
a.cc:130:29: error: 'ev' was not declared in this scope
130 | int cost = pox.cost + ev[pox.array[ice_number]][st[1]];
| ... |
s873503397 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
using nam... | a.cc: In function 'bool compute(int)':
a.cc:140:30: error: 'class std::deque<Pox>' has no member named 'pop'
140 | pox = Q.front(); Q.pop();
| ^~~
|
s038956667 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
#define si... | a.cc:33:16: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
33 | uc dx[] = {1,0,-1,0};
| ^~
a.cc:34:14: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
34 | uc dy[] = {0,-1,0,1};
| ^~
|
s293291662 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
#define si... | a.cc:33:16: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
33 | uc dx[] = {1,0,-1,0};
| ^~
a.cc:34:14: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
34 | uc dy[] = {0,-1,0,1};
| ^~
|
s761639567 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
#define si... | a.cc:33:16: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
33 | uc dx[] = {1,0,-1,0};
| ^~
a.cc:34:14: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
34 | uc dy[] = {0,-1,0,1};
| ^~
|
s211856142 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
#define si... | a.cc:33:16: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
33 | uc dx[] = {1,0,-1,0};
| ^~
a.cc:34:14: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
34 | uc dy[] = {0,-1,0,1};
| ^~
|
s503018650 | p00247 | C++ | #include<iostream>
#include<map>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<queue>
#include<cassert>
#include<deque>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define all(n) (n).begin(),(n).end()
#define MAX 12
#define si... | a.cc:33:16: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
33 | uc dx[] = {1,0,-1,0};
| ^~
a.cc:34:14: error: narrowing conversion of '-1' from 'int' to 'uc' {aka 'unsigned char'} [-Wnarrowing]
34 | uc dy[] = {0,-1,0,1};
| ^~
|
s377373440 | p00250 | C | #include<stdio.h>
int a(int n,int m,int k[30000]){
int i,j,sum,max;
for(i=0;i<n;i++){
sum=0;
for(j=i;j<n;j++){
if(k[j]==0) continue;
if(max==m-1) break;
sum+=k[j];
sum%=m;
if(max<sum) max=sum;
}
if(max==m-1) br... | main.c: In function 'main':
main.c:29:9: error: 'max' undeclared (first use in this function)
29 | max=0;
| ^~~
main.c:29:9: note: each undeclared identifier is reported only once for each function it appears in
|
s244767809 | p00250 | C | #include<stdio.h>
int a(int n,int m,int k[30000]){
int i,j,sum,max=0;
for(i=n-1;i>=0;i--){
sum=0;
for(j=i;j>=0;j--){
if(k[j]==0) continue;
if(max==m-1) break;
sum+=k[j];
sum%=m;
if(max<sum) max=sum;
}
... | main.c: In function 'main':
main.c:32:1: error: 'sum' undeclared (first use in this function)
32 | sum+=k[i];
| ^~~
main.c:32:1: note: each undeclared identifier is reported only once for each function it appears in
|
s517546579 | p00250 | C++ | #include<stdio.h>
int a(int n,int m,int k[30000]){
int i,j,sum,max;
for(i=0;i<n;i++){
sum=0;
for(j=i;j<n;j++){
if(k[j]==0) continue;
if(max==m-1) break;
sum+=k[j];
sum%=m;
if(max<sum) max=sum;
}
if(max==m-1) br... | a.cc: In function 'int main()':
a.cc:29:9: error: 'max' was not declared in this scope
29 | max=0;
| ^~~
|
s249455697 | p00250 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
typedef long long ll;
int const inf = 1<<29;
int main() {
for(int N, M; ~scanf("%d%d", &N, &M) && N;) {
int sum[N + 1]; sum[0] = 0;
int res = 0;
... | a.cc: In function 'int main()':
a.cc:22:7: error: 'maximize' was not declared in this scope
22 | maximize(res, sum[i + 1]);
| ^~~~~~~~
a.cc:28:7: error: 'maximize' was not declared in this scope
28 | maximize(res, sum[i] + M - *st.upper_bound(sum[i]));
| ^~~~~~~~
|
s359015837 | p00251 | Java | import java.util.*;
class Main{
private void compute(){
Scanner sc = new Scanner(System.in);
int sum = 0;
for( int i = 0; i < 10; i++){
int x = sc.nextInt();
sum += x;
}
System.out.println(sum);
}
}
public static void main(String args[]){
new Main().compute();
}
} | Main.java:14: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String args[]){
^
(use --enable-preview to enable unnamed classes)
Main.java:18: error: class, interface, enum, or record expected
}
^
2 errors
|
s200106481 | p00251 | Java | 4
4
8
8
8
10
10
12
16
20 | Main.java:1: error: class, interface, enum, or record expected
4
^
1 error
|
s648253092 | p00251 | Java | package hoge.hoge.com;
import java.util.Scanner;
public class HelloWorld {
public static void main(String[] args)
throws java.io.IOException{
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
int i=0,a;
for(a=0;a<10;a++){
String str = scan.next();
i += Integer.parseInt(str);
}
System.out.prin... | Main.java:21: error: illegal character: '\'
System.out.println(+i\n);
^
Main.java:21: error: not a statement
System.out.println(+i\n);
^
Main.java:21: error: ';' expected
System.out.println(+i\n);
^
3 errors
|
s067131008 | p00251 | Java | package hoge.hoge.com;
import java.util.Scanner;
public class HelloWorld {
public static void main(String[] args)
throws java.io.IOException{
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
int i=0,a;
for(a=0;a<10;a++){
String str = scan.next();
i += Integer.parseInt(str);
}
System.out.prin... | Main.java:5: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld {
^
1 error
|
s855194191 | p00251 | Java |
public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello World !!");
int i=0,a;
Scanner scan = new Scanner(System.in);
for(a=0;a<10;a++){
String str = scan.next();
i += Integer.parseInt(str);
}
System.out.printfln(+i);
}
} | Main.java:2: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld {
^
Main.java:6: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class HelloWorld
Main.java:6: error: cannot find symbol
Scanner scan... |
s144652955 | p00251 | Java | public class sample{
public static void main(String[] args){
int i,a,g=0;
for(i=0;i<10;i++){
a=System.in.read();
g+=a;
}
System.out.println(g);
}
} | Main.java:1: error: class sample is public, should be declared in a file named sample.java
public class sample{
^
1 error
|
s018268042 | p00251 | Java | import java.io.*;
public class sample {
public static void main(String[] args){
try{
int a,b,c=0;
for(a=0;a<10;a++){
b=System.in.read();
c+=b;
}
System.out.println(c);
}catch(IOException e){}
}
} | Main.java:2: error: class sample is public, should be declared in a file named sample.java
public class sample {
^
1 error
|
s566569135 | p00251 | Java | import java.util.Scanner;
class exe0256
{
public static void main(String args[])
{
Scanner scan=new Scanner(System.in);
sum=0;
for(int i=0;i<10;i++)
{
int s=scan.nextInt();
sum+=s;
}
System.out.println(sum);
}
} | Main.java:7: error: cannot find symbol
sum=0;
^
symbol: variable sum
location: class exe0256
Main.java:11: error: cannot find symbol
sum+=s;
^
symbol: variable sum
location: class exe0256
Main.java:13: error: cannot find symbol
System.out.println(sum);
^
symbol: variable sum
locatio... |
s484572928 | p00251 | Java | import java.util.Scanner;
public class aoj0256 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int count = 0;
for(int i = 0;i < 10;i++){
int n = in.nextInt();
count = count + n;
}
System.out.println(count);
}
} | Main.java:3: error: class aoj0256 is public, should be declared in a file named aoj0256.java
public class aoj0256 {
^
1 error
|
s685706439 | p00251 | C | import java.util.Scanner;
public class J0256{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int sum=0;
for(int i=0; i<10; i++){
int n = sc.nextInt();
sum += n;
}
System.out.println(sum);
}
} | main.c:1:1: error: unknown type name 'import'
1 | import java.util.Scanner;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.Scanner;
| ^
main.c:3:1: error: unknown type name 'public'
3 | public class J0256{
| ^~... |
s395068669 | p00251 | C | #include<stdio.h>
int main(){
int string[10];
int i;
int ans=0;
for(i=0;i<=9i++){
scanf("%d", &string[i]);
ans+=string[i];
}
printf("%d\n",ans);
return 0;
} | main.c: In function 'main':
main.c:6:18: error: lvalue required as increment operand
6 | for(i=0;i<=9i++){
| ^~
main.c:6:20: error: expected ';' before ')' token
6 | for(i=0;i<=9i++){
| ^
| ;
|
s856027520 | p00251 | C | #include<stdio.h>
int main(){
int a[10];
int i;
int ans=0;
for(i=0;i<=9i++){
scanf("%d", &a[i]);
ans+=a[i];
}
printf("%d\n", ans);
return 0;
} | main.c: In function 'main':
main.c:7:18: error: lvalue required as increment operand
7 | for(i=0;i<=9i++){
| ^~
main.c:7:20: error: expected ';' before ')' token
7 | for(i=0;i<=9i++){
| ^
| ;
|
s032505330 | p00251 | C | #include <stdio.h>
int main(){
int i,a[10],sum=0;
for(i=0;i<10;i++){
scanf("%d",&a[i]);
sum+=a[i]
}
printf("%d",sum);
return 0;
} | main.c: In function 'main':
main.c:7:12: error: expected ';' before '}' token
7 | sum+=a[i]
| ^
| ;
8 | }
| ~
|
s130603746 | p00251 | C | #include<stdio.h>
int main(void)
{
int a,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10;
scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
a=s1+s2+s3+s4+s5+s6+s7+s8+s9+10;
printf("%d\n",a);
return 0;
} | main.c: In function 'main':
main.c:5:38: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
| |
| char *
|
s795709840 | p00251 | C | #include<stdio.h>
int main(void)
{
int s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,a;
scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
a=s1+s2+s3+s4+s5+s6+s7+s8+s9+10;
printf("%d\n",a);
return 0;
} | main.c: In function 'main':
main.c:5:38: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
| |
| char *
|
s449564507 | p00251 | C | #include<stdio.h>
int main()
{
int s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,a;
scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
a=s1+s2+s3+s4+s5+s6+s7+s8+s9+10;
printf("%d\n",a);
return 0;
} | main.c: In function 'main':
main.c:5:38: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
| |
| char *
|
s510222452 | p00251 | C | #include<iostream>
using namespace std;
int main(){
int ans=0;
int tmp;
for(int i=0;i<10;i++){
cin>>tmp;
ans+=tmp;
}
cout<<ans<<endl;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s153653666 | p00251 | C | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);} | main.c:1:1: warning: data definition has no type or storage class
1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
1 | s;main(x){~scanf("%... |
s454226021 | p00251 | C | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);} | main.c:1:1: warning: data definition has no type or storage class
1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
1 | s;main(x){~scanf("%d",... |
s083153198 | p00251 | C | #include<stdio.h>
int main()
{
int a,i,b=0;
for(i=0;i<10;i++){
scanf("%d",&a);
b+=a;
}
printf("%d\n";b);
return 0;
} | main.c: In function 'main':
main.c:10:14: error: expected ')' before ';' token
10 | printf("%d\n";b);
| ~ ^
| )
|
s780804815 | p00251 | C | #include <stdio.h>
int main(){
int s, sum = 0;
for(i = 0; i < 10; i++){
scanf("%d", &s);
sum += s;
}
printf("%d\n", sum);
return 0;
} | main.c: In function 'main':
main.c:5:7: error: 'i' undeclared (first use in this function)
5 | for(i = 0; i < 10; i++){
| ^
main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
|
s734915122 | p00251 | C++ | #include<stdio.h>
int main(){
int i,sum=0,n;
for(i=0;i<10;i++){
cin >>n;
sum+=n;
}
cout << sum<<endl;
}
| a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin >>n;
| ^~~
a.cc:8:3: error: 'cout' was not declared in this scope
8 | cout << sum<<endl;
| ^~~~
a.cc:8:16: error: 'endl' was not declared in this scope
8 | cout << sum<<endl;
| ... |
s375745247 | p00251 | C++ | import std.stream;
int main(){
int sum = 0;
for (i = 0; i < 10; i++){
int a;
a = readIn;
sum += a;
}
writef(%d\n, sum);
} | a.cc:9:10: error: stray '\' in program
9 | writef(%d\n, sum);
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import std.stream;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc: In function 'int main()':
a.cc:4:6: error: 'i' was not declared in this sc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.