submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s552961679 | p00168 | C++ | #include <iostream>
using namespace std;
long long dp[31];
int main(){
dp[0]=0;
dp[1]=1;
dp[2]=2;
dp[3]=4;
int i=4;
while(i<31){
dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
//cout << i << endl;
i++;
}
for(;;){
int n;
cin >> n;
if(n==0)return 0;
if(dp[n]%3650==0)
cout << (dp[n]/3650);... | a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s275517383 | p00168 | C++ | #include<iostream>
int dp[30];//段数ー1
int main(){
int n;
while(std::cin>>n,n){
memset(dp,0,sizeof(dp));
dp[0]=1;
dp[1]=2;
dp[2]=4;
for(int i=3;i<n;i++){
dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
}
if(dp[n-1]%365==0)std::cout<<dp[n-1]/3650<<std::endl;
else std::cout<<dp[n-1]/3650+1<<std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:17: 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>
+++ |+... |
s236756062 | p00168 | C++ | #include<iostream>
int dp[30];//段数ー1
int main(){
int n;
while(std::cin>>n,n){
std::memset(dp,0,sizeof(dp));
dp[0]=1;
dp[1]=2;
dp[2]=4;
for(int i=3;i<n;i++){
dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
}
if(dp[n-1]%365==0)std::cout<<dp[n-1]/3650<<std::endl;
else std::cout<<dp[n-1]/3650+1<<std::endl;
}
return... | a.cc: In function 'int main()':
a.cc:8:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
8 | std::memset(dp,0,sizeof(dp));
| ^~~~~~
| wmemset
|
s376888385 | p00168 | C++ | #include<iostream>
#include<vector>
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
void solve(){
int n;
long long a[30] = {1,2,4};
loop(i,3,30)a[i] = a[i-1] + a[i-2] + a[i-3];
while(cin>>n,n)
cout<<i+a[n-1]/3650<<endl;
}
int main(void){
solve();
return 0;
} | a.cc: In function 'void solve()':
a.cc:11:11: error: 'i' was not declared in this scope
11 | cout<<i+a[n-1]/3650<<endl;
| ^
|
s446662511 | p00168 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
const int MAX= 10000100;
#define loop(i,a,b) for(int i = a ; i < b ; i ++)... | a.cc: In function 'int main()':
a.cc:32:13: error: 'i' was not declared in this scope
32 | cout<<m[i]/3650 + 1 <<endl;
| ^
|
s545982095 | p00168 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int solve(int n);
int dp[100];
int main(){
int n;
while(cin >> n , n){
memset(dp,0,n+2);
int ans = solve(n);
cout << ans/365/10+1 << endl;
}
}
int solve(int n){
if(n == 0) return 1;
if(dp[n] != 0) return dp[n];
int cou=0;
for(int i=1;i<=3;i++){... | a.cc: In function 'int main()':
a.cc:11:17: error: 'memset' was not declared in this scope
11 | memset(dp,0,n+2);
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#incl... |
s108639663 | p00168 | C++ | #include<iostream>
using namespace std;
int main(){
int ans[31]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,6,10,19,34,62,113,207,381,701,1288,2369,4357,8014,14740}
while(1){
cin>>ans[0];
if(!ans[0])
return 0;
cout<<ans[ans[0]];
}
} | a.cc: In function 'int main()':
a.cc:5:3: error: expected ',' or ';' before 'while'
5 | while(1){
| ^~~~~
|
s468984210 | p00168 | C++ | #include<iostream>
using namespace std;
int n;
int mamo[31], ans[31];
int main(){
while(cin>>n){
if(!n)
return 0;
memo[0]=1;
memo[1]=1;
memo[2]=2;
for(int i=3;i<=n;i++){
if(!memo[i]){
memo[i]=memo[i-1]+memo[i-2]+memo[i-3];
}
}
if(memo[n]%3650)
ans[n]+=1;
an... | a.cc: In function 'int main()':
a.cc:9:5: error: 'memo' was not declared in this scope; did you mean 'mamo'?
9 | memo[0]=1;
| ^~~~
| mamo
|
s620743755 | p00168 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repn(i,n,m) for(int i=n;i<m;i++)
#define repn1(i,n,m) for(int i=n;i<=m;i++)
using namespace std;
... | a.cc: In function 'int main()':
a.cc:16:1: error: expected primary-expression before '?' token
16 | ????????????int n;
| ^
a.cc:16:2: error: expected primary-expression before '?' token
16 | ????????????int n;
| ^
a.cc:16:3: error: expected primary-expression before '?' token
16 | ????????????int ... |
s221283888 | p00168 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repn(i,n,m) for(int i=n;i<m;i++)
#define repn1(i,n,m) for(int i=n;i<=m;i++)
using namespace std;
... | a.cc: In function 'int main()':
a.cc:21:1: error: expected primary-expression before '?' token
21 | ????????????int dp[100] = {0};
| ^
a.cc:21:2: error: expected primary-expression before '?' token
21 | ????????????int dp[100] = {0};
| ^
a.cc:21:3: error: expected primary-expression before '?' token
... |
s175733348 | p00168 | C++ | include<iostream>
using namespace::std;
int fib(int n) {
int x[100];
x[0] = 0;
x[1] = 1;
x[2] = 2;
x[3] = 4;
for (int i = 4; i <= n; i++) {
x[i] = x[i - 3] + x[i - 2] + x[i - 1];
}
return x[n];
}
int main() {
cin >> n;
int ans;
int ama;
ans = n / 3;
ans = ans * 4;
if (n % 3 == 1) {
ans +=... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:24:9: error: 'cin' was not declared in this scope
24 | cin >> n;
| ^~~
a.cc:24:16: error: 'n' was not declared in this scope
24 | cin >> n;
| ... |
s866339118 | p00168 | C++ | #include <iostream>
using namespace std;
int main() {
int a[30];
a[0] = 1;
a[1] = 1;
a[2] = 2;
for ( int i = 3; i <= 30; i++ )
a[i] = a[i - 1] + a[i - 2] + a[i - 3];
while ( int n; cin >> n )
cout << a[n] << endl;
} | a.cc: In function 'int main()':
a.cc:11:22: error: expected initializer before ';' token
11 | while ( int n; cin >> n )
| ^
a.cc:11:22: error: expected ')' before ';' token
11 | while ( int n; cin >> n )
| ~ ^
| )
a.cc:... |
s965499362 | p00168 | C++ | #include <iostream>
using namespace std;
int main() {
int a[30];
a[0] = 1;
a[1] = 1;
a[2] = 2;
for ( int i = 3; i <= 30; i++ )
a[i] = a[i - 1] + a[i - 2] + a[i - 3];
while ( cin >> n ) {
int n;
cin >> n;
if ( n == 0 ) break;
cout << a[n] << endl;
}
} | a.cc: In function 'int main()':
a.cc:11:24: error: 'n' was not declared in this scope
11 | while ( cin >> n ) {
| ^
|
s446389794 | p00168 | C++ |
#include <algorithm>
#include <iostream>
using namespace std;
int A[128], n, a;
int main() {
while(cin >> n && n >0){
A[0] = 0;
A[1] = 1;
A[2] = 2;
for (int i=3; i<=n+10; ++i) {
A[i] = A[i-1]+A[i-2]+A[i-3];
}
a = (A[n]+9)/10
a = (a+364)/365;
cout << a <<endl;
}
} | a.cc: In function 'int main()':
a.cc:15:32: error: expected ';' before 'a'
15 | a = (A[n]+9)/10
| ^
| ;
16 | a = (a+364)/365;
| ~
|
s878851404 | p00168 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int A[128], n, a;
int main() {
while(cin >> n && n >0){
A[0] = 0;
A[1] = 1;
A[2] = 2;
for (int i=3; i<=n+10; ++i) {
A[i] = A[i-1]+A[i-2]+A[i-3];
}
a = int((A[n]+9)/10);
a = int(a+364)/365);
cout << a <<endl;
}
} | a.cc: In function 'int main()':
a.cc:15:35: error: expected ';' before ')' token
15 | a = int(a+364)/365);
| ^
| ;
|
s328918803 | p00168 | C++ |
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <iostream>
using namespace std;
int A[128], n;
int main() {
while(cin >> n && n >0){
A[0] = 0;
A[1] = 1;
A[2] = 2;
for (int i=3; i<=n+10; ++i) {
A[i] = A[i-1]+A[i-2]+A[i-3];
}
double a = floor((A[n]+9)/10);
double a = floor((a+364)/... | a.cc: In function 'int main()':
a.cc:18:24: error: redeclaration of 'double a'
18 | double a = floor((a+364)/365);
| ^
a.cc:17:24: note: 'double a' previously declared here
17 | double a = floor((A[n]+9)/10);
| ^
|
s459006285 | p00168 | C++ | #include <stdio.h> #include <iostream> #include <cstdio> using namespace std; int x, c=0; void dfs(int pos) { if (pos == 1) { c++; return; }else if (pos == 2) { c = c + 2; return; } else if (pos == 3) { c = c + 4; return; } else { dfs(pos - 1); dfs(pos - 2); dfs(pos - 3); } } int main() { while (1) { int days = 0, year... | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> #include <iostream> #include <cstdio> using namespace std; int x, c=0; void dfs(int pos) { if (pos == 1) { c++; return; }else if (pos == 2) { c = c + 2; return; } else if (pos == 3) { c = c + 4; return; } else { dfs(pos - 1); dfs(p... |
s303344450 | p00168 | C++ | #include <stdio.h> #include <iostream> #include <cstdio> using namespace std; int x, c=0; void dfs(int pos) { if (pos == 1) { c++; return; }else if (pos == 2) { c = c + 2; return; } else if (pos == 3) { c = c + 4; return; } else { dfs(pos - 1); dfs(pos - 2); dfs(pos - 3); } } int main() { while (1) { int days = 0, year... | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> #include <iostream> #include <cstdio> using namespace std; int x, c=0; void dfs(int pos) { if (pos == 1) { c++; return; }else if (pos == 2) { c = c + 2; return; } else if (pos == 3) { c = c + 4; return; } else { dfs(pos - 1); dfs(p... |
s616118965 | p00168 | C++ | #include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int memo[300];
int dp(int num);
int main(void){
while(1){
int n;
cin >> n;
if(n == 0) break;
memset(memo, -1, sizeof(memo));
cout << (int)ceil(dp(n) / 3650.0) << endl;
//cout << dp(n) << endl;
}
return 0;
}
int dp(int nu... | a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
15 | 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 <iostream>... |
s488661459 | p00168 | C++ | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
using namespace std;
int memo[300];
int dp(int num);
int main(void){
while(1){
int n;
cin >> n;
if(n == 0) break;
memset(memo, -1, sizeof(memo));
cout << (int)ceil(dp(n) / 3650.0) << endl;
//cout << dp(n) << endl;
}
return ... | a.cc: In function 'int main()':
a.cc:16:17: error: 'memset' was not declared in this scope
16 | memset(memo, -1, sizeof(memo));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <iostream>... |
s713298698 | p00168 | C++ | #include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int memo[300];
int dp(int num);
int main(void){
while(1){
int n;
cin >> n;
if(n == 0) break;
memset(memo, -1, sizeof(memo));
cout << (int)ceil(dp(n) / 3650.0) << endl;
//cout << dp(n) << endl;
}
return 0;
}
int dp(int nu... | a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
15 | 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 <iostream>... |
s245454436 | p00168 | C++ | #include <iostream>
#define INF_LL 9000000000000000000
#define INF 2000000000
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
class Union_find{
private:
vector<int> par;
vector<int> rank;
int n... | a.cc:17:9: error: 'vector' does not name a type
17 | vector<int> par;
| ^~~~~~
a.cc:18:9: error: 'vector' does not name a type
18 | vector<int> rank;
| ^~~~~~
a.cc: In constructor 'Union_find::Union_find(int)':
a.cc:25:25: error: 'par' was not declared in this scope
... |
s959826878 | p00168 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int A[32], N;
int main(){
A[0] = 1;
for (int i=1; i<=31; i++){
A[i] = A[i-1];
if (i>1) A[i] += A[i-2];
if (i>2) A[i] += A[i-3];
}
while (cin >> N && N!=0){
year = A[N]/365+1;
cout << year << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:17: error: 'year' was not declared in this scope
13 | year = A[N]/365+1;
| ^~~~
|
s562289271 | p00168 | C++ | // ConsoleApplication7.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#include "stdafx.h"
#include <iostream>
#include <cstring>
using namespace std;
int n, dp[32];
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
while (cin >> n, n) {
memset(dp, 0, size... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s562002386 | p00168 | C++ | #include <iostream>
using namespace std;
solve(int now){
if(now==0) return 1;
if(now<0) return 0;
long long res=solve(now-1)+solve(now-2)+solve(now-3);
retrun res;
}
int main(void){
int n;
cin>>n;
solve(n);
cout<<solve(n)/3650+1<<endl;
// Your code here!
} | a.cc:3:1: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
3 | solve(int now){
| ^~~~~
a.cc: In function 'int solve(int)':
a.cc:7:5: error: 'retrun' was not declared in this scope
7 | retrun res;
| ^~~~~~
a.cc:6:56: warning: control reaches end of non-void function [... |
s764956989 | p00168 | C++ | #include <iostream>
using namespace std;
long long solve(int now){
if(now==0) return 1;
if(now<0) return 0;
long long res=solve(now-1)+solve(now-2)+solve(now-3);
return res;
}
int main(void){
while(cin>>n&&n){
cout<<solve(n)/3650+1<<endl;
}
// Your code here!
} | a.cc: In function 'int main()':
a.cc:10:16: error: 'n' was not declared in this scope
10 | while(cin>>n&&n){
| ^
|
s468657015 | p00168 | C++ | #include<iostream>
int main(void){
int n;
int a[31]={};
a[0]=1;
a[1]=1;
a[2]=2;
for(int i=3;i<31;i++){
a[i]=a[i-1]+a[i-2]+a[i-3];
}
while(std::cin>>n){
if(n==0) break;
std::cout<<a[i]/3650+1<<std::endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:22: error: 'i' was not declared in this scope
14 | std::cout<<a[i]/3650+1<<std::endl;
| ^
|
s537839382 | p00168 | C++ | #include<iostream>
int main(void){
int n;
int a[31]={};
a[0]=1;
a[1]=1;
a[2]=2;
for(int i=3;i<31;i++){
a[i]=a[i-1]+a[i-2]+a[i-3];
}
while(std::cin>>n){
if(n==0) break;
std::cout<<a[i]/3650+1<<std::endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:22: error: 'i' was not declared in this scope
14 | std::cout<<a[i]/3650+1<<std::endl;
| ^
|
s113115214 | p00168 | C++ | #include<iostream>
int main(void){
int n;
int a[31]={};
a[0]=1;
a[1]=1;
a[2]=2;
for(int i=3;i<31;i++){
a[i]=a[i-1]+a[i-2]+a[i-3];
}
while(std::cin>>n){
if(n==0) break;
std::cout<<a[i]/3650+1<<std::endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:22: error: 'i' was not declared in this scope
14 | std::cout<<a[i]/3650+1<<std::endl;
| ^
|
s498686429 | p00168 | C++ | #include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
#include<sstream>
using namespace std;
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rr... | a.cc: In function 'int main()':
a.cc:64:10: error: expected '}' at end of input
64 | }
| ^
a.cc:36:11: note: to match this '{'
36 | int main(){
| ^
|
s472506354 | p00168 | C++ | #include <iostream>
using namespace std;
#define rep(i,x,to) for(int i=x;i<to;i++)
int main() {
int n,dp[30]={1,1,2};
while(1){
cin >> n;
if(n==0A) break;
rep(i,3,30){
dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
}
cout << dp[n]/3650+(dp[n]%3650!=0) << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:23: error: unable to find numeric literal operator 'operator""A'
9 | if(n==0A) break;
| ^~
|
s204335806 | p00168 | C++ | #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
int main(){
int dp[31];
int i,n:
dp[0]=1,dp[1]=1,dp[2]=2;
for(i=3;i<=30;i++){
dp[i]=dp[i-1]+dp[i-2]+... | a.cc: In function 'int main()':
a.cc:14:12: error: found ':' in nested-name-specifier, expected '::'
14 | int i,n:
| ^
| ::
a.cc:14:11: error: 'n' has not been declared
14 | int i,n:
| ^
a.cc:15:7: error: qualified-id in declaration before '[' token
15 ... |
s044137783 | p00168 | C++ | main()
{
int n,i;
int ans[64]={0};
ans[0]=ans[1]=1;
ans[2]=2;
for(i=3;i<31;i++)
ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
for(;;)
{
cin >> n ;
if(n==0)
break;
printf("%d\n",ans[n]/3650+1);
}
} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:14:17: error: 'cin' was not declared in this scope
14 | cin >> n ;
| ^~~
a.cc:17:17: error: 'printf' was not declared in this sc... |
s775206453 | p00168 | C++ | int main()
{
int n,i;
int ans[64]={0};
ans[0]=ans[1]=1;
ans[2]=2;
for(i=3;i<31;i++)
ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
for(;;)
{
cin >> n ;
if(n==0)
break;
printf("%d\n",ans[n]/3650+1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:17: error: 'cin' was not declared in this scope
14 | cin >> n ;
| ^~~
a.cc:17:17: error: 'printf' was not declared in this scope
17 | printf("%d\n",ans[n]/3650+1);
| ^~~~~~
a.cc:1:1: note: 'printf' ... |
s869638285 | p00168 | C++ | void main(){int n,i,ans[64]={0};ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)ans[i]=ans[i-1]+ans[i-2]+ans[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}} | a.cc:1:1: error: '::main' must return 'int'
1 | void main(){int n,i,ans[64]={0};ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)ans[i]=ans[i-1]+ans[i-2]+ans[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:117: error: 'scanf' was not declared in... |
s131740526 | p00168 | C++ | void main()
{
int n,i,ans[64];
ans[0]=ans[1]=1;
ans[2]=2;
for(i=3;i<31;i++)
ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
for(;;)
{
scanf("%d",&n);
if(n==0)
break;
printf("%d\n",ans[n]/3650+1);
}
} | a.cc:1:1: error: '::main' must return 'int'
1 | void main()
| ^~~~
a.cc: In function 'int main()':
a.cc:13:17: error: 'scanf' was not declared in this scope
13 | scanf("%d",&n);
| ^~~~~
a.cc:16:17: error: 'printf' was not declared in this scope
16 | ... |
s180801978 | p00168 | C++ | void main()
{
int n,i;
int ans[64]={0};
ans[0]=ans[1]=1;
ans[2]=2;
for(i=3;i<31;i++)
ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
for(;;)
{
scanf("%d",&n);
if(n==0)
break;
printf("%d\n",ans[n]/3650+1);
}
} | a.cc:1:1: error: '::main' must return 'int'
1 | void main()
| ^~~~
a.cc: In function 'int main()':
a.cc:14:17: error: 'scanf' was not declared in this scope
14 | scanf("%d",&n);
| ^~~~~
a.cc:17:17: error: 'printf' was not declared in this scope
17 | ... |
s598816632 | p00168 | C++ | #include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef ll long long int
ll rr(int ll){
if(y==0)
return 1;
else return y*rr(y-1);
}
ll func(ll i,ll j,ll k){
return rr(i+j+k)/(rr(i)*rr(j)*rr(k));
}
int main(){
ll n,sum,k;
while(cin>>n,n){
sum=0;
for(ll i=0;i*3<=n;i++)
for(ll j=0... | a.cc:4:9: error: 'll' does not name a type
4 | typedef ll long long int
| ^~
a.cc:10:1: error: 'll' does not name a type
10 | ll func(ll i,ll j,ll k){
| ^~
a.cc: In function 'int main()':
a.cc:14:9: error: 'll' was not declared in this scope
14 | ll n,sum,k;
| ^~
a.cc... |
s628512743 | p00168 | C++ | #include <iostream>
using namespace std;
int fib[100];
int fibonacci(int n){
if(!fib[n]) fib[n] = fibonacci(n-1) + fibonacci(n-2) + fibonacci(n-3);
return fib[n];
}
int main(){
int n;
memset(fib, 0, sizeof(fib));
fib[0] = fib[1] = 1;
fib[2] = 2;
while((cin >> n), n){
cout << (fibonacci(n)/3650 + 1)... | a.cc: In function 'int main()':
a.cc:13:3: error: 'memset' was not declared in this scope
13 | memset(fib, 0, sizeof(fib));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
... |
s364528531 | p00168 | C++ | #include <iostream>
using namespace std;
int dp[31];
const int DIV = 3650;
int main(void)
{
while(1){
int num;
cin >> num;
if(num == 0)
return 0;
memset(dp,0,sizeof(dp));
dp[0] = 1;
for(int i=1;i<=num;++i){//どの段から?
for(int j=1;j<=3;++j){//何段?
if(i-j < 0)
continue;
dp[i] += dp[i-j];
... | a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
15 | 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>
+++ ... |
s835685956 | p00168 | C++ | #include <iostream>
using namespace std;
int p[100];
int main(){
p[1] = 1;
p[2] = 2;
p[3] = 4;
for(int i = 4; i <= 30; i++){
p[i] = p[i-1] + p[i-2] + p[i-3];
}
int n;
while(cin >> n, n){Q
cout << p[n]/3650+1 << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:28: error: 'Q' was not declared in this scope
16 | while(cin >> n, n){Q
| ^
|
s214625666 | p00168 | C++ | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cst... | a.cc: In function 'int main()':
a.cc:41:36: error: expected ';' before numeric constant
41 | cout << (dp[n]/365)10 + 1 << endl;
| ^~
| ;
|
s279631672 | p00168 | C++ | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cst... | a.cc: In function 'int main()':
a.cc:41:36: error: expected ';' before numeric constant
41 | cout << (dp[n]/365)10 + 1 << endl;
| ^~
| ;
|
s862902131 | p00168 | C++ | include <iostream>
#include <algorithm>
using namespace std;
long long dp[33];
int main() {
int n;
while( cin >> n, n ) {
fill(dp, dp+32, 0);
dp[0] = 1, dp[1] = 1, dp[2] = 2;
for(int i=3; i<=n; i++) {
dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
}
cout << dp[n]/3650+1 << endl;
}
retur... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __... |
s805408572 | p00168 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int dp[32];
int ans;
memset(dp, 0, sizeof(dp));
while(n>0){
cin >> n;
for(int i=1; i<=n; i++){
if(i==1 || i==2 ){dp[i] = i;}
else if(i==3){dp[i] = 4;}
else{
dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
}
}
ans = dp[n] / 3650;
if(dp[n... | a.cc: In function 'int main()':
a.cc:11:9: error: 'memset' was not declared in this scope
11 | 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 <cstr... |
s650822960 | p00168 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n;
int dp[32];
int ans;
memset(dp, 0, sizeof(dp));
while(n>0){
cin >> n;
for(int i=1; i<=n; i++){
if(i==1 || i==2 ){dp[i] = i;}
else if(i==3){dp[i] = 4;}
else{
dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
}
}
ans = dp[n] ... | a.cc: In function 'int main()':
a.cc:12:9: error: 'memset' was not declared in this scope
12 | 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 <cstr... |
s202365509 | p00168 | C++ | include<iostream>
using namespace std;
int main(){
int n,c=0;
while(true){
cin>>n;
if(n==0)
break;
int dp[n+1];
for(int i=0;i<n+1;i++){
if(i==0){
dp[i]=1;
}
if(i==1){
dp[i]=1;
}
if(i==2){
dp[i]=2;
}
}
for(int i=3;i<n+1;i++){
dp[i]=dp[i-1]+dp[i-2]+d... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin>>n;
| ^~~
a.cc:27:5: error: 'cout' was not declared in this scope
27 | cout<<endl;
| ^~~~
a.cc:27:11: err... |
s407380358 | p00168 | C++ | #include <iostream>
using namespace std;
int main() {
int a[100]={0};
a[0]=1;
a[1]=1;
a[2]=2;
int n;
while(cin <<n){
int x;
x=0;
for(int i=3;i<n;i++){
a[i]=a[i-3]+a[i-2]+a[i-1];
}
x=a[n]%3650;
x=x+1;
cout >> x;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:15: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
10 | while(cin <<n){
| ~~~ ^~~
| | |
| | int
| std::istream {aka std::basic_istream<ch... |
s037519021 | p00168 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int n;
int dp[35][35];
void solve() {
memset(dp, 0, sizeof(dp));
dp[0][0] = 1;
for (int i=0; i<n; i++) {
for (int j=0; j<=n; j++) {
if (j>=1) dp[i+1][j] += dp[i][j-1];
if (j>=2) dp[i+1][j] += dp[i][j-2];
if (j>=3) dp[i+1][j] += dp[i][j-3];
... | a.cc: In function 'void solve()':
a.cc:11:9: error: 'memset' was not declared in this scope
11 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cmath>
+++ |+#include <cstr... |
s703427119 | p00169 | Java | import java.util.Arrays;
import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
for (;;) {
String[] s = sc.nextLine().split(" ");
int n = s.length;
int[] l = new int[n];
for (int i = 0;... | Main.java:4: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s429885611 | p00169 | C | #include<stdio.h>
#include<math.h>
int main(){
int score = 0;
int point = 0;
for (score = 0; score < 21;)
{
if (score > 21)
{
score = 0;
}
else
{
scanf_s("%d", &point);
if (point == 1)
{
if (score < 11)
{
point = 11;
}
}
score += point;
printf("現在のスコア = %d", sc... | main.c: In function 'main':
main.c:18:25: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
18 | scanf_s("%d", &point);
| ^~~~~~~
| scanf
|
s237521312 | p00169 | C | #include<cstdio>
#include<sstream>
#define MAX(x,y) ((x>y)?x:y)
using namespace std;
int main(){
int i,j,x,sum,f,ans;
char s[200];
while(fgets(s,200,stdin)!=NULL){
istringstream ss(s);
f=sum=0;
while(ss>>x){
if(x==0)goto fin;
if(x==1)f++;
else if(x>9)sum+=10;
else sum+=x;
}
ans=0;
for(i=0;... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s787996032 | p00169 | C++ | #include<bits/stdc++.h>
using namespace std;
int power(int n)
{
???int num=1;
???for(int i=0;i<n;i++)num*=10;
???return num;
}
int serch(int sum,int n)
{
???if(sum>21)return 0;
???else if(n==0)return sum;
???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
}
int main()
{
???string str;
???while(getline(cin,str)){
?... | a.cc: In function 'int power(int)':
a.cc:5:1: error: expected primary-expression before '?' token
5 | ???int num=1;
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ???int num=1;
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ???int num=1;
| ^... |
s734757297 | p00169 | C++ | #include<bits/stdc++.h>
using namespace std;
int power(int n)
{
???int num=1;
???for(int i=0;i<n;i++)num*=10;
???return num;
}
int serch(int sum,int n)
{
???if(sum>21)return 0;
???else if(n==0)return sum;
???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
}
int main()
{
???string str;
???while(getline(cin,str)){
?... | a.cc: In function 'int power(int)':
a.cc:5:1: error: expected primary-expression before '?' token
5 | ???int num=1;
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ???int num=1;
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ???int num=1;
| ^... |
s625155652 | p00169 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
while(getline(cin,s),s!="0"){
stringstream ss(s);
int x=0,i,ans;
int si=0;
vector<int> v;
v.clear();
v.push_back(0);
while(ss>>x){
si=v.size();
for(i=0;i<si;i++){
if(x==1){
k=v[i];
v.push_back(k+... | a.cc: In function 'int main()':
a.cc:18:11: error: 'k' was not declared in this scope
18 | k=v[i];
| ^
|
s176045833 | p00169 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
while(getline(cin,s)&&s!="0"){
s.push_back(' ');
int one=0;
int sum=0;
string a;
for(int i=0;i<s.size();i++){
if(s[i]==' '){
int b=to_string(a);
if(b==1)one++;
else if(b>10)sum+=10;
else sum+=b;
}
else a.push_ba... | a.cc: In function 'int main()':
a.cc:14:48: error: no matching function for call to 'to_string(std::string&)'
14 | int b=to_string(a);
| ~~~~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++... |
s205880943 | p00169 | C++ | #include<bits/stdc++.h>
using namespace std;
int stoi(string a){
int ret;
stringstream ss;
ss<<a;
ss>>ret;
return ret;
}
int main(){
string s;
while(getline(cin,s)&&s!="0"){
s.push_back(' ');
int one=0;
int sum=0;
string a;
for(int i=0;i<s.size();i++){
if(s[i]==' '){
int b=stoi(a);
if(... | a.cc: In function 'int main()':
a.cc:22:43: error: call of overloaded 'stoi(std::string&)' is ambiguous
22 | int b=stoi(a);
| ~~~~^~~
a.cc:4:5: note: candidate: 'int stoi(std::string)'
4 | int stoi(string a){
| ^~~~
In file inc... |
s960953624 | p00169 | C++ |
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main()
{
string s;
char *c;
int i, score, ace;
while (getline(cin,s)) {
if (s[0]=='0') break;
score = 0;
ace = 0;
c = strtok((char*)s.c_str(), " ");
while (c != NULL) {
if (atoi(c) > 9) score += 10;
... | a.cc: In function 'int main()':
a.cc:16:9: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
16 | c = strtok((char*)s.c_str(), " ");
| ^~~~~~
| strtoq
|
s924730647 | p00169 | C++ | #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
char c[256];
int d[100],i,s,p,f;
while(true) {
for (i=0;i<255;i++) c[i]=1;
i=p=0;
gets(c);
if (c[0]=='0') break;
while(true) {
if (c[p+2]==' ' || c[p+2]=='\0') { d[i]=(c[p]-'0')*10+(c[p+1]-'0'); p+=3;}
else if (c[p+1]==' ' || c[p+1]==... | a.cc: In function 'int main()':
a.cc:10:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(c);
| ^~~~
| getw
a.cc:23:11: error: expected '}' at end of input
23 | return 0;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s758544186 | p00169 | C++ | 1#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#d... | a.cc:1:2: error: stray '#' in program
1 | 1#include <iostream>
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1#include <iostream>
| ^
In file included from /usr/include/c++/14/cmath:45,
from a.cc:5:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'co... |
s419870720 | p00170 | Java | import java.util.*;
public class Main {
int n, sum;
String[] f;
int[] w, s, memo, ans;
double min;
public void loop(int m, int gsum, int wsum){
if(m==n){
if(min>(double)gsum/wsum){
min = (double)gsum/wsum;
for(int i=0;i<n;i++) ans[i] = memo[i];
}
return;
}
for(int i=0;i<n;i++){
bool... | Main.java:59: error: cannot find symbol
new Main.run();
^
symbol: class run
location: class Main
1 error
|
s072529258 | p00170 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <sstream>
using namespace std;
const int MAX= 10000100;
#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin()... | a.cc: In function 'int ans(int, int)':
a.cc:36:7: error: 'i' was not declared in this scope
36 | for (i=m-1;i>=0;i--) {
| ^
|
s410265468 | p00170 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int n, w[1000], s[1000];
string S[1000]; vector<int>b; int maxn = 100000000;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> S[i] >> w[i] >> s[i];
}
vector<int>a(n, 0);
for (int i = 0; i < n; i++)a[i] = i;
... | a.cc: In function 'int main()':
a.cc:26:9: error: jump to label 'E'
26 | E:;
| ^
a.cc:21:46: note: from here
21 | if (sum > s[i]) goto E;
| ^
a.cc:23:21: note: crosses initialization of 'int sum2'
23 | ... |
s481760686 | p00170 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int n,sum,ret;
int info[10][10];
vector<int> data;
while(cin >> n && n){
data.clear();
rep(i,n)data.push_back(i);
rep(i,10)rep(j,10)info[i][j] ... | a.cc: In function 'int main()':
a.cc:28:46: error: expected ';' before 'sum'
28 | for(int i=0;i
| ^
| ;
29 | sum += info[data[i]][data[i+1]];
... |
s802796557 | p00170 | C++ | #include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef pair<pair<int,int>,string> item;
main(){
int n,i,w,s,S;
string f;
for(;cin>>n,n;){
vector<item> items,result;
for(i=0;i<n;i++)cin>>f>>w>>s,items.push_back(make_pair(make_pair(w,s),f));
sort(items.begin(),items.end());
S=9999... | 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:12:17: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(items.begin(),items.end());
| ^~~~
|... |
s455550710 | p00171 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
string pat[24] =
{
"123","135","154","142",
"231","214","246","263",
"326","365","351","312",
"421","415","456","462",
"513","536","564","541",
"624","645","653","632"
};
string dice[8];
bool u... | a.cc:19:13: error: 'int select [8]' redeclared as different kind of entity
19 | int select[8];
| ^
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 /usr/i... |
s732368663 | p00171 | C++ |
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
std::vector<std::string> buf(8);
//Eñ]ÉiÞûüųÊÌCfbNXÆAEÌCfbNXðwèµÄãÌCfbNXðÔ·
int uppderindex(int front, int right){
int table[][6] = {
{0, 3, 5, 2, 4, 0},
{4, 0, 1, 6, 0, 3},
{2, 6, 0, 0, 1... | a.cc: In function 'int aroundindex(int, int)':
a.cc:38:13: error: declaration of 'tbl' as multidimensional array must have bounds for all dimensions except the first
38 | int tbl[][] = {
| ^~~
a.cc:46:16: error: 'tbl' was not declared in this scope
46 | return tbl[front][idx];
... |
s217315472 | p00171 | C++ | #include <iostream>
#include <string>
using namespace std;
char data[24][6] = {{0, 1, 2, 3, 4, 5}, {0, 3, 1, 4, 2, 5}, {0, 4, 3, 2, 1, 5}, {0, 2, 4, 1, 3, 5},
{1, 5, 2, 3, 0, 4}, {1, 3, 5, 0, 2, 4}, {1, 0, 3, 2, 5, 4}, {1, 2, 0, 5, 3, 4},
{2, 5, 4, 1, 0, 3}, {2, 1, 5, 0, 4, 3}, {2, 0, 1, 4, 5, 3}, {2, 4,... | a.cc: In function 'bool solve(int)':
a.cc:41:21: error: reference to 'size' is ambiguous
41 | for(int k=0;k<size[pos];k++){
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/includ... |
s985644771 | p00171 | C++ | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
char data[24][6] = {{0, 1, 2, 3, 4, 5}, {0, 3, 1, 4, 2, 5}, {0, 4, 3, 2, 1, 5}, {0, 2, 4, 1, 3, 5},
{1, 5, 2, 3, 0, 4}, {1, 3, 5, 0, 2, 4}, {1, 0, 3, 2, 5, 4}, {1, 2, 0, 5, 3, 4},
{2, 5, 4, 1, 0, 3}, {2, 1, 5, 0, 4, 3}, {2, 0, 1,... | a.cc: In function 'bool solve(int)':
a.cc:42:21: error: reference to 'size' is ambiguous
42 | for(int k=0;k<size[pos];k++){
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/includ... |
s558629654 | p00172 | C | #define M 32768
n,D[15],S[15],P[15][M],R[15][M],Q[15*M];E(c,p,I){int r,s,J;if(~P[p][I]){if(r=P[p][I],E(c+1,s=r/M,J=r%M),s-p&&printf("Move to room %d.\n",p+1),J-I){for(r=0;J^I^1<<r;r++);printf("Switch o%s room %d.\n",I&1<<r?"n":"ff",r+1);}}elseprintf("You can go home in %d steps.\n",c);}J,q,m,s,r,e;main(p,I){for(;scanf(... | main.c:2:1: warning: data definition has no type or storage class
2 | n,D[15],S[15],P[15][M],R[15][M],Q[15*M];E(c,p,I){int r,s,J;if(~P[p][I]){if(r=P[p][I],E(c+1,s=r/M,J=r%M),s-p&&printf("Move to room %d.\n",p+1),J-I){for(r=0;J^I^1<<r;r++);printf("Switch o%s room %d.\n",I&1<<r?"n":"ff",r+1);}}elseprintf("You can go ... |
s223844938 | p00172 | C++ | import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;
int lsb(int x) {
int c = 0;
while (x ... | a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import std.c.stdio;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: ... |
s037316158 | p00172 | C++ | // AOJ 0172: Doctor's Research Rooms
// 2018.1.24 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MOVE 0x40
#define ON 0x50
#define OFF 0x60
#define QMAX 300000
typedef struct { char rm; int light; char step, act[50]; } Q;
Q q[QMAX+2]; int top, end;
int rm[15][15], s_rm[15];
int sw[15... | a.cc:21:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
21 | "You can go home in %d steps.\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
22 | "You can not switch off all lights.",
... |
s411466501 | p00172 | C++ | #include<iostream>
#include<vector>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++)
#define mp make_pair
using namespace std;
typedef vector<int> vi;
int main(){
int m,n,t,u;
while(cin>>n>>m,n){
vector<vi> dr(n,n),sw(n);
rep(i,m)cin>>t>>... | a.cc: In function 'int main()':
a.cc:12:34: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int&, int&)'
12 | vector<vi> dr(n,n),sw(n);
| ^
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/in... |
s810958807 | p00172 | C++ | include <iostream>
#include <stdlib.h>
#include <stack>
using namespace std;
int r[1050000],rp[2][1050000],sw[2][1050000],rb[2],bf;
int main() {
int a,i,j,k,g,m,n,s,t,f,f2,rl[16][16],rs[16][16],sn[16],lc[16],p=65536;
stack<int> an,bn;
while(cin >> n >> m) {
if (n==0) break;
for (i=0;i<1050000;i++) r[i]=-1;
... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/deque:62,
from /usr/include/c++/14/stack:62,
from a.cc:3:
/usr/include/c++/14/ext/type_... |
s893463719 | p00173 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str;
int am, pm;
for(int i = 0; i < 9; i++){
str = scan.next();
am = scan.nextInt();
pm = scan.nextInt();
System.out.println(str + " " + am + pm + " " + am * 200 + pm... | Main.java:15: error: reached end of file while parsing
}
^
1 error
|
s909165304 | p00173 | Java | import java.util.*;
public class HauntedHouse {
static Scanner sc = new Scanner(System.in);
static String[] name = new String[9];
static int[][] Array = new int[9][2];
public static void main(String[] args) {
for(int i = 0; i < 9; i++){
read();
slove();
}
}
static boolean read(){
String line;
Str... | Main.java:2: error: class HauntedHouse is public, should be declared in a file named HauntedHouse.java
public class HauntedHouse {
^
1 error
|
s718102021 | p00173 | Java | import java.util.*;
public class HauntedHouse {
static Scanner sc = new Scanner(System.in);
static String[] name = new String[9];
static int[][] Array = new int[9][2];
public static void main(String[] args) {
for(int i = 0; i < 9; i++){
read();
slove();
}
}
static boolean read(){
String line;
Str... | Main.java:2: error: class HauntedHouse is public, should be declared in a file named HauntedHouse.java
public class HauntedHouse {
^
1 error
|
s898759674 | p00173 | Java | import java.util.*;
public class aoj0173 {
static final Scanner stdin = new Scanner(System.in);
public static void main(String[] args) {
int i = 9;
while(i-- > 0){
String s = stdin.next();
int a = stdin.nextInt(), b = stdin.nextInt();
System.out.println(s + " " + (a+b) + " " + (200*... | Main.java:2: error: class aoj0173 is public, should be declared in a file named aoj0173.java
public class aoj0173 {
^
1 error
|
s873402336 | p00173 | Java | import java.util.*;
public Main {
public static void main(String[] args) {
static Scanner stdin = new Scanner(System.in);
int i = 9;
while(i-- > 0){
String s = stdin.next();
int a = stdin.nextInt(), b = stdin.nextInt();
System.out.println(s + " " + (a+b) + " " + (200*a... | Main.java:2: error: class, interface, enum, or record expected
public Main {
^
Main.java:3: 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:4: error: illegal start... |
s447514821 | p00173 | Java | import java.util.*;
public Main {
public static void main(String[] args) {
static final Scanner stdin = new Scanner(System.in);
int i = 9;
while(i-- > 0){
String s = stdin.next();
int a = stdin.nextInt(), b = stdin.nextInt();
System.out.println(s + " " + (a+b) + " " + (... | Main.java:2: error: class, interface, enum, or record expected
public Main {
^
Main.java:3: 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:4: error: illegal start... |
s908088232 | p00173 | Java | import java.util.*;
public Main {
static final Scanner stdin = new Scanner(System.in);
public static void main(String[] args) {
int i = 9;
while(i-- > 0){
String s = stdin.next();
int a = stdin.nextInt(), b = stdin.nextInt();
System.out.println(s + " " + (a+b) + " " + (200*a+300*b));... | Main.java:2: error: class, interface, enum, or record expected
public Main {
^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
static final Scanner stdin = new Scanner(System.in);
^
(use --enable-preview to enable unnamed classes)
Main.java:12: error: class... |
s434253617 | p00173 | C | #include<stdio.h>
int main(void){
char c[8][1];
int a[8] ={0},b[8] = {0},i;
for(i=0;i<8;i++){
scanf("%d%d %d %d",&c[i][0],&c[i][1],&a[i],&b[i]);
}
for(i=0;i<8;i++){
printf("%d%d %d %d\n",c[i][0],c[i]c[1],a[i]+b[i],a[i]*200+b[i]*300);
}
} | main.c: In function 'main':
main.c:9:51: error: expected ')' before 'c'
9 | printf("%d%d %d %d\n",c[i][0],c[i]c[1],a[i]+b[i],a[i]*200+b[i]*300);
| ~ ^
| )
|
s839645838 | p00173 | C | #include<stdio.h>
int main(void){
char c[8][1];
int a[8] ={0},b[8] = {0},i;
for(i=0;i<8;i++){
scanf("%s%s %d %d",&c[i][0],&c[i][1],&a[i],&b[i]);
}
for(i=0;i<8;i++){
printf("%s%s %d %d\n",c[i][0],c[i]c[1],a[i]+b[i],a[i]*200+b[i]*300);
}
} | main.c: In function 'main':
main.c:9:51: error: expected ')' before 'c'
9 | printf("%s%s %d %d\n",c[i][0],c[i]c[1],a[i]+b[i],a[i]*200+b[i]*300);
| ~ ^
| )
|
s103073387 | p00173 | C | #include <stdio.h>
#include <string.h>
int main(void) {
int i,m,n,l,k;
char str[200],s[5];
for( ;fgets(str,sizeof(str),stdin)!=NULL;){
sscanf(str,"%s %d %d",&s,&n,&m);
l=n+m; k=n*200+m*300
printf("%s %d %d\n",&s,l,k);
}
return 0;
} | main.c: In function 'main':
main.c:10:37: error: expected ';' before 'printf'
10 | l=n+m; k=n*200+m*300
| ^
| ;
11 | printf("%s %d %d\n",&s,l,k);
| ~~~~~~
|
s798783525 | p00173 | C | main(){char s[20];for(int a,b;~scanf("%s%d%d",s,&a,&b);printf("%s %d %d\n",s,a+b,a*200+b*300));} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){char s[20];for(int a,b;~scanf("%s%d%d",s,&a,&b);printf("%s %d %d\n",s,a+b,a*200+b*300));}
| ^~~~
main.c: In function 'main':
main.c:1:32: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(... |
s900619265 | p00173 | C | #include<stdio.h>
int main(){
int i;
char str[15];
int am;
int pm;
for(i = 0; i < 9; i++){
scanf("%s", str);
scanf("%d", &am);
scanf("%d", &pm);
printf("%s %d %d\n", str, am + pm, a * 200 + a * 300);
}
return 0;
} | main.c: In function 'main':
main.c:12:52: error: 'a' undeclared (first use in this function); did you mean 'am'?
12 | printf("%s %d %d\n", str, am + pm, a * 200 + a * 300);
| ^
| am
main.... |
s126480676 | p00173 | C | d=400;main(a,b){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d\n",c,a+b,a*200+b*300))b=b/d?d:b;} | main.c:1:1: warning: data definition has no type or storage class
1 | d=400;main(a,b){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d\n",c,a+b,a*200+b*300))b=b/d?d:b;}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:1:7: error: return type defaults... |
s714800394 | p00173 | C | a,b,d=400;main(){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d00\n",c,a+b,a*2+b*3))b=b/d?d:b;} | main.c:1:1: warning: data definition has no type or storage class
1 | a,b,d=400;main(){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d00\n",c,a+b,a*2+b*3))b=b/d?d:b;}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int... |
s207532121 | p00173 | C | a,b,d=400;char c[d];main(){for(;~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d00\n",c,a+b,a*2+b*3))b=b/d?d:b;} | main.c:1:1: warning: data definition has no type or storage class
1 | a,b,d=400;char c[d];main(){for(;~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d00\n",c,a+b,a*2+b*3))b=b/d?d:b;}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'in... |
s573274932 | p00173 | C++ | using System;
class main {
public static void Main(string[] args) {
for(int i=0; i<9; i++) {
var input = Console.ReadLine().Split();
int a = int.Parse(input[1]);
int b = int.Parse(input[2]);
Console.WriteLine("{0} {1} {2}", input[0], a+b, a*200+b*300);
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:4:15: error: expected ':' before 'static'
4 | public static void Main(string[] args) {
| ^~~~~~~
| :
a.cc:4:33: error: 'string' has not been declared
4 ... |
s125792103 | p00173 | C++ | 1a 132 243
1c 324 183
1f 93 199
2b 372 163
2c 229 293
2e 391 206
3a 118 168
3b 263 293
3d 281 102 | a.cc:6:1: error: exponent has no digits
6 | 2e 391 206
| ^~
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1a 132 243
| ^~
|
s645787917 | p00173 | C++ | #include <iostream>
#include <string>
#define N 9
using namespace std;
int main() {
string name;
int a, b;
while (N--) {
int am = 200, pm = 300;
cin >> name >> a >> b;
int num = a+b;
int fee = a*am+b*pm;
cout << name << " " << num << " " << fee << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:3:11: error: lvalue required as decrement operand
3 | #define N 9
| ^
a.cc:9:10: note: in expansion of macro 'N'
9 | while (N--) {
| ^
|
s577138022 | p00173 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string a[9];
int b[9];
int c[9];
for (int i = 0; i < 9; i++){
cin >> a[i] >> b[i] >> c[i];
}
for (int i = 0; i < 9; i++){
cout >> a[i] >>" ">> b[i] + c[i] >>" ">> b[i] * 200 + c[i] * 200 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:22: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
12 | cout >> a[i] >>" ">> b[i] + c[i] >>" ">> b[i] * 200 + c[i] * 200 << endl;
| ... |
s630340155 | p00173 | C++ | 1a 132 243
1c 324 183
1f 93 199
2b 372 163
2c 229 293
2e 391 206
3a 118 168
3b 263 293
3d 281 102 | a.cc:6:1: error: exponent has no digits
6 | 2e 391 206
| ^~
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1a 132 243
| ^~
|
s362819953 | p00173 | C++ | using namespace std;
int main(int argc, char const* argv[])
{
string name;
int a,b;
for( int i = 0;i < 9;i++ ){
cin >> name >> a >> b;
cout << name << " " << a + b << " " << a * 200 + b * 300 << endl;
}
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:5:9: error: 'string' was not declared in this scope
5 | string name;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using name... |
s558841605 | p00173 | C++ | #include <stdio.h>
int main(void) {
int am,pm;
char class[20];
while(scanf("%s %d %d",class,&am,&pm)!=EOF) {
printf("%s %d %d\n",class,am+pm,am*200+pm*300);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: two or more data types in declaration of 'structured binding'
6 | char class[20];
| ^~~~
a.cc:6:13: error: empty structured binding declaration
6 | char class[20];
| ^
a.cc:6:3: error: expected primary-expression before 'char'
6 ... |
s747874534 | p00173 | C++ | #include <stdio.h>
int main(void) {
int am,pm;
char class[20];
int i;
for(i=0;i<9;i++) {
scanf("%s %d %d",class,&am,&pm);
printf("%s %d %d\n",class,am+pm,am*200+pm*300);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: two or more data types in declaration of 'structured binding'
6 | char class[20];
| ^~~~
a.cc:6:13: error: empty structured binding declaration
6 | char class[20];
| ^
a.cc:6:3: error: expected primary-expression before 'char'
6 ... |
s182828643 | p00173 | C++ | include<cstdio>
int a,b,d=400;int main(){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d\n",c,a+b,a*200+b*300))b=b/d?d:b;} | a.cc:1:1: error: 'include' does not name a type
1 | include<cstdio>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:2:37: error: 'd' was not declared in this scope
2 | int a,b,d=400;int main(){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d\n",c,a+b,a*200+b*300))b=b/d?d:b;}
| ... |
s973309598 | p00173 | C++ | include<cstdio>
int a,b,d=400;int main(){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d\n",c,a+b,a*200+b*300))b=b/d?d:b;} | a.cc:1:1: error: 'include' does not name a type
1 | include<cstdio>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:2:37: error: 'd' was not declared in this scope
2 | int a,b,d=400;int main(){for(char c[d];~scanf("%s%d%d",c,&a,&b);a=a/d?d:a,printf("%s %d %d\n",c,a+b,a*200+b*300))b=b/d?d:b;}
| ... |
s372208787 | p00174 | C | a,b,p;main(c){for(;c=48-getchar();p=c)p<38?c-38?c%2?a++:b++:(a>b?a++:b++,a=b=!printf("%d %d\n",a,b)):0;exit(0)} | main.c:1:1: warning: data definition has no type or storage class
1 | a,b,p;main(c){for(;c=48-getchar();p=c)p<38?c-38?c%2?a++:b++:(a>b?a++:b++,a=b=!printf("%d %d\n",a,b)):0;exit(0)}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.