submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s802247534 | p00468 | C++ | #include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int s[1001]={0};
int main(){
while(1){
int i,j,n,m,l=0,a,b;
cin>>n>>m;
memset(s,0,sizeof(s));
s[1]=3;
for(i=0;i<m;i++){
cin>>a>>b;
if(s[a]>0&&s[b]==0)s[b]=s[a]-1;
if(s[b]>0&&s[a]==0)s[a]=s[b]-1;
}
for(i=1;i<=n;i++){
if(s[i]>0)l++;
}
cout<<... | a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s291744039 | p00468 | C++ | #include <iostream>
using namespace std;
int d[10000],e[10000];
int main(void){
for (;;){
long a,b,c,g=0;
cin>>a>>b;
if (a==0&&b==0) break;
long f[501]={0};
for (c=0;c<b;c++){
cin>>d[c]>>e[c];
if (d[c]==1)f[e[c]]=2;
}
for(c=0;c<m;c++){
if(f[d[c]]==2)f[e[c]]=1;
if(f[e[c]]==2)f[d[c]]=1;
for ... | a.cc: In function 'int main()':
a.cc:14:27: error: 'm' was not declared in this scope
14 | for(c=0;c<m;c++){
| ^
a.cc:23:2: error: expected '}' at end of input
23 | }
| ^
a.cc:4:15: note: to match this '{'
4 | int main(void){
| ^
|
s828746678 | p00468 | C++ | #include <iostream>
using namespace std;
int d[10000],e[10000];
int main(void){
for (;;){
long a,b,c,g=0;
cin>>a>>b;
if (a==0&&b==0) break;
long f[501]={0};
for (c=0;c<b;c++){
cin>>d[c]>>e[c];
if (d[c]==1)f[e[c]]=2;
}
for(c=0;c<m;c++){
if(f[d[c]]==2)f[e[c]]=1;
if(f[e[c]]==2)f[d[c]]=1;
for ... | a.cc: In function 'int main()':
a.cc:14:27: error: 'm' was not declared in this scope
14 | for(c=0;c<m;c++){
| ^
a.cc:23:2: error: expected '}' at end of input
23 | }
| ^
a.cc:4:15: note: to match this '{'
4 | int main(void){
| ^
|
s074001010 | p00468 | C++ | #include <iostream>
using namespace std;
int d[10000],e[10000];
int main(void){
for (;;){
long a,b,c,g=0;
cin>>a>>b;
if (a==0&&b==0) break;
long f[501]={0};
for (c=0;c<b;c++){
cin>>d[c]>>e[c];
if (d[c]==1)f[e[c]]=2;
}
for(c=0;c<m;c++){
if(f[d[c]]==2)f[e[c]]=1;
if(f[e[c]]==2)f[d[c]]=1;
for ... | a.cc: In function 'int main()':
a.cc:14:27: error: 'm' was not declared in this scope
14 | for(c=0;c<m;c++){
| ^
a.cc:23:2: error: expected '}' at end of input
23 | }
| ^
a.cc:4:15: note: to match this '{'
4 | int main(void){
| ^
|
s809757040 | p00468 | C++ | #include<iostream>
#include<string.h>
using namespace std;
int r[501][1001]={0};
int ans=0,n;
takahashi(int i){
for(int j=1;j<=n;j++){
if(r[i][j]==1&&r[1][j]!=0){
ans++;
takahashi(j);
}
}
}
int main(){
while(1){
int m,a,b;
ans=0;
cin>>n>>m;
if(n==0&&m==0)break;
memset(r,0,sizeof(r));
for(int i... | a.cc:6:1: error: ISO C++ forbids declaration of 'takahashi' with no type [-fpermissive]
6 | takahashi(int i){
| ^~~~~~~~~
a.cc: In function 'int takahashi(int)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
13 | }
| ^
|
s233337994 | p00468 | C++ | 50
200
24 40
17 20
23 27
38 46
31 47
11 16
15 21
29 49
11 29
34 42
18 43
15 44
13 50
2 50
16 36
6 27
13 40
17 23
12 39
40 49
40 41
16 37
14 30
37 38
1 39
16 43
22 37
40 45
32 34
37 41
7 23
12 13
7 9
11 43
21 40
1 7
13 33
21 37
18 44
5 22
32 41
3 15
7 39
6 46
4 8
6 41
2 29
1 48
17 44
3 20
13 18
23 40
18 19
10 23
27 47
2... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 50
| ^~
|
s678505475 | p00468 | C++ | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (long long i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<i... | a.cc: In function 'int main()':
a.cc:29:11: error: request for member 'clear' in 'v', which is of non-class type 'std::vector<int> [501]'
29 | v.clear();
| ^~~~~
a.cc:52:2: error: expected '}' at end of input
52 | }
| ^
a.cc:22:12: note: to match this '{'
22 | int main() {
... |
s244210792 | p00468 | C++ | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (long long i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<i... | a.cc: In function 'int main()':
a.cc:29:11: error: request for member 'clear' in 'v', which is of non-class type 'std::vector<int> [501]'
29 | v.clear();
| ^~~~~
|
s153611809 | p00468 | C++ | // 0545.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#inc... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s215284528 | p00468 | C++ | #include<iostream>
using namespace std;
int main(){
int n,cut,m,a,b,i,j,k;
int c[500][500]={0};
c[1][1]=0;
cin>>n;
cin>>m;
for(i=1;i<=m;i++){
cin>>a>>b;
if(a==1){
c[a][b]=1;
}
else if(b==1){
c[b][a]=1;
}
else{
c[a][b]=1;
c[b][a]=1;
}
}
cut=0;
for(i=2;i<=n;i++){
if(c[1][i]==1){
cu... | a.cc: In function 'int main()':
a.cc:29:25: error: expected primary-expression before '}' token
29 | }
| ^
a.cc: At global scope:
a.cc:32:9: error: 'cout' does not name a type
32 | cout<<cut<<endl;
| ^~~~
a.cc:33:9: error: expected unqual... |
s062944958 | p00468 | C++ | #include<iostream>
using namespace std;
int main(){
int n,cut,m,a,b,i,j,k;
int c[500][500]={0};
c[1][1]=0;
cin>>n;
cin>>m;
for(i=1;i<=m;i++){
cin>>a>>b;
if(a==1){
c[a][b]=1;
}
else if(b==1){
c[b][a]=1;
}
else{
c[a][b]=1;
c[b][a]=1;
}
}
cut=0;
for(i=2;i<=n;i++){
if(c[1][i]==1){
cu... | a.cc: In function 'int main()':
a.cc:29:25: error: expected primary-expression before '}' token
29 | }
| ^
a.cc: At global scope:
a.cc:32:9: error: 'cout' does not name a type
32 | cout<<cut<<endl;
| ^~~~
a.cc:33:9: error: expected unqual... |
s892058832 | p00468 | C++ | #include<iostream>
using namespace std;
int main(){
int n,cut,m,a,b,i,j,k;
int c[500][500]={0};
c[1][1]=0;
cin>>n;
cin>>m;
for(i=1;i<=m;i++){
cin>>a>>b;
if(a==1){
c[a][b]=1;
}
else if(b==1){
c[b][a]=1;
}
else{
c[a][b]=1;
c[b][a]=1;
}
}
cut=0;
for(i=2;i<=n;i++){
if(c[1][i]==1){
cu... | a.cc: In function 'int main()':
a.cc:29:25: error: expected primary-expression before '}' token
29 | }
| ^
a.cc: At global scope:
a.cc:32:9: error: 'cout' does not name a type
32 | cout<<cut<<endl;
| ^~~~
a.cc:33:9: error: expected unqual... |
s483956073 | p00468 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <functional>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
int f[501][501];
bool visited[501];
int main()
{
int n, m;
while(cin >> n >> m && n && m) {
int a, b;
memset(f, 0,... | a.cc: In function 'int main()':
a.cc:19:9: error: 'memset' was not declared in this scope
19 | memset(f, 0, sizeof(f));
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <algorithm>
+++ |+#include <cstr... |
s457011923 | p00468 | C++ | #include <cstdio>
using namespace std;
//·²ëÌ}Xîñ
int tbl[1010];
int main(int argc, char **argv)
{
int n,m;
scanf("%d%d", &n, &m);
for(int i = 0; i < n; ++i) {
scanf("%d", &tbl[i]);
}
int cur = 0;
for(int i = 0; i < m; ++i) {
int t;
scanf("%d", &t);
//... | a.cc:35:1: error: extended character is not valid in an identifier
35 | âè3
| ^
a.cc:35:1: error: extended character is not valid in an identifier
a.cc:35:1: error: '\302\226\303\242\302\221\303\2503' does not name a type
35 | âè3
| ^~~~~
In file included from a.cc:46:
/usr/include/c++/14/cstr... |
s308738388 | p00468 | C++ | include<iostream>
using namespace std;
int main(){
int n,m;
while(cin >> n >> m && n + m){
int data[n+1];
int sum = -1;
for(int i = 0; i <= n; i++) data[i] = 0;
data[1] = 1;
int a[m],b[m];
for(int i = 0; i < m; i++){
cin >> a[i] >> b[i];
if(data[a[i]] == 1 && data[a[i]] < 3) d... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
8 | while(cin >> n >> m && n + m){
| ^~~
a.cc:24:5: error: 'cout' was not declared in this scope
24 | cout << sum << ... |
s716616638 | p00468 | C++ | while(1){int n,m,i,j,a,b,x[501]={},c[501][501]={},num[501]={},sum=0;scanf("%d%d",&n,&m);if(n==0)break;for(i=1;i<=m;i++){scanf("%d%d",&a,&b);if(a==1){num[b]++;}c[a][b]=1;c[b][a]=1;}for(i=1;i<=n;i++){for(j=1;j<=n;j++){if(c[1][i]==1&&c[i][j]==1){num[j]++;}}}for(i=2;i<=n;i++){if(num[i]!=0)sum++;}printf("%d\n",sum);} | a.cc:1:1: error: expected unqualified-id before 'while'
1 | while(1){int n,m,i,j,a,b,x[501]={},c[501][501]={},num[501]={},sum=0;scanf("%d%d",&n,&m);if(n==0)break;for(i=1;i<=m;i++){scanf("%d%d",&a,&b);if(a==1){num[b]++;}c[a][b]=1;c[b][a]=1;}for(i=1;i<=n;i++){for(j=1;j<=n;j++){if(c[1][i]==1&&c[i][j]==1){num[j]++;}}}f... |
s342466344 | p00468 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int n;
int m;
int c;
int e;
while(cin >>n>>m){
if(n==0&&m==0){break;}
int a[m];
int b[m];
c=0;
while(c<m){
cin >>a[c]>>b[c];
c=c+1;}
int d[n];
d[0]=3;
c=1;
while(c<n){
d[c]=0;
c=c+1;}
c=0;
while(c<m){
if(a[c]==1){d[b[c]-1]=2;}
if(b[c]==1){d[a[c]-1]=... | a.cc: In function 'int main()':
a.cc:38:17: error: expected '}' at end of input
38 | cout <<e<<endl;}
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s932529318 | p00468 | C++ | #include <stdio.h>
int main (void) {
int j,i,n,m,friend[501][501]={0},from,to,called[501] = {0};
int count = 0;
while(1){
for(i = 0; i < 501;i++){
for(j = 0; j < 501;j++){
friend[i][j] = 0;
}
called[i] = 0;
}
count = 0;
scanf("%d",&n);
scanf("%d",&m)... | a.cc: In function 'int main()':
a.cc:6:15: error: expected unqualified-id before 'friend'
6 | int j,i,n,m,friend[501][501]={0},from,to,called[501] = {0};
| ^~~~~~
a.cc:6:35: error: expected primary-expression before ',' token
6 | int j,i,n,m,friend[501][501]={0},from,to,called[501] = {0}... |
s830483190 | p00468 | C++ | #include <stdio.h>
int main (void) {
int j,i,n,m,friend[501][501]={0},from,to,called[501] = {0};
int count = 0;
while(1){
for(i = 0; i < 501;i++){
for(j = 0; j < 501;j++){
friend[i][j] = 0;
}
called[i] = 0;
}
count = 0;
scanf("%d",&n);
scanf("%d",&m)... | a.cc: In function 'int main()':
a.cc:6:15: error: expected unqualified-id before 'friend'
6 | int j,i,n,m,friend[501][501]={0},from,to,called[501] = {0};
| ^~~~~~
a.cc:6:35: error: expected primary-expression before ',' token
6 | int j,i,n,m,friend[501][501]={0},from,to,called[501] = {0}... |
s836323295 | p00468 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#define SWAP(type,a,b) do{type temp=a;a=b;b=temp;}while(0)
using namespace std;
int main(){
int n[501],m[501][501],tmp[501];
int nt,mt,a,b,sum=0;
while(1){
sum=0;
for(int i=0;i<=500;i++){
for(int j=0;j<=500;j++){
m[i][j]=0;
}
n[i]=m[... | a.cc: In function 'int main()':
a.cc:15:16: error: incompatible types in assignment of 'int' to 'int [501]'
15 | n[i]=m[i]=0;
| ~~~~^~
|
s945404792 | p00468 | C++ | #include<iostream>
using namespace std;
int main(){
int ans,n,m,state1,state2,fre[501][501]={{0}};
while(1){
cin >> n;
cin >> m;
if(n==0 && m==0){
break;
}
for(int i=0;i<n+2;i++){
memset(fre[i],0,sizeof(fre[i]));
}
for(int i=0;i<m;i++){
cin >> state1 >> state2;
fr... | a.cc: In function 'int main()':
a.cc:12:7: error: 'memset' was not declared in this scope
12 | memset(fre[i],0,sizeof(fre[i]));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cs... |
s649801002 | p00468 | C++ | /* title: Party
* source: JOI2009-2010 Yosen No.3
* hint:
* 多頂点最短路を探索して自分からの距離が2以下のものを列挙すればよい
* 最短路探索はDijkstra, Bellman-Ford, Warshall-Floydなどのアルゴリズムが有名
* Warshall-Floyd が一番簡単なのでこれだけでも覚えておこう
* でも実際、予選は全ての資料を持込可能なので覚えている必要もない
* 蟻本のどこに載っているかぐらいは覚えておこう
*/
#include <iostream>
#include <vector>
using namespace st... | a.cc: In function 'int main()':
a.cc:42:25: error: 'count_if' was not declared in this scope
42 | cout << count_if(G[0].begin()+1, G[0].end(), [](int l){ return l <= 2; }) << endl;
| ^~~~~~~~
|
s590013759 | p00468 | C++ | include<iostream>
#include<cstring>
using namespace std;
int main()
{
int n,m;
for(;cin>>n>>m,n||m;)
{
int data[n+1];
memset(data,-1,sizeof(data));
int list[2][m];
for(int i=0;i<m;i++)
{
cin>>list[0][i]>>list[1][i];
if(list[0][i]==1)
data[list[1][i]]=1;
}
for(int i=0;... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:8: error: 'cin' was not declared in this scope
8 | for(;cin>>n>>m,n||m;)
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by add... |
s119405353 | p00469 | C | #include<cstdio>
#include<set>
using namespace std;
set<int> numbers;
int n, k, cards[10], used[10];
void addcard(int x, int y){
if(x == 0){
numbers.insert(y);
}
for(int i = 0;i < n;i++){
if(used[i] == 0){
int shift = 10;
if(cards[i] >= 10)shift *= 10;
used[i] = 1;
addcard(x - 1,... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s650789154 | p00469 | C++ | #include "bits/stdc++.h"
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define all(co) co.begin(), co.end()
using namespace std;
//using P = pair<int, int>;
int main() {
int n;
while (cin >> n && n) {
int k; cin >> k;
vector<string> vec(n);
rep(i, n) cin >> vec[i];
set<string> sets;
vector<bool> used... | a.cc: In function 'int main()':
a.cc:17:49: error: a function-definition is not allowed here before '{' token
17 | void dfs(string str, int count) {
| ^
a.cc:28:17: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
28 | ... |
s034768893 | p00469 | C++ | #include "bits/stdc++.h"
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define all(co) co.begin(), co.end()
using namespace std;
//using P = pair<int, int>;
int main() {
int n;
while (cin >> n && n) {
int k; cin >> k;
vector<string> vec(n);
rep(i, n) cin >> vec[i];
set<... | a.cc: In function 'int main()':
a.cc:17:16: error: expected unqualified-id before string constant
17 | extern "C" void dfs (string str, int count) {
| ^~~
a.cc:28:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
28 | dfs("", 0);
| ^~~
| ... |
s322172325 | p00469 | C++ | #include "bits/stdc++.h"
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define all(co) co.begin(), co.end()
using namespace std;
//using P = pair<int, int>;
int main() {
int n;
while (cin >> n && n) {
int k; cin >> k;
vector<string> vec(n);
rep(i, n) cin >> vec[i];
set<... | a.cc: In function 'int main()':
a.cc:17:16: error: expected unqualified-id before string constant
17 | extern "C"{ void dfs (string str, int count) {
| ^~~
a.cc:28:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
28 | dfs("", 0);
| ^~~
| ... |
s120404640 | p00469 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
vector<string> v;
v_push(string str){
bool checker;
checker = true;
for(int len = 0; len < v.size(); len++){
if(v.at(len) == str){
checker = false;
break;
}
}
if(checker){
v.push_back(str);
}
}
string str_int(int num){
... | a.cc:9:1: error: ISO C++ forbids declaration of 'v_push' with no type [-fpermissive]
9 | v_push(string str){
| ^~~~~~
a.cc: In function 'int v_push(std::string)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
22 | }
| ^
|
s300780353 | p00469 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
vector<string> v;
v_push(string str){
bool checker;
checker = true;
for(int len = 0; len < v.size(); len++){
if(v.at(len) == str){
checker = false;
break;
}
}
if(checker){
v.push_back(str);
}
}
string str_int(int num){
... | a.cc:9:1: error: ISO C++ forbids declaration of 'v_push' with no type [-fpermissive]
9 | v_push(string str){
| ^~~~~~
a.cc: In function 'int v_push(std::string)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
22 | }
| ^
|
s285888723 | p00469 | 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>
#include <ctime>
using namespace std;
#define rep(i,n) for(int i... | a.cc: In function 'void calc(int, vi)':
a.cc:54:48: error: expected ')' before ';' token
54 | }while(next_permutation(all(u));
| ~ ^
| )
|
s152008533 | p00469 | C++ | #include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define ZERO(a) memset(a,0,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define INF 1<<29
#define MAX 11
using namespace std;
int a[MAX],s[MAX];
void solv... | a.cc: In function 'void solve()':
a.cc:31:15: error: no match for 'operator+=' (operand types are 'int [11]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
31 | FOR(j,k) s+=to_string(a[s[ord[j]]]);
| ~^~~~~~~~~~~~~~~~~~~~~~~~~
|
s143219145 | p00469 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
... | a.cc: In function 'int main()':
a.cc:41:16: error: 'c' was not declared in this scope
41 | memset(c,false,sizeof(c));
| ^
|
s583073463 | p00469 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
int main(void){
while(1){
int n, k;
scanf("%... | a.cc: In function 'int main()':
a.cc:28:47: error: expected ';' before '}' token
28 | tmp += data[i]
| ^
| ;
29 | }
| ~ ... |
s957543783 | p00469 | C++ | #include<stdio.h>
#include<string>
#include<set>
using namespace std;
int n, k;
int card[10];
bool b[10];
set<string>ans;
void solve(string sum, int rest) {
if (!rest) {
ans.insert(sum);
return;
}
for (int i = 0; i < n; i++) {
if (!b[i]){
b[i] = true;
solve(sum + to_string(card[i]), rest - 1);
b[i] =... | a.cc: In function 'int main()':
a.cc:26:17: error: 'memset' was not declared in this scope
26 | memset(b, 0, sizeof(b));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<set>
+++ |+#inc... |
s887079786 | p00469 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int n,k,a[10],power[5];
vector<string>vec;
int main(){
while(true){
cin>>n>>k;vec.clear();power[0]=1;for(int i=1;i<5;i++)power[i]=power[i-1]*n;
if(n==0 && k==0)break;
for(int i=0;i<n;i++)cin>>a[i];
for(int i=0;i<power... | a.cc: In function 'int main()':
a.cc:26:22: error: 'S' was not declared in this scope
26 | sort(S.begin(),S.end());int cnt=1;
| ^
|
s199064939 | p00469 | C++ | #include <iostream>
#include <vector>
using namespace std;
int n={},k={};
string integer[11]={};
vector<string>num={};
int chousen[11]={};
string complete_integer[10000]={};
string answer={};
int integer_count=0;
void operation(){
for(int i=1;i<=n;i++){
if (chousen[i]==0){
chouse... | /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
|
s549635492 | p00469 | C++ | #include <iostream>
#include <vector>
using namespace std;
int n={},k={};
string integer[11]={};
vector<string>num={};
int chousen[11]={};
string complete_integer[10000]={};
string answer={};
int integer_count=0;
void operation(){
for(int i=1;i<=n;i++){
if (chousen[i]==0){
chouse... | /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
|
s468977163 | p00469 | C++ | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main(){
int n,k;
while(1){
cin>>n>>k;
string S[11];
if(n==0&&k==0) break;
for(int i=0; i<n; i++) cin>>S[i];
sort(S,S+n);
set<string> SS;
do{
string str;
... | a.cc: In function 'int main()':
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(S,S+n);
| ^~~~
| short
a.cc:19:16: error: 'next_permutation' was not declared in this scope
19 | }while(next_permutation(S, S+n));
| ... |
s952448860 | p00469 | C++ | ??£??? | a.cc:1:3: error: extended character £ is not valid in an identifier
1 | ??£???
| ^
a.cc:1:1: error: expected unqualified-id before '?' token
1 | ??£???
| ^
|
s080820783 | p00469 | C++ | #include<iostream>
#include<vector>
#include<set>
using namespace std;
int main(){
int n,k;
while(scanf("%d%d",&n,&k),n+k){
int card[n];
set<int> s;
for(int i=0; i<n; i++)
scanf("%d",&card[i]);
vector<int> v(n);
for(int i=0; i<k; i++)
v[n-k+i] = i+1;
do{
int a[k];
f... | a.cc: In function 'int main()':
a.cc:35:12: error: 'next_permutation' was not declared in this scope
35 | }while(next_permutation(v.begin(), v.end()));
| ^~~~~~~~~~~~~~~~
|
s715894769 | p00469 | C++ | #include<cstdio>
#include<algorithm>
#include<vector>
#include<sstream>
#include<cstdlib>
using namespace std;
int main(){
while(1){
int n,k;
scanf("%d%d",&n,&k);
if(n==0)
break;
vector<int> card(n);
for(int i=0;i<n;i++){
scanf("%d",&card[i]);
}
sort(card.begin(),card.end());
vector... | a.cc: In function 'int main()':
a.cc:31:60: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
31 | data.push_back(atoi(sst.str().begin()));
| ~~~~~~~~~~~~~~~^~
| ... |
s909960961 | p00469 | C++ | #include<cstdio>
#include<algorithm>
#include<vector>
#include<sstream>
#include<cstdlib>
using namespace std;
int main(){
while(1){
int n,k;
scanf("%d%d",&n,&k);
if(n==0)
break;
vector<int> card(n);
for(int i=0;i<n;i++){
scanf("%d",&card[i]);
}
sort(card.begin(),card.end());
vector... | a.cc: In function 'int main()':
a.cc:31:60: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
31 | data.push_back(atoi(sst.str().begin()));
| ~~~~~~~~~~~~~~~^~
| ... |
s968890361 | p00469 | C++ | #include<cstdio>
#include<algorithm>
#include<vector>
#include<sstream>
#include<cstdlib>
using namespace std;
int main(){
while(1){
int n,k;
scanf("%d%d",&n,&k);
if(n==0)
break;
vector<int> card(n);
for(int i=0;i<n;i++){
scanf("%d",&card[i]);
}
sort(card.begin(),card.end());
vector... | a.cc: In function 'int main()':
a.cc:31:60: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
31 | data.push_back(atoi(sst.str().begin()));
| ~~~~~~~~~~~~~~~^~
| ... |
s387391542 | p00469 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<cstdlib>
#include<set>
using namespace std;
int arr[10];
int sub[10];
int n,k;
int now = 0;
int cont;
int c = 0;
set<int> visit2;
void saiki(int[],int);
int main()
{
for(;;)
{
visit2.clear();
int i;
c = 0;
now = 0;
scanf("%d",&n);
scanf... | a.cc: In function 'void saiki(int*, int)':
a.cc:57:29: error: 'strlen' was not declared in this scope
57 | sprintf(str+strlen(str),"%d",temp[i]);
| ^~~~~~
a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring... |
s305593820 | p00469 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<set>
#include<ctype.h>
#include<cstdlib>
using namespace std;
int arr[10];
int sub[10];
int n,k;
int now = 0;
int cont;
int c = 0;
set<int> visit2;
void saiki(int[],int);
int main()
{
for(;;)
{
visit2.clear();
int i;
c = 0;
now = 0;
scanf... | a.cc: In function 'void saiki(int*, int)':
a.cc:57:29: error: 'strlen' was not declared in this scope
57 | sprintf(str+strlen(str),"%d",temp[i]);
| ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring... |
s977061140 | p00469 | C++ | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include... | a.cc:37:4: error: 'vi select' redeclared as different kind of entity
37 | vi select;
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:514,
from /usr/include/c++/14/cstdlib:79,
from a.cc:2:
/usr/include... |
s689967457 | p00469 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;
typedef vector<int> comb;
int s_to_i(string s){
bool flag = false;
int n = 0;
for(unsigned int i=0 ; i < s.size() ; ++i ){
if( i == 0 && s[i] == '-' ){
flag = true;
}else if( s[i] >= '0' && s[i] <= '9'... | a.cc: In function 'std::string i_to_s(int)':
a.cc:38:9: error: 'reverse' was not declared in this scope
38 | reverse( s.begin() , s.end() );
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:95:25: error: 'next_permutation' was not declared in this scope
95 | }while( next_permut... |
s025501163 | p00469 | C++ | #include <cstdio>
#include <algorithm>
#include <set>
#include <string>
using namespace std;
int N, K;
set<int> result;
int card[16];
bool used[16];
void solve(int k, int ans) {
if(k == K) {
result.insert(ans);
return;
}
for(int i = 0; i < N; i++) {
if(used[i] == true) continue;
used[i] = true;
int t = c... | a.cc: In function 'int main()':
a.cc:36:17: error: 'memset' was not declared in this scope
36 | memset(used, 0, sizeof used);
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <string>
+... |
s456145003 | p00469 | C++ | #include <cstdio>
#include <set>
using namespace std;
int N, K;
set<int> result;
int card[16];
bool used[16];
void solve(int k, int ans) {
if(k == K) {
result.insert(ans);
return;
}
for(int i = 0; i < N; i++) {
if(used[i] == true) continue;
used[i] = true;
int t = card[i];
int next;
if(t < 10) {
n... | a.cc: In function 'int main()':
a.cc:34:17: error: 'memset' was not declared in this scope
34 | memset(used, 0, sizeof used);
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <set>
+++ ... |
s966118914 | p00469 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int count(int n)
{
int ret = 1;
for(int mul = 10; mul <= n; mul *= 10) ++ret;
return ret;
}
void add(int k, int sum, vector<int> &c, vector<int> &result)
{
if(k == 0) {
result.push_back(sum);
return;
}
for(int i = pos + 1; i < c.size(); ++... | a.cc: In function 'void add(int, int, std::vector<int>&, std::vector<int>&)':
a.cc:19:13: error: 'pos' was not declared in this scope
19 | for(int i = pos + 1; i < c.size(); ++i) {
| ^~~
a.cc: In function 'int main()':
a.cc:42:6: error: no matching function for call to 'count(int&, int, std::vector... |
s718286272 | p00469 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int count(int n)
{
int ret = 1;
for(int mul = 10; mul <= n; mul *= 10) ++ret;
return ret;
}
void add(int k, int sum, vector<int> &c, vector<int> &result)
{
if(k == 0) {
result.push_back(sum);
return;
}
for(int i = 0; i < c.size(); ++i) {
i... | a.cc: In function 'int main()':
a.cc:42:6: error: no matching function for call to 'count(int&, int, std::vector<int>&, std::vector<int>&)'
42 | count(k, 0, c, result);
| ~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_al... |
s084283053 | p00469 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int count(int n)
{
int ret = 1;
for(int mul = 10; mul <= n; mul *= 10) ++ret;
return ret;
}
void add(int k, int sum, vector<int> &c, vector<int> &result)
{
if(k == 0) {
result.push_back(sum);
return;
}
for(int i = 0; i < c.size(); ++i) {
i... | a.cc: In function 'int main()':
a.cc:44:8: error: 'class std::vector<int>' has no member named 'remove'
44 | result.remove(unique(result.begin(), result.end()), result.end());
| ^~~~~~
|
s116041612 | p00469 | C++ | #include<cstdio>
#include<set>
using namespace std;
set<int> se;
int N,K;
int card[10];
bool used[10];
void rec(int num,int k)
{
if(k==K)
{
se.insert(num);
return;
}
for(int i=0;i<N;i++)
{
if(used[i]==true) continue;
used[i]=true;
int nnum;
if(card[i]<10) nnum=num*10+card[i];
else nnum=num*100+c... | a.cc: In function 'int main()':
a.cc:39:9: error: 'memset' was not declared in this scope
39 | memset(used,false,sizeof(used));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<set>
+++ |+#include <cst... |
s001996571 | p00469 | C++ | #include <cstdio>
#include <cstdlib>
#include <map>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
map<string,bool> bmap;
short card[10];
short select[4],temp[4];
bool used[10];
int n,k,num;
void solve(int m) {
if(m==k) {
for(int i=0;i<k;i++)temp[i]=select[i];
do {... | a.cc:11:15: error: 'short int select [4]' redeclared as different kind of entity
11 | short select[4],temp[4];
| ^
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:514,
from /usr/include/c++/14/cstdlib:79,
... |
s716837425 | p00469 | C++ | #include <cstdio>
#include <cstdlib>
#include <map>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
map<string,bool> bmap;
int card[10];
int select[4],temp[4];
bool used[10];
int n,k,num;
void solve(int m) {
if(m==k) {
for(int i=0;i<k;i++)temp[i]=select[i];
do {
... | a.cc:11:13: error: 'int select [4]' redeclared as different kind of entity
11 | int select[4],temp[4];
| ^
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:514,
from /usr/include/c++/14/cstdlib:79,
fro... |
s618131709 | p00469 | C++ | #include "stdio.h"
#include <vector>
#include <queue>
#include <set>
using namespace std;
int x[10];
int main()
{
while(1)
{
int n,k;
scanf("%d",&n);
scanf("%d",&k);
if(n == 0 && k == 0)
{
break;
}
for(int i = 0; i < n; i++)
{
scanf("%d",&x[i]);
}
int w = 1;
for(int i = 0; i < k; i++)
{
w *= n;
}
set<int> sw;
for(... | a.cc: In function 'int main()':
a.cc:81:2: error: expected '}' at end of input
81 | }
| ^
a.cc:13:1: note: to match this '{'
13 | {
| ^
a.cc:81:2: error: expected '}' at end of input
81 | }
| ^
a.cc:11:1: note: to match this '{'
11 | {
| ^
|
s499210511 | p00470 | C | #include<stdio.h>int main(void){
int i,j,w,h,a[101][101][2];
while(scanf("%d%d",&w,&h),w+h){
h++;w++;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if(i==1||j==1){
a[i][j][0]=1;
a[i][j][1]=1;
}else{
a[i][j][0]=0;
a[i][j][1]=0;
}
}
}
for(i=2;i<h;i++){
for(j=2;j<w;j++){
a[i][j][0]=a[i-2][j][1]+a[i][j-2][0]+a[i-2][j-1][1];
a[i][j]... | main.c:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>int main(void){
| ^~~
main.c:3:1: error: expected identifier or '(' before 'while'
3 | while(scanf("%d%d",&w,&h),w+h){
| ^~~~~
main.c:28:1: error: expected identifier or '(' before 'return'
28 | ... |
s167653722 | p00470 | C | #include<stdio.h>int main(void){
int i,j,w,h,a[101][101][2];
while(scanf("%d%d",&w,&h),w+h){
h++;w++;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if(i==1||j==1){
a[i][j][0]=1;
a[i][j][1]=1;
}else{
a[i][j][0]=0;
a[i][j][1]=0;
}
}
}
for(i=2;i<h;i++){
for(j=2;j<w;j++){
a[i][j][0]=a[i-2][j][1]+a[i][j-2][0]+a[i-2][j-1][1];
a[i][j]... | main.c:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>int main(void){
| ^~~
main.c:3:1: error: expected identifier or '(' before 'while'
3 | while(scanf("%d%d",&w,&h),w+h){
| ^~~~~
main.c:28:1: error: expected identifier or '(' before 'return'
28 | ... |
s453787822 | p00470 | C | #define Z 100
M[Z][Z][2],l=100000;main(w,h,i,j){
M[0][0][0]=M[0][0][1]=M[1][1][0]=M[1][1][1]=1;
for(i=1;i<Z;i++)M[i][0][0]=M[i-1][0][0],M[i][0][1]=0;
for(j=1;j<Z;j++)M[0][j][0]=0,M[0][j][1]=M[0][j-1][1];
for(i=1;i<Z;i++){
for(j=1;j<Z;j++)M[i][j][0]=(M[i-1][j][0]+M[i-1][j-1][1])%l,M[i][j][1]=(M[i][j-1][1]+M[i-1][j... | main.c:2:1: warning: data definition has no type or storage class
2 | M[Z][Z][2],l=100000;main(w,h,i,j){
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
main.c:2:12: error: type defaults to 'int' in declaration of 'l' [-Wimplicit-int]
2 | M[Z][Z][2],l=100000;main(w,h,i... |
s270276997 | p00470 | C++ | #include<iostream>
using namespace std;
#define MOD 100000;
int main(){
int x[101][101][2][2];
int h,w,sum;
while(true){
memset(x,0,sizeof(x));
for(int i=1;i<=100;i++){
x[i][1][0][0]=1;
}
for(int i=1;i<=100;i++){
x[1][i][1][0]=1;
}
cin>>h>>w;
if(h==0 && w==0){
break;
}
for(int i=2;i<=h;i... | a.cc: In function 'int main()':
a.cc:10:17: error: 'memset' was not declared in this scope
10 | memset(x,0,sizeof(x));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#... |
s116392264 | p00470 | C++ | #include<bits/stdc++.h>
using namespace std;
const int mod = 100000;
int main(){
int w,h;
while(cin >> w >> h, w){
int dp[100][100][2] = {};
dp[0][0][0] = dp[0][0][1] = 1;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if(i>0) dp[i][j][0] += dp[i-1][j][0]) %= mod;
if(i>1) dp[i][j][... | a.cc: In function 'int main()':
a.cc:14:45: error: expected ';' before ')' token
14 | if(i>0) dp[i][j][0] += dp[i-1][j][0]) %= mod;
| ^
| ;
a.cc:15:45: error: expected ';' before ')' token
15 | if(i... |
s031105569 | p00470 | C++ | # include <iostream>
# include <string>
constexpr int MAX_W = 100;
constexpr int MAX_H = 100;
constexpr int MOD = 100000;
int h, w;
int dp[MAX_H][MAX_W][4];
int main() {
while (1) {
std::cin >> w >> h;
if (w + h == 0)
break;
std::memset(dp, 0, sizeof(dp));
for (int i = 1; i < w; ++i)
dp[0][i][0] = 1;
... | a.cc: In function 'int main()':
a.cc:16:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
16 | std::memset(dp, 0, sizeof(dp));
| ^~~~~~
| wmemset
|
s841583247 | p00470 | C++ | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,b) for(int i=a; i<=b; i++)
#define FORR(i,a,b) for (int i=a; i>=b; i--)
typede... | a.cc:53:5: error: expected unqualified-id before 'return'
53 | return 0;
| ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
54 | }
| ^
|
s092018154 | p00470 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
using namespace std;
int a[101][101][3][3];//??????,??????,???????????????,?????????????????????0???1
int main(){
int h,w;
while(1){
scanf("%d%d",&w,&h);
if(w==0&&h==0)break;
memset(a,0,sizeof(a));
for(int i=1;i<101;i++... | a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
13 | memset(a,0,sizeof(a));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include<algorithm>
+++ |+... |
s347087680 | p00470 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
using namespace std;
int a[101][101][3][3];
int main(){
int h,w;
while(1){
scanf("%d%d",&w,&h);
if(w==0&&h==0)break;
memset(a,0,sizeof(a));
for(int i=1;i<101;i++){
a[1][i][0][0]=1;
a[i][1][1][1]=1;
}
for(int i... | a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
13 | memset(a,0,sizeof(a));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include<algorithm>
+++ |+... |
s455729790 | p00470 | C++ | #include<cstdio>
#define rep(i,a) for(i=0;i<a;i++)
int MOD=100000,i;
int main(){
int n,m;
while(scanf("%d%d",&n,&m),n){
int dp[110][110][2]={0};
dp[1][0][0]=dp[0][1][1]=1;
rep(i,n)rep(j,m)rep(k,2){
dp[i+1+k][j][0]=(dp[i+1+k][j][0]+dp[i][j][k])%MOD;
dp[i][j+1+(1^k)][1]=(dp[i][j+1+(1... | a.cc: In function 'int main()':
a.cc:9:21: error: 'j' was not declared in this scope
9 | rep(i,n)rep(j,m)rep(k,2){
| ^
a.cc:2:22: note: in definition of macro 'rep'
2 | #define rep(i,a) for(i=0;i<a;i++)
| ^
a.cc:9:29: error: 'k' was not declared in th... |
s681045590 | p00470 | C++ | #define rep(i,a) for(i=0;i<a;i++)
MOD=100000,i,j,k,n,m;
int main(){
while(scanf("%d%d",&n,&m),n){
int dp[110][110][2]={0};
dp[1][0][0]=dp[0][1][1]=1;
rep(i,n)rep(j,m)rep(k,2){
dp[i+1+k][j][0]=(dp[i+1+k][j][0]+dp[i][j][k])%MOD;
dp[i][j+1+(1^k)][1]=(dp[i][j+1+(1^k)][1]+dp[i][j][k])%MOD;
... | a.cc:2:1: error: 'MOD' does not name a type
2 | MOD=100000,i,j,k,n,m;
| ^~~
a.cc: In function 'int main()':
a.cc:4:25: error: 'n' was not declared in this scope
4 | while(scanf("%d%d",&n,&m),n){
| ^
a.cc:4:28: error: 'm' was not declared in this scope
4 | while(sc... |
s980832341 | p00470 | C++ | #include <iostream>
using namespace std;
const int mod = 100000;
int dp[102][102][4];
int main()
{
int w, h;
while (cin >> w >> h, w) {
memset(dp, 0, sizeof(dp));
dp[0][1][1] = 1;
dp[1][0][0] = 1;
for (int i = 0; i < h; ++i) {
for (int j = 0; j < w; ++j) {
... | a.cc: In function 'int main()':
a.cc:14:9: error: 'memset' was not declared in this scope
14 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cst... |
s285640435 | p00470 | C++ | #include<iostream>
#include<algorithm>
#define mod 100000
using namespace std;
int main(){
int w,h;
while(cin>>w>>h,w||h){
int dp[101][101][2][2]={{{{0}}}},sum=0;
dp[0][0][0][1]=dp[0][0][1][1]=1;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
... | a.cc:38:81: error: invalid digit "8" in octal constant
38 | Judge: 1/1 C++ CPU: 00.00 sec Memory: 1324 KB Length: 928 B 2014-12-08 19:42 2014-12-08 19:42
| ^~
a.cc:38:105: error: invalid digit "8" in octal consta... |
s827190324 | p00470 | C++ | #include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<cstdlib>
#include<list>
#include<set>
#include<numeric>
#include<intrin.h>
#define MOD 1000000007
using namespace std... | a.cc:16:9: fatal error: intrin.h: No such file or directory
16 | #include<intrin.h>
| ^~~~~~~~~~
compilation terminated.
|
s950857199 | p00470 | C++ | #include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<cstdlib>
#include<list>
#include<set>
#include<numeric>
#include<intrin.h>
#define MOD 1000000007
using namespace std... | a.cc:16:9: fatal error: intrin.h: No such file or directory
16 | #include<intrin.h>
| ^~~~~~~~~~
compilation terminated.
|
s001216990 | p00470 | C++ | #include <stdio.h>
int main(void){
int i,j,w,h;
while(scanf("%d%d",&w,&h),w,h){
unsigned __int64 dp[101][101][5]={0};
for(i=1;i<=h;i++) dp[i][1][4]=1;
for(j=1;j<=w;j++) dp[1][j][4]=1;
for(i=2;i<=h;i++){
for(j=2;j<=w;j++){
dp[i][j][0]=dp[i-1][j][3]+dp[i-1][j][4];
dp[i][j][1]=dp[i][j-1][2]+dp[... | a.cc: In function 'int main()':
a.cc:6:34: error: expected initializer before 'dp'
6 | unsigned __int64 dp[101][101][5]={0};
| ^~
a.cc:8:35: error: 'dp' was not declared in this scope
8 | for(i=1;i<=h;i++) dp[i][1][4]=1;
| ... |
s492698228 | p00470 | C++ | #include <cstring>
#include <iostream>
using namespace std;
inline int rem(int n) {
return n % 100000;
}
int main() {
for (;;) {
int w, h, streets[100][100][4];
cin >> w >> h;
if (!w && !h) return 0;
memset(streets, 0, sizeof streets);
streets[0][0] = { 1, 0, 1, 0 };
for (int i = 1; i < w... | a.cc: In function 'int main()':
a.cc:16:19: error: assigning to an array from an initializer list
16 | streets[0][0] = { 1, 0, 1, 0 };
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:18:21: error: assigning to an array from an initializer list
18 | streets[0][i] = { 1, 0, 0, 1 };
| ~~~~~~~~~... |
s216146855 | p00470 | C++ | #include <cstdio>
#include <algorithm>
const int mod = 100000;
const int maxx = 128, maxy = 128;
int main()
{
int w1[maxx][maxy] = {0};
int w2[maxx][maxy] = {0};
int s1[maxx][maxy] = {0};
int s2[maxx][maxy] = {0};
for(int i = 0; i < maxx)
w2[i][0] = 1;
for(int i = 0; i < maxy)
s2[0][i] = 1;
for(int x = 1; x < maxx)... | a.cc: In function 'int main()':
a.cc:14:24: error: expected ';' before ')' token
14 | for(int i = 0; i < maxx)
| ^
| ;
a.cc:16:24: error: expected ';' before ')' token
16 | for(int i = 0; i < maxy)
| ^
| ... |
s923446180 | p00470 | C++ | #include <cstdio>
#include <algorithm>
const int mod = 100000;
const int maxx = 128, maxy = 128;
int main()
{
int w1[maxx][maxy] = {0};
int w2[maxx][maxy] = {0};
int s1[maxx][maxy] = {0};
int s2[maxx][maxy] = {0};
for(int i = 0; i < maxx; ++i)
w2[i][0] = 1;
for(int i = 0; i < maxy; ++i)
s2[0][i] = 1;
for(int x = 1;... | a.cc: In function 'int main()':
a.cc:19:24: error: expected ';' before ')' token
19 | for(int x = 1; x < maxx) {
| ^
| ;
a.cc:20:24: error: expected ';' before ')' token
20 | for(int y = 1; y < maxy) {
| ^
| ... |
s327064504 | p00470 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
#define mod 100000
int w,h,memo[101][101][5];
int solve(int y,int x,int shine){
if(y<0 || y >= h || x < 0 || x >= w) return 0;
if(memo[y][x][shine]) return memo[y][x][shine];
if(y == h - 1 && x == w - 1) return 1;
if(!shine) //生きてる☆
return memo[y][... | a.cc: In function 'int main()':
a.cc:23:35: error: expected ';' before 'cout'
23 | fill_n(memo[0][0],101*101*4,0)
| ^
| ;
24 | cout << solve(0,0,0) % mod <<endl;
| ~~~~
a.cc: In function 'i... |
s602519017 | p00470 | C++ | #include <iostream>
using namespace std;
int dp[102][102][2];
void solve()
{
memset(dp, 0, sizeof(dp));
for(int i = 1; i <= 100; ++i)
{
dp[1][i][0] = 1;
dp[1][i][1] = 1;
dp[i][1][0] = 1;
dp[i][1][1] = 1;
}
for(int i = 2; i <= 100; ++i)
{
for(int j = 2; j <= 100; ++j)
{
dp[i][j][0] = (dp[i][j - 1]... | a.cc: In function 'void solve()':
a.cc:8:9: error: 'memset' was not declared in this scope
8 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cs... |
s234590141 | p00471 | Java | #include <math.h>
#include <utility>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int m;
int n;
int map[10][10] = {0};
int cnt = 0;
int churchx;
int churchy;
int dx[4] = {-1,1,0,0};
int dy[4] = {0,0,-1,1};
int saiki( int xinput, int yinput, int nokori ) {
for... | Main.java:1: error: illegal character: '#'
#include <math.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <math.h>
^
Main.java:2: error: illegal character: '#'
#include <utility>
^
Main.java:3: error: illegal character: '#'
#include <string>
^
Main.java:4: error: illegal character:... |
s770826861 | p00471 | C | #include <stdio.h>
int chousa(int[][],int,int,int,int,int);
int main(void) {
int x,y;
int map[10][10];
int m,n;
int kx,ky;
int kazu=0;
scanf("%d %d",&m,&n);
/*読み込み*/
for(y=0;y<n;y++) {
for(x=0;x<m;x++) {
scanf("%d",&map[x][y]);
if(map[x][y]==2) {/*教会*/
kx=x;
ky=y;
} else if(map[x][y]==1)kaz... | main.c:3:15: error: array type has incomplete element type 'int[]'
3 | int chousa(int[][],int,int,int,int,int);
| ^
main.c:3:15: note: declaration of multidimensional array must have bounds for all dimensions except the first
main.c: In function 'main':
main.c:23:30: error: type of formal parame... |
s919295326 | p00471 | C | #include <stdio.h>
int map[10][10];
int m,n;
int chousa(int kx,int ky,int nokori) {
int x,y;
int result=0;
int house=0;
if(map[kx][ky]==1) {/*今いる家を通ったことにする*/
map[kx][ky]=0;
house=1;
}
/*左に道順を調査*/
for(x=kx-1;x>=0;x--) {
/*家に降りる*/
if(map[x][ky]==1) {
result+=chousa(map,x,ky,nokori-1,m,n);
break;/*家... | main.c: In function 'chousa':
main.c:18:40: error: passing argument 1 of 'chousa' makes integer from pointer without a cast [-Wint-conversion]
18 | result+=chousa(map,x,ky,nokori-1,m,n);
| ^~~
| |
... |
s760478089 | p00471 | C | #include <stdio.h>
int map[10][10];
int m,n;
int chousa(int kx,int ky,int nokori) {
int x,y;
int result=0;
int house=0;
if(map[kx][ky]==1) {/*今いる家を通ったことにする*/
map[kx][ky]=0;
house=1;
}
/*左に道順を調査*/
for(x=kx-1;x>=0;x--) {
/*家に降りる*/
if(map[x][ky]==1) {
result+=chousa(map,x,ky,nokori-1,m,n);
break;/*家... | main.c: In function 'chousa':
main.c:18:40: error: passing argument 1 of 'chousa' makes integer from pointer without a cast [-Wint-conversion]
18 | result+=chousa(map,x,ky,nokori-1,m,n);
| ^~~
| |
... |
s416975233 | p00471 | C | #include<stdio.h>
bool hs[10][10];
bool used[10][10];
int cx,cy;
int nh;
int dx[4]={-1,0,1,0};
int dy[4]={0,1,0,-1};
int w,h;
int dfs(int x,int y,int f){
if(f==nh){
if(x==cx||y==cy)return 1;
return 0;
}
int i,j;
int res=0;
for(i=0;i<4;i++){
for(j=1;j<10;j++){
int nx=x+j*dx[i];
int ny=y+j*dy[i];
if(n... | main.c:2:1: error: unknown type name 'bool'
2 | bool hs[10][10];
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include<stdio.h>
+++ |+#include <stdbool.h>
2 | bool hs[10][10];
main.c:3:1: error: unknown type name 'b... |
s337696146 | p00471 | C++ | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <... | a.cc: In function 'int dfs(int, int)':
a.cc:37:44: error: expected ';' before 'return'
37 | if(l != -1 && num.count(MP(bit,l)) != 0 return memo[MP(bit,l)];
| ^~~~~~~
| ;
a.cc:39:5: error: expected primary-expression... |
s185126212 | p00471 | C++ | /* よいウンコードの例 *.
#include <cstdio>
#include <stack>
using namespace std;
#define EMPTY 0
#define YET_DELIVERED 1
#define CHURCH 2
#define DELIVERED 3
int m;
int n;
int count;
int house_num;
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
int map[10][10];
void rec(char x, char y) {
char i;
char times = 0;
... | a.cc:1:1: error: unterminated comment
1 | /* よいウンコードの例 *.
| ^
|
s967920217 | p00471 | C++ | #include<iostream>
#include<queue>
#include<vector>
#include <bitset>
using namespace std;
typedef pair<int, int> P;
int i, j, k;
int m, n;
int dp[25][1024 * 1024 * 16], town[11][11];
P p[25];
void bfs(int now, int flag);
int main() {
while (cin >> m >> n&& m && n) {
int s, count = 1;
memset(dp, 0, sizeof(dp));
... | a.cc: In function 'int main()':
a.cc:16:17: error: 'memset' was not declared in this scope
16 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <bitset>
+++ ... |
s533745277 | p00471 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#define rep(i,s,n) for(int i = (s); (n) > i; i+... | a.cc: In function 'int main()':
a.cc:95:28: error: cannot bind non-const lvalue reference of type 'std::map<std::pair<int, int>, int>&' to an rvalue of type 'std::map<std::pair<int, int>, int>'
95 | dp[t].swap(map<pii,int>());
| ^~~~~~~~~~~~~~
In file included from /u... |
s166012121 | p00471 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#define rep(i,s,n) for(int i = (s); (n) > i; i+... | a.cc: In function 'int main()':
a.cc:95:28: error: cannot bind non-const lvalue reference of type 'std::map<std::pair<int, int>, int>&' to an rvalue of type 'std::map<std::pair<int, int>, int>'
95 | dp[t].swap(map<pii,int>());
| ^~~~~~~~~~~~~~
In file included from /u... |
s834482322 | p00471 | C++ | #include <bits/stdc++.h>
template<typename T>
void fill_all(T& ar,const T& v){
ar=v;
}
template<typename T,size_t N,typename U>
void fill_all(T(& ar)[N],const U& v){
for(auto&i:ar){fill_all(i,v);}
}
int w,h;
const int goal = 23;
const int empty = 24;
int graph[25][4][25];//????????????
int map[10][10];
const bit... | a.cc:20:7: error: 'bitmax' does not name a type
20 | const bitmax = 1<<20;
| ^~~~~~
a.cc:22:12: error: 'bitmax' was not declared in this scope
22 | int dp[23][bitmax];
| ^~~~~~
a.cc: In function 'int func(int, int)':
a.cc:46:16: error: 'bitmax' was not declared in this scope
46 | ... |
s736916798 | p00471 | C++ | #include <bits/stdc++.h>
template<typename T>
void fill_all(T& ar,const T& v){
ar=v;
}
template<typename T,size_t N,typename U>
void fill_all(T(& ar)[N],const U& v){
for(auto&i:ar){fill_all(i,v);}
}
int w,h;
const int goal = 23;
const int empty = 24;
int graph[25][4][25];//????????????
int map[10][10];
const int... | a.cc: In function 'int func(int, int)':
a.cc:65:34: error: invalid operands of types 'int' and 'int [25]' to binary 'operator<<'
65 | if(bit&(1<<*iter)){
| ~^~~~~~~
| | |
| | in... |
s276958408 | p00471 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include... | a.cc: In function 'int main()':
a.cc:101:96: error: invalid types 'int[int]' for array subscript
101 | for (int i = 0; i < 11; i++)for (int j = 0; j < 11; j++)maze[i][j] = housecount[i][j] = 0;
| ^
|
s749354960 | p00471 | C++ | #include <bits/stdc++.h>
using namespace std;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int W, H, N = 0;
int mas[11][11];
int X[25], Y[25];
bool isin(int y, int x)
{
return (y >= 0 && x >= 0 && y < H && x < W);
}
int dfs(int y, int x, int bit)
{
int ret = 0;
if(bit == 0) return (1);
... | a.cc:40:1: error: 'bash' does not name a type
40 | bash-4.3(leia):~/syoribu/JOI/2017/sp/pr
| ^~~~
a.cc:41:13: error: '$' does not name a type
41 | 572:{ei1629}$ bc
| ^
a.cc:46:13: error: '$' does not name a type
46 | 573:{ei1629}$ cat Reindeer_with_no_sense_of_direction.cpp
| ... |
s862965281 | p00471 | C++ | #include<cstdio>
#include<vector>
using namespace std;
int ans;
int vec[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
int tab[12][12];
int wx,wy;
void solve(int nx,int ny,int rem){
for(int v=0;v<4;v++){
int nowx=nx,nowy=ny;
LA:
nowx+=vec[v][0],nowy+=vec[v][1];
if(!(0<=nowx&&nowx<wx&&0<=nowy&&no... | a.cc: In function 'void solve(int, int, int)':
a.cc:17:22: error: too many arguments to function 'void solve(int, int, int)'
17 | solve(nowx,nowy,wx,wy,rem-1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:6: note: declared here
8 | void solve(int nx,int ny,int rem){
| ^~... |
s177720496 | p00471 | C++ | #include <iostream>
#include <map>
#include <cmath>
#include <memory>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for(int i = 0; i < n; i++)
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int field[12][12];
int nums[12][12];
map<P, bo... | a.cc: In function 'int main()':
a.cc:57:5: error: 'memset' was not declared in this scope
57 | memset(nums, 0, sizeof(nums));
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <algorithm>
+++ |+#include <cstrin... |
s085707229 | p00471 | C++ | #include<iostream>
#include<cmath>
#define MAX 12
using namespace std;
int h,w;
int sum;
int sx,sy;
int dp[(1<<18)][23];
int s[MAX][MAX];
int housInd[MAX][MAX];
/*
2
1 3
0
*/
int dx[]={0,-1,0,1},dy[]={1,0,-1,0};
int func(int ny, int nx, int bit){
if(housInd[ny][nx] != -1 && bit < (1 << 18) && dp[bit][housInd[ny][nx]... | a.cc: In function 'int main()':
a.cc:41:17: error: 'memset' was not declared in this scope
41 | memset(dp,-1,sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cmath>
+++ |+#... |
s386242650 | p00471 | C++ | #include<iostream>
#include<cmath>
#include<stdlib.h>
#define MAX 12
using namespace std;
int h,w;
int sum;
int sx,sy;
int dp[(1<<18)][23];
int s[MAX][MAX];
int housInd[MAX][MAX];
/*
2
1 3
0
*/
int dx[]={0,-1,0,1},dy[]={1,0,-1,0};
int func(int ny, int nx, int bit){
if(housInd[ny][nx] != -1 && bit < (1 << 18) && dp[b... | a.cc: In function 'int main()':
a.cc:42:17: error: 'memset' was not declared in this scope
42 | memset(dp,-1,sizeof(dp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<stdlib.h>
+++ ... |
s975299219 | p00471 | C++ | #include<iostream>
#define MAX 11
using namespace std;
int h,w;
int sum;
int sx,sy;
int s[MAX][MAX];
int housInd[MAX][MAX];
int dx[]={0,-1,0,1},dy[]={1,0,-1,0};
int func(int ny, int nx, int bit){
// cout << "hi" << bit << endl;
int ret = 0;
bool isLast = bit == (1 << sum) - 1;
for (int i = 0; i < 4; i++) {
for... | a.cc: In function 'int main()':
a.cc:38:17: error: 'dp' was not declared in this scope; did you mean 'dy'?
38 | dp.clear();
| ^~
| dy
|
s248415725 | p00471 | C++ | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <map>
#define PLANE (-1)
#define HOUSE (1)
#define CHURCH (100)
int x, y;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int home[10][10];
int n;
map<int, int> memo[24];
int goChurch(int ty, int tx)
{
int i;
int my, mx;
for (i = 0; ... | a.cc:15:1: error: 'map' does not name a type
15 | map<int, int> memo[24];
| ^~~
a.cc: In function 'int dfs(int, int, int, int, char (*)[11])':
a.cc:41:9: error: 'memo' was not declared in this scope
41 | if (memo[pos].find(bit) != memo[pos].end()){
| ^~~~
a.cc:41:14: error: 'pos' was not d... |
s535454123 | p00471 | C++ | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#define PLANE (-1)
#define HOUSE (1)
#define CHURCH (100)
using namespace std;
int x, y;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int home[10][10];
int n;
map<int, int> memo[24];
int goChurch(int ty, int tx)
{
int i;
int my, m... | a.cc: In function 'int dfs(int, int, int, int, char (*)[11])':
a.cc:43:14: error: 'pos' was not declared in this scope
43 | if (memo[pos].find(bit) != memo[pos].end()){
| ^~~
|
s082548139 | p00471 | C++ | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#define PLANE (-1)
#define HOUSE (1)
#define CHURCH (100)
using namespace std;
int x, y;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int home[10][10];
int n;
map<int, int> memo[24];
int goChurch(int ty, int tx)
{
int i;
int my, m... | a.cc: In function 'int dfs(int, int, int, int, char (*)[11])':
a.cc:43:14: error: 'pos' was not declared in this scope
43 | if (memo[pos].find(bit) != memo[v].end()){
| ^~~
|
s212190706 | p00471 | C++ | #include<iostream>
using namespace std;
int x,y;
int map[10][10];
int hmx[24],hmy[24];
int gx,gy;
int home;
int ans;
bool hm[24];
int dx[5]={0,0,1,0,-1};
int dy[5]={0,1,0,-1,0};
void dfs(int mx,int my,int d,int ho2,int map2[10][10],int hmmx[24],int hmmy[24],bool hm2[24]){
if(ho2==0){
if(mx==gx || my==gy){
bool... | a.cc: In function 'int main()':
a.cc:110:17: error: 'memset' was not declared in this scope
110 | memset(hm,false,sizeof(hm));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.