submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s113805702 | p00162 | C++ | #include<stdio.h>
int cnt,flg;
int solve(int);
main(){
int a,b,i;
cnt=0;
scanf("%d %d",&a,&b);
for(i=a;i<=b;i++){
flg=0;
solve(i);
}
printf("%d\n",cnt);
return 0;
}
int solve(int a){
if(flg==0){
if(a==1||a==2||a==3||a==5){
cnt++;
flg=1;
return;
}
if(a%2==0) solve(a/2);
if(a%... | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int solve(int)':
a.cc:20:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
20 | return;
| ^~~~~~
a.cc:26:3: error: return-statement wi... |
s375667318 | p00162 | C++ | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>
#define VARIABLE(x) cerr << #x << "=" << x << endl
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (i... | a.cc: In function 'int main()':
a.cc:28:42: error: 'pow' was not declared in this scope
28 | h.insert(pow(2.0, i)*pow(3.0, j)*pow(5.0,k));
| ^~~
|
s278436221 | p00163 | C++ | #include<stdio.h>
int main(){
int st1,st2;
int h1,h2,m1,m2;
int n[8][8]={
{0,300,500,600,700,1350,1650}
{6,0,350,450,600,1150,1500}
{13,7,0,250,400,1000,1350}
{18,12,5,0,250,850,1300}
{23,17,10,5,0,600,1150}
{43,37,30,25,20,0,500}
{58,052,45,40,35,15,0}
};
while(1){
scanf("%d",&st1);if(st1==0)break;
scanf("%d %d... | a.cc: In function 'int main()':
a.cc:12:1: error: expected '}' before '{' token
12 | {6,0,350,450,600,1150,1500}
| ^
a.cc:10:13: note: to match this '{'
10 | int n[8][8]={
| ^
a.cc:12:1: error: expected ',' or ';' before '{' token
12 | {6,0,350,450,600,1150,1500}
| ^
a.cc:13:26: e... |
s801107935 | p00163 | C++ | #include <bits/stdc++.h>
using namespace std;
const int price[7][7] = {
{-1, 300, 500, 600, 700, 1350, 1650},
{-1, -1, 350, 450, 600, 1150, 1500},
{-1, -1, -1, 250, 400, 1000, 1350},
{-1, -1, -1, -1, 250, 850, 1300},
{-1, -1, -1, -1, -1, 600, 1150},
{-1, -1, -1, -1, -1, -1, 500}
};
const in... | /usr/bin/ld: /tmp/cc0TBhhm.o:(.data+0x0): multiple definition of `_start'; /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
|
s728104464 | p00163 | C++ | #include <bits/stdc++.h>
using namespace std;
const int price[7][7] = {
{-1, 300, 500, 600, 700, 1350, 1650},
{-1, -1, 350, 450, 600, 1150, 1500},
{-1, -1, -1, 250, 400, 1000, 1350},
{-1, -1, -1, -1, 250, 850, 1300},
{-1, -1, -1, -1, -1, 600, 1150},
{-1, -1, -1, -1, -1, -1, 500}
};
const in... | /usr/bin/ld: /tmp/ccv0gDrq.o:(.data+0x0): multiple definition of `_start'; /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
|
s331985649 | p00163 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int start,finish;
while(cin>>start,start){
int time[2][2];
for(int i=0;i<2;i++)cin>>time[0][i];
cin>>finish;
for(int i=0;i<2;i++)cin>>time[1][i];
int num=0,distance[]={6,7,5,5,20,15},money[6][6]={{300,500,600,700,1350,1650},{350,450,600,1150,1500},{2... | a.cc: In function 'int main()':
a.cc:21:10: error: expected '}' at end of input
21 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s113629869 | p00163 | C++ |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int start,finish;
while(cin>>start,start){
int time[2][2];
for(int i=0;i<2;i++)cin>>time[0][i];
cin>>finish;
for(int i=0;i<2;i++)cin>>time[1][i];
int num=0,distance[]={6,7,5,5,20,15},money[6][6]={{300,500,600,700,... | a.cc: In function 'int main()':
a.cc:19:36: error: expected '}' at end of input
19 | if(num%100==25)num+=25;
| ^
a.cc:17:17: note: to match this '{'
17 | if(kawa){
| ^
a.cc:19:36: error: expected '}' at end of input
19 | ... |
s363160128 | p00163 | C++ | # define _CRT_SECURE_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
#... | a.cc: In function 'void debug(T)':
a.cc:36:70: error: 'iiiiiiiii' was not declared in this scope; did you mean 'iiiiiiiiii'?
36 | template<class T> void debug(T a) { for (auto iiiiiiiiii : a)cout << iiiiiiiii << endl; }
| ^~~~~~~~~
| ... |
s886543750 | p00163 | C++ | #include<bits/stdc++.h>
using namespace std;
signed main{
int a[7][7]={
{0,300,500,600,700,1350,1650},
{6,0,350,450,600,1150,1500},
{13,7,0,250,400,1000,1350},
{18,12,5,0,250,850,1300},
{23,17,10,5,0,600,1150},
{43,37,30,25,20,0,500},
{58,52,45,40,35,15,0}
};
int b;
while(cin>>b,b)... | a.cc:4:8: error: cannot declare '::main' to be a global variable
4 | signed main{
| ^~~~
a.cc:5:1: error: expected primary-expression before 'int'
5 | int a[7][7]={
| ^~~
a.cc:5:1: error: expected '}' before 'int'
a.cc:4:12: note: to match this '{'
4 | signed main{
| ^
a.... |
s949521161 | p00163 | C++ | #include<cmath>
#include<algorithm>
using namespace std;
int hyo[7][7]={
{0,300,500,600,700,1350,1650},
{6,0,350,450,600,1150,1500},
{13,7,0,250,400,1000,1350},
{18,12,5,0,250,850,1300},
{23,17,10,5,0,600,1150},
{43,37,30,25,20,0,500},
{58,52,45,40,35,15,0}
};
int main(){
int s,g, h,m,H,M, c;
while(cin>>s,s){
... | a.cc: In function 'int main()':
a.cc:15:15: error: 'cin' was not declared in this scope
15 | while(cin>>s,s){
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<algorithm>
+++ |+#include <iostream... |
s103029157 | p00163 | C++ | int half(int y);
int main(){
int inic, inh, inm, outic, outh, outm, yen, kyori;
while(1){
cin >>inic;
if(inic == 0) break;
cin >>inh >>inm >>outic >>outh >>outm;
yen = charge(inic, outic);
kyori = dist(inic, outic);
if(checkhalf(inh, inm, outh, outm, kyori)) yen = half(yen);
cout <<yen;
}
return 0;
}
... | a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin >>inic;
| ^~~
a.cc:10:15: error: 'charge' was not declared in this scope; did you mean 'char'?
10 | yen = charge(inic, outic);
| ^~~~~~
| char
a.cc:1... |
s208671945 | p00163 | C++ | #include<iostream>
#include<cstdlib>
using namespace std;
int charge(int in, int out);
int dist(int in, int out);
int checkhalf(int ih, int im, int oh, int om, int dis);
int half(int y);
int main(){
int inic, inh, inm, outic, outh, outm, yen, kyori;
while(1){
cin >>inic;
if(inic == 0) break;
cin >>inh >>inm >... | a.cc: In function 'int charge(int, int)':
a.cc:56:26: error: a function-definition is not allowed here before '{' token
56 | int dist(int in, int out){
| ^
a.cc:87:55: error: a function-definition is not allowed here before '{' token
87 | int checkhalf(int ih, int im, int oh, int om... |
s545675881 | p00163 | C++ | #include<iostream>
#include<cstdlib>
using namespace std;
int charge(int in, int out);
int dist(int in, int out);
int checkhalf(int ih, int im, int oh, int om, int dis);
int half(int y);
int main(){
while(1){
int inic, inh, inm, outic, outh, outm, yen, kyori;
cin >>inic;
if(inic == 0) break;
cin >>inh >>inm ... | a.cc: In function 'int half(int)':
a.cc:170:16: error: 'ceil' was not declared in this scope
170 | temp = ceil(temp);
| ^~~~
a.cc: In function 'int charge(int, int)':
a.cc:77:1: warning: control reaches end of non-void function [-Wreturn-type]
77 | }
| ^
a.cc: In function 'int di... |
s028199199 | p00164 | C | include <stdio.h>
int main (void)
{
int a;
int s[5]={};
while(1){
scanf("%d",&a);
if(a==0);
break;
int i;
for(i=0;i<a;i++)
scanf("%d",&s[i]);
int ss[5]={};
int h=0;
while(s[h]!=0){
ss[h]=s[h];
h++;
}
int oha=32;
int j;
int aaa[32]={};
int k=0;
while(1){
oha=oha-(oha-1)%5;
aaa[j]=oha;
j++;
oha=oha-ss[k%h];
aaa[j... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s808713604 | p00164 | C | include <stdio.h>
int main (void)
{
int a;
int s[5]={};
while(1){
scanf("%d",&a);
if(a==0);
break;
int i;
for(i=0;i<a;i++)
scanf("%d",&s[i]);
int ss[5]={};
int h=0;
while(s[h]!=0){
ss[h]=s[h];
h++;
}
int oha=32;
int j;
int aaa[32]={};
int k=0;
while(1){
oha=oha-(oha-1)%5;
aaa[j]=oha;
j++;
oha=oha-ss[k%h];
aaa[j... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s887476547 | p00164 | C | include <stdio.h>
int main (void)
{
int a;
int s[5]={};
while(1){
scanf("%d",&a);
if(a==0)
break;
int i;
for(i=0;i<a;i++)
scanf("%d",&s[i]);
int ss[5]={};
int h=0;
while(s[h]!=0){
ss[h]=s[h];
h++;
}
int oha=32;
int j;
int aaa[32]={};
int k=0;
while(1){
oha=oha-(oha-1)%5;
aaa[j]=oha;
j++;
oha=oha-ss[k%h];
aaa[j]... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s038877969 | p00164 | C | {
int n,i,j,a[32],b,ohajiki;
while(scanf("%d",&n)!=EOF)
{
if(n==0)break;
ohajiki=32;
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
i=0;
j=0;
while(ohajiki>1)
{
if(i%2==0)
{
b=(ohajiki-1)%5;
printf("%d\n",ohajiki-b);
ohajiki=ohajiki-b;
}
... | main.c:1:1: error: expected identifier or '(' before '{' token
1 | {
| ^
|
s428238752 | p00164 | C++ | #include<iostream>
using namespace std;
int n,a[100];
main()
{
whiel(cin>>n,n)
{
for(int i=0;i<n;i++)cin>>a[i];
int c=32,i=0;
while(c)
{
c-=(c-1)%5;
cout<<c<<endl;
c-=(a[i]>c?c:a[i]);
cout<<c<<endl;
i=(i+1)%n;
}
... | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'whiel' was not declared in this scope
6 | whiel(cin>>n,n)
| ^~~~~
|
s257699654 | p00164 | C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
int main(){
int i,j,a[26];
int n,h = 32;
while(1) {
h = 32;
scanf("%d",&n);
if(n == 0) break;
for(i=0;i<n;i++) scanf("%d",&a[i]);
i = 0;
while(1) {
h = ... | a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 1
| ^
a.cc: In function 'int main()':
a.cc:51:3: error: 'scanf' was not declared in this scope
51 | scanf("%d",&n);
| ^~~~~
a.cc:61:5: error: 'printf' was not declared in this scope
61 | printf("%d\n",h);
| ^~~~... |
s407399068 | p00164 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
int e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
cout << e - b[f%size(b)] << endl;
... | a.cc: In function 'int main()':
a.cc:17:22: error: 'uint16_t' was not declared in this scope
17 | for (uint16_t f = 0; f < 6; f++){
| ^~~~~~~~
a.cc:4:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
3 | #inclu... |
s528980154 | p00164 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
int e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
cout << e -( b[f%size(b)]) << endl;... | a.cc: In function 'int main()':
a.cc:17:22: error: 'uint16_t' was not declared in this scope
17 | for (uint16_t f = 0; f < 6; f++){
| ^~~~~~~~
a.cc:4:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
3 | #inclu... |
s754017355 | p00164 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
uint16_t e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
cout << e -( b[f%size(b)]) << ... | a.cc: In function 'int main()':
a.cc:16:17: error: 'uint16_t' was not declared in this scope
16 | uint16_t e = 31;
| ^~~~~~~~
a.cc:4:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
3 | #include<vector>
+++ |+#in... |
s268556079 | p00164 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
uint16_t e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
cout << e -( b[f%(size(b))]) <... | a.cc: In function 'int main()':
a.cc:16:17: error: 'uint16_t' was not declared in this scope
16 | uint16_t e = 31;
| ^~~~~~~~
a.cc:4:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
3 | #include<vector>
+++ |+#in... |
s020102660 | p00164 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
uint16_t e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
cout << e -(b[f%(size(b))]) << endl;
e -= 5;... | a.cc: In function 'int main()':
a.cc:15:17: error: 'uint16_t' was not declared in this scope
15 | uint16_t e = 31;
| ^~~~~~~~
a.cc:3:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
2 | #include<vector>
+++ |+#in... |
s998605495 | p00164 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
uint16_t e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
cout << (e - b[f % (size(b))]) << endl;
e -=... | a.cc: In function 'int main()':
a.cc:15:17: error: 'uint16_t' was not declared in this scope
15 | uint16_t e = 31;
| ^~~~~~~~
a.cc:3:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
2 | #include<vector>
+++ |+#in... |
s648647264 | p00164 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
uint16_t e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
cout << size(b);
e -= 5;
}
cout << 1 << ... | a.cc: In function 'int main()':
a.cc:15:17: error: 'uint16_t' was not declared in this scope
15 | uint16_t e = 31;
| ^~~~~~~~
a.cc:3:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
2 | #include<vector>
+++ |+#in... |
s164826858 | p00164 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main()
{
while (1) {
int a;
cin >> a;
if (a == 0)break;
vector<int>b(a);
for (int c = 0; c < a; c++) {
cin >> b[c];
}
uint16_t e = 31;
for (uint16_t f = 0; f < 6; f++){
cout <<e<<endl;
int k = size(b);
cout << k;
e -= 5;
}
... | a.cc: In function 'int main()':
a.cc:15:17: error: 'uint16_t' was not declared in this scope
15 | uint16_t e = 31;
| ^~~~~~~~
a.cc:3:1: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
2 | #include<vector>
+++ |+#in... |
s162594195 | p00165 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
#define MAX_N 1000000
int prime[MAX_N];//i番目の素数
bool is_prime[MAX_N+1];
int sieve(int n){
int p=0;
memset(is_prime,true,sizeof(is_prime));
is_prime[0]=is_prime[1]=false;
for(int i=2;i<=n;i++){
if(is_prime[i]){
prime[p++]=i;
for(int j=2*i;j<=n;j+=... | a.cc: In function 'int sieve(int)':
a.cc:11:9: error: 'memset' was not declared in this scope
11 | memset(is_prime,true,sizeof(is_prime));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
++... |
s123936318 | p00165 | C++ | #include "bits/stdc++.h"
using namespace std;
vector<int>primes(1e8);
vector<int>sums(1e8 + 1);
void hurui(const int amax) {
static bool flag = false;
if (flag)return;
vector<int>sos;
sos = vector<int>(amax + 1, true);
sos[0] = false; sos[1] = false;
for (int i = 2; i <= amax; ++i) {
if (sos[i]) {
for (int ... | a.cc: In function 'int main()':
a.cc:42:28: error: no matching function for call to 'max(int, long long int&)'
42 | cout << max(0,prize )<< endl;
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c... |
s652806374 | p00165 | C++ | using namespace std;
int M=1000001,n,p,m,c,S,i,j;
bool P[1000001];
int main(){
for(i=2;i<M;i++)if(!P[i])for(j=i+i;j<M;j+=i)P[j]=1;
P[0]=P[1]=1;
while(cin>>n,n){
for(S=0;n--;){
cin>>p>>m;
c=0; for(i=p-m>?0;i<=p+m&&i<M;)if(!P[i++])c++;
S+=c>0?c-1:-1;
}
cout<<S<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:15: error: 'cin' was not declared in this scope
7 | while(cin>>n,n){
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std... |
s816075405 | p00165 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
int p[1000001];
int main(){
for(int i=0;i<1000001;i++)p[i]=1;
p[0]=p[1]=0;
for(int i=2;i<1000001;i++)
if(p[i])
for(int j=i+i;j<1000001;j+=i)
p[j]=0;
for(int i=1;i<1000001;i++)p[i]+=p[i-1];
int a;while(scanf("%d",&a),a){
long long r=0;
while(a--){
int b,c;
scanf... | a.cc:20:1: error: expected declaration before '}' token
20 | }
| ^
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s074631263 | p00165 | C++ | #include<iostream>
#include<algorithm>
#define INF (long long)1000001
using namespace std;
int main(){
int SOSU[INF];
fill(SOSU,SOSU+INF,1);
for(int i=2;i<INF;i++){
if(SOSU[INF]==1){
for(int j=i+i;j<INF;j+=i) SOSU[j] = 0;
}
}
for(int i=2;i<INF;i++) SOSU[i] += SOSU[i-1];
long long a,sum,b,c;
while(cin >> ... | a.cc: In function 'int main()':
a.cc:20:32: error: 'p' was not declared in this scope
20 | sum += p[min(b+c,INF-1)]-p[max(0,b-c-1)]+1;
| ^
a.cc:20:55: error: no matching function for call to 'max(int, long long int)'
20 | sum += ... |
s434607253 | p00166 | C | #include <stdio.h>
#include <math.h>
#define MAX 50
#define EPS 10e-5
int main(void)
{
int n1,n2;
int i;
int angle;
float s1,s2;
while(1){
scanf("%d",&n1);
if(n1 == 0){ break; }
for(i=0;i<n1-1;i++){
scanf("%d",&angle);
s1 += sin((float)angle/180.0*3.141592*2.0);
}
scanf("%d",&n2);
if(n2 == 0)... | main.c: In function 'main':
main.c:29:35: error: 'si' undeclared (first use in this function); did you mean 's2'?
29 | if(s1 > s2-EPS && si < s2+EPS ){
| ^~
| s2
main.c:29:35: note: each undeclared identifier is reported ... |
s295406470 | p00166 | C | #define Z(V) for(v=360,m=g();--m;V+=sin(x*z))v-=x=g();V+=sin(v*z)
a;g(){scanf("%d",&a);a?a:exit(0);}main(m,v,x){for(;;puts(s>t+e?"1":s+e<t?"2":"0")){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);}} | main.c:2:1: warning: data definition has no type or storage class
2 | a;g(){scanf("%d",&a);a?a:exit(0);}main(m,v,x){for(;;puts(s>t+e?"1":s+e<t?"2":"0")){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);}}
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: return typ... |
s540634549 | p00166 | C | #define Z(V) for(v=360,m=g();--m;V+=sin(x*z))v-=x=g();V+=sin(v*z)
a;g(){scanf("%d",&a);a?a:exit(0);}main(m,v,x){for(;;puts(s>t+e?"1":s+e<t?"2":"0")){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);}} | main.c:2:1: warning: data definition has no type or storage class
2 | a;g(){scanf("%d",&a);a?a:exit(0);}main(m,v,x){for(;;puts(s>t+e?"1":s+e<t?"2":"0")){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);}}
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: return typ... |
s173904207 | p00166 | C | #define Z(V) for(v=360,m=g();--m;V+=sin(x*z))v-=x=g();V+=sin(v*z)
a;g(){scanf("%d",&a);a?a:exit();}main(m,v,x){for(;;){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);puts(s>t+e?"1":s+e<t?"2":"0");}} | main.c:2:1: warning: data definition has no type or storage class
2 | a;g(){scanf("%d",&a);a?a:exit();}main(m,v,x){for(;;){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);puts(s>t+e?"1":s+e<t?"2":"0");}}
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: return typ... |
s499814715 | p00166 | C | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>
using name... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s988792454 | p00166 | C++ | #include <iostream>
using namespace std;
#define PI 3.1415926535
int main() {
int n, m;
while(cin >> n) {
if (n == 0) {
break;
}
int counter = 360;
int a;
double men1 = 0.0;
for (int i = 0; i < n-1; i++) {
cin >> a;
men1 += 0.5*1.0*1.0*sin(((double)a/360.0)*PI*2.0);
counter -= a;
}
men1... | a.cc: In function 'int main()':
a.cc:18:45: error: 'sin' was not declared in this scope
18 | men1 += 0.5*1.0*1.0*sin(((double)a/360.0)*PI*2.0);
| ^~~
a.cc:21:37: error: 'sin' was not declared in this scope
21 | men1 += 0.5*1... |
s380114559 | p00166 | C++ | #include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define PI 3.141592653589793238462643L
int K[100000];
long double SIN(long double b) { return sinl(b * PI / 180.0L); }
int main() {
int N, cnt = 0; long double a, sum, V; vector<long double, int>vec;
while (true) {
cin >> N... | In file included from /usr/include/c++/14/vector:66,
from a.cc:4:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<long double, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11: required from 'class std::vector<long double, int>'
428 | class vector : prote... |
s145338885 | p00166 | C++ | #define Z(V) for(v=360,m=g();--m;V+=sin(x*z))v-=x=g();V+=sin(v*z)
a;g(){scanf("%d",&a);a?a:exit();}main(m,v,x){for(;;){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);puts(s>t+e?"1":s+e<t?"2":"0");}} | a.cc:2:1: error: 'a' does not name a type
2 | a;g(){scanf("%d",&a);a?a:exit();}main(m,v,x){for(;;){float s=0,t=0,z=.02,e=.000001;Z(s);Z(t);puts(s>t+e?"1":s+e<t?"2":"0");}}
| ^
a.cc:2:3: error: ISO C++ forbids declaration of 'g' with no type [-fpermissive]
2 | a;g(){scanf("%d",&a);a?a:exit();}main(m,v,x){f... |
s064785415 | p00166 | C++ | #include<math.h>
n,t,r;
float S;
main(i){
for(;scanf("%d",&n),n;i=-i){
r=360;
for(;--n;){
scanf("%d",&t);
r-=t;
S+=sin(t*M_PI/180)*i;
}
S+=sin(r*M_PI/180)*i;
if(i<0){
puts(fabs(S)>1e-6?S>0?"1":"2":"0");
S=0;
}
}
exit(0);
} | a.cc:2:1: error: 'n' does not name a type
2 | n,t,r;
| ^
a.cc:4:5: error: expected constructor, destructor, or type conversion before '(' token
4 | main(i){
| ^
|
s209596642 | p00166 | C++ | #include <iostream>
#include<cmath>
using namespace std;
double EPS = 1e-10;
double pi = 3.1415926535;
double calc(int x) {
return sin((double)x*pi/180.0);
}
int main(void){
int n,m;
while( cin >> n , n ){
doubles1 = 0, s2 = 0, angle, c = 360;
for( int i = 0 ; i < n - 1 ; i++ ){
... | a.cc: In function 'int main()':
a.cc:20:5: error: 'doubles1' was not declared in this scope; did you mean 'double_t'?
20 | doubles1 = 0, s2 = 0, angle, c = 360;
| ^~~~~~~~
| double_t
a.cc:20:19: error: 's2' was not declared in this scope
20 | doubles1 = 0, s2 = 0, angle, c = 360;
... |
s677022200 | p00166 | C++ | include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
static double EPS = 1.0e-10;
bool is_zero(const double x){ return abs(x)<EPS; }
double get_area(const double& t){ return sin(t*M_PI/180.0)/2; }
double solve(const int& n){
double ans=0;
double t, t_=360;
for(int i=0; i<n-1; ++i){
cin >... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
16... |
s742663522 | p00167 | Java | import java.util.Scanner;
public class AOJ0167 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int n = sc.nextInt();
if(n==0)break;
int[] a = new int[n];
for(int i=0;i<n;i++)a[i]=sc.nextInt();
int s = 0;
for(int j=n-1;j>=1;j--){
for(int i=0;i<j;i... | Main.java:3: error: class AOJ0167 is public, should be declared in a file named AOJ0167.java
public class AOJ0167 {
^
1 error
|
s107211063 | p00167 | C | #include <stdio.h>
int main (void){
int a,c,i,j,n;
for(;;){
scanf("%d",&n);
if(n==0)break;
int b[101]={},ans=0;
for(i=0;i<n;i++){
scanf("%d",&a);
b[i]=a;
}
for(i=1;i<n;i++){
for(j=1;j<n;j++){
if(b[j-1]>=b[j]){
... | main.c: In function 'main':
main.c:25:23: error: 'ans' undeclared (first use in this function)
25 | printf("%d\n",ans);
| ^~~
main.c:25:23: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:27:1: error: expected ide... |
s322006476 | p00167 | C | #include<stdio.h>
int main(){
int i;
int n;
int u[500];
int sum;
int cnt;
while(scanf("%d", &n), n!=0){
for(i=0; i<n; i++)
scanf("%d", &u[i]);
cnt=0;
for(i=n-1; i>0; i--){
for(j=0; j<i; j++){
if(u[j]>u[j+1]){
sum=u[i];
u[j]=u[j+1];
u[j+1]=sum;
cnt++;
}
}
}
printf("%d\n", cnt);
}
return 0;
} | main.c: In function 'main':
main.c:17:5: error: 'j' undeclared (first use in this function)
17 | for(j=0; j<i; j++){
| ^
main.c:17:5: note: each undeclared identifier is reported only once for each function it appears in
|
s868632813 | p00167 | C | #include <stdio.h>
main(){
int a,n[100],i,j,max=0,tmp,t;
while(1){
scanf("%d",&a);
if(a==0) break;
for(i=0;i<=a;i++){
scanf("%d",&n[i]);
}
for(j=0;j<a;j++){
for(i=j;i<a;i++){
t=i+1;
if(a[i]>a[t]){
tmp=a[t];
a[t]=a[i];
a[i]=tmp;
}
}
}
printf("%d\n",n);
}
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:14:13: error: subscripted value is neither array nor pointer nor vector
14 | if(a[i]>a[t]){
| ^
main.c:14:18: error: subscripted value is neither array nor point... |
s477729982 | p00167 | C | #include <stdio.h>
main(){
int a,n[100],i,j,max=0,tmp,t;
while(1){
scanf("%d",&a);
if(a==0) break;
for(i=0;i<=a;i++){
scanf("%d",&n[i]);
}
for(j=0;j<a;j++){
for(i=j;i<a-1;i++){
t=i+1;
if(a[i]>a[t]){
tmp=a[t];
a[t]=a[i];
a[i]=tmp;
}
}
}
printf("%d\n",n);
}... | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:14:13: error: subscripted value is neither array nor pointer nor vector
14 | if(a[i]>a[t]){
| ^
main.c:14:18: error: subscripted value is neither array nor point... |
s836109339 | p00167 | C |
#include <stdio.h>
main(){
int a,n[100],i,j,max=0,tmp,m;
while(1){
scanf("%d",&a);
if(a==0) break;
for(i=0;i<=a;i++){
scanf("%d",&n[i]);
}
for(j=0;j<a-1;j++){
for(i=j;i<a-1;i++){
m=i+1;
if(a[i]>a[m]){
tmp=a[m];
a[m]=a[i];
a[i]=tmp;
}
}
}
printf("%d\n",n);
... | main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:15:13: error: subscripted value is neither array nor pointer nor vector
15 | if(a[i]>a[m]){
| ^
main.c:15:18: error: subscripted value is neither array nor point... |
s153740695 | p00167 | C | #include<stdio.h>
void swap(int *x,int *y){
int m=*x;
*x=*y;
*y=m;
}
int main(){
int a[200],n,j;
while(scanf("%d",&n),n){
j=0;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n-1;i++)
if(a[i]>a[i+1]){
swap(&a[i],&a[i+1]);
j++;
}
printf("%d\n",j);
}
return 0;
} | main.c: In function 'main':
main.c:11:5: error: 'i' undeclared (first use in this function)
11 | for(i=0;i<n;i++)
| ^
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
|
s201502986 | p00167 | C | #include<stdio.h>
void swap(int *x,int *y){
int m=*x;
*x=*y;
*y=m;
}
int main(){
int a[200],n,j,k;
while(scanf("%d",&n),n){
j=0;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(k=0;k<n-1;k++)
for(i=0;i<n-1;i++)
if(a[i]>a[i+1]){
swap(&a[i],&a[i+1]);
j++;
}
printf("%d\n",j);
}
return 0;
} | main.c: In function 'main':
main.c:11:5: error: 'i' undeclared (first use in this function)
11 | for(i=0;i<n;i++)
| ^
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
|
s416219486 | p00167 | C | #include <stdio.h>
int main(void)
{
int N;
int i, j;
int count;
int box[100];
int tmp;
while (1){
scanf("%d", &N);
if (N == 0){
break;
}
count = 0;
for (i = 0; i < N; i++){
scanf("%d", &box[i]);
}
for (i = 0; i < N - 1; i++){
for (j = 0; j = N - i - 1; j++){
if (box[j] > box[j ... | main.c: In function 'main':
main.c:24:56: error: expected ')' before '{' token
24 | if (box[j] > box[j + 1]{
| ~ ^
| )
main.c:31:25: error: expected expression befor... |
s673862332 | p00167 | C | 5
5
3
2
1
4
6
1
2
3
4
5
6
3
3
2
1
0 | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 5
| ^
|
s207056403 | p00167 | C++ | #include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; i < int(n); i++)
int BIT[1000001];
int sum(int idx)
{
int ret = 0;
while (idx != 0)
{
ret += BIT[idx];
idx -= idx & -idx;
}
return ret;
}
int n;
void add(int idx, int num)
{
while (idx <= n)
{
BIT[idx] += num;
... | a.cc: In function 'int main()':
a.cc:34:17: error: 'memset' was not declared in this scope
34 | memset(BIT, 0, sizeof(BIT));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <vector>
++... |
s481528198 | p00167 | C++ | #include <iostream>
#include <Algorithm>
using namespace std;
int main(void){
int N, M;
while(cin >> N, N){
int num[N], cnt = 0;
fill_n(num, N, 0);
for(int i = 0; i < N; i++){
cin >> num[i];
}
for(int i = N-1; i > 0; i--){
for(int j = 1; j <= i; j++){
if(... | a.cc:2:10: fatal error: Algorithm: No such file or directory
2 | #include <Algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s648666324 | p00167 | C++ | #include<stdio.h>
int main(){
int N;
int n[1000001]={};
while(1){
scanf("%d",&N);
int c=0;
for(int i=0;i<N;i++){
scanf("%d",&n[i];
for(int i=0;i<N;i++)
for(int j=N-1;j>i;j--)
{if(n[j]<n[j-1]){int T=n[j];n[j]=n[j-1];n[j-1]=T;c++}
printf("%d\n",c);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:17: error: expected ')' before ';' token
14 | scanf("%d",&n[i];
| ~ ^
| )
a.cc:18:53: error: expected ';' before '}' token
18 | {if(n[j]<n[j-1]){int T=n[j];n[j]=n[j-1];n[j-1]=T;c++}
| ... |
s956105744 | p00167 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
#define INF 1000000000;
using namespace std;
int main() {
int n;
while(cin>>n,n){
int d[n],ans=0;
rep(i, n) cin >> d[i];
for (i = 1; i < n; i++)
for (j = 0; j < n - i; j++)
if (d[j] >... | a.cc: In function 'int main()':
a.cc:12:10: error: 'i' was not declared in this scope
12 | for (i = 1; i < n; i++)
| ^
a.cc:13:12: error: 'j' was not declared in this scope
13 | for (j = 0; j < n - i; j++)
| ^
a.cc:18:13: error: 'k' was not declared in this scope
18 | ... |
s615096859 | p00167 | C++ | #include <algorithm>
#include <cmath>
#include <iostream>
#include <utility>
using namespace std;
constexpr int kaijyou(const int &n) {
return n == 0 ? 1 : n * factorial(n - 1);
}
int main() {
int n, t;
int ans;
double count;
while (cin >> n) {
if (n == 0) return 0;
int a[n];
t = 0;
ans ... | a.cc: In function 'constexpr int kaijyou(const int&)':
a.cc:8:27: error: 'factorial' was not declared in this scope
8 | return n == 0 ? 1 : n * factorial(n - 1);
| ^~~~~~~~~
|
s203670979 | p00167 | C++ | #include<cstdio>
int main(){
int a[102],i,j,k;
for(;scanf("%d",a),*a;printf("%d\n",k)){
for(i=1;i<=n; i++)scanf("%d",*(a+i++));
k=0;
for(j=n;j>1;j--)
for(i=2;i<=j;i++)
if(a[i-1]>a[i])
a[i-1]^=a[i],a[i]^a[i-1],a[i-1]^=a[i],k++;
}
} | a.cc: In function 'int main()':
a.cc:5:28: error: 'n' was not declared in this scope
5 | for(i=1;i<=n; i++)scanf("%d",*(a+i++));
| ^
a.cc:7:23: error: 'n' was not declared in this scope
7 | for(j=n;j>1;j--)
| ^
|
s834462360 | p00167 | C++ | include<iostream>
#include<cstdio>
using namespace std;
int main(){
int n,i,j,k,c,a[1000000];
while(cin>>n&&n!=0){
for(i=0;i<n;i++){
cin>>a[i];
}
for(k=0,i=0;i<n-1;i++){
for(j=i;j<n;j++){
if(a[i]>a[j]){
c=a[i];
a[i]=a[j];
a[j]=c;
k++;
}
}
}
cout<<k<<endl;
... | 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&&n!=0){
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by add... |
s079560972 | p00167 | C++ | #include<iostream>
#define MAX_N 1000000
using namespace std;
int bit[MAX_N + 1],a[MAX_N + 1],n;
int sum(int);
void add(int,int);
int main(void){
while(cin >> n,n){
int ans=0;
for(int i=0;i<n;i++)cin >> a[i];
for(int j=0;j<n;j++){
ans += j - sum(a[j]);
add(a[j],1);
}
printf(... | /usr/bin/ld: /tmp/cczG1yvQ.o: in function `main':
a.cc:(.text+0xa3): undefined reference to `add(int, int)'
collect2: error: ld returned 1 exit status
|
s332342376 | p00167 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define N (111)
int seg[N+1];
void add(int x,int v){
for(int i = x ; i < N ; i+=i&-i){
seg[i] += v;
}
}
int get(int x){
int ans = 0;
for(int i = x ; i > 0 ; i -= i & -i){
ans += seg[i];
}
return ans;
}
int a[101];
int main()... | a.cc: In function 'int main()':
a.cc:36:39: error: no match for 'operator*' (operand types are 'int' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
36 | a[i] = (10/i) * lower_bound(u.begin(),u.end(),a[i]) - u.begin() + 1;
| ~~~~~~ ^ ~~~~~~~~~... |
s226932976 | p00167 | C++ | #include<iostream>
#include<cstdio>
#include<time.h>
using namespace std;
#define N 314159
int a[N],t[N];
long long ans=0;
void marge_count(int s,int g){
if(s+1==g){
if(a[s]>a[g]){
swap(a[s],a[g]);ans++;
}return;
}
int m= (s+g)/2;
marge_count(s,m);
marge_count(m,g);
int p=s,q=m,r=s;
while(p<... | a.cc:38:1: error: extended character is not valid in an identifier
38 | while(cin>>n&&n!=0){
| ^
a.cc: In function 'int main()':
a.cc:38:14: error: 'n' was not declared in this scope
38 | while(cin>>n&&n!=0){
| ^
a.cc:38:1: error: '\U00003000while' was not declared in this scope
38... |
s398476196 | p00167 | C++ | #include<iostream>
#include<cstdio>
#include<time.h>
using namespace std;
#define N 314159
int a[N],t[N];
int n;
long long ans=0;
void marge_count(int s,int g){
if(s+1==g){
if(a[s]>a[g]){
swap(a[s],a[g]);ans++;
}return;
}
int m= (s+g)/2;
marge_count(s,m);
marge_count(m,g);
int p=s,q=m,r=s;
w... | a.cc:39:1: error: extended character is not valid in an identifier
39 | while(cin>>n&&n!=0){
| ^
a.cc: In function 'int main()':
a.cc:39:1: error: '\U00003000while' was not declared in this scope
39 | while(cin>>n&&n!=0){
| ^~~~~~~
|
s760278629 | p00167 | C++ | <iostream>
using namespace std;
int main()
{
int n;
for(;cin>>n,n;)
{
int data[n];
long long int step=0;
for(int i=0;i<n;i++)
cin>>data[i];
for(int i=0;i<n;i++)
for(int j=0;j<n-i-1;j++)
{
if(data[j]>data[j+1])
{
swap(data[j],data[j+1]);
step++;
}
}
... | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <iostream>
| ^
a.cc: In function 'int main()':
a.cc:7:8: error: 'cin' was not declared in this scope
7 | for(;cin>>n,n;)
| ^~~
a.cc:19:17: error: 'swap' was not declared in this scope
19 | swap(data[j],data[j+1... |
s285906589 | p00167 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
const int N = 100;
int bit[N+10];
int sum(int i){
int s = 0;
while(i > 0){
s += bit[i];
i -= i & -i;
}
return s;
}
void add(int i, int x){
while(i <= N){
bit[i] += x;
i += i & -i;
}
}
vector<int> compress(vector<int> v){
map<in... | a.cc: In function 'int main()':
a.cc:41:22: error: 'n' was not declared in this scope
41 | while(cin >> n && n){
| ^
a.cc:42:17: error: 'memset' was not declared in this scope
42 | memset(bit, 0, sizeof(bit));
| ^~~~~~
a.cc:4:1: note: 'memse... |
s238525681 | p00167 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <cstring>
using namespace std;
const int N = 100;
int bit[N+10];
int sum(int i){
int s = 0;
while(i > 0){
s += bit[i];
i -= i & -i;
}
return s;
}
void add(int i, int x){
while(i <= N){
bit[i] += x;
i += i & -i;
}
}
vector<int> compress(vect... | a.cc: In function 'int main()':
a.cc:49:32: error: 'i' was not declared in this scope
49 | v = compress(v[i]);
| ^
|
s015361312 | p00167 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include <cassert>
using namespace std;
int N, A[100];
int W[100];
int merge_and_count(int l,int r){
if (l + 1 >= r)return 0;
if (l + 2 == r){
if (A[l] <= A[l + 1])return 0;
swap(A[l], A[l + 1]);
return 1;
}
int m = (l + r) / 2;
int cl = merge_and_co... | a.cc: In function 'int merge_and_count(int, int)':
a.cc:28:30: error: 'floor' was not declared in this scope
28 | c += floor(m-i)-1;
| ^~~~~
|
s234026971 | p00168 | C | #include <stdio.h>
#include <string.h>
int main(void){
int n;
int temp[31];
int i,j;
while (scanf("%d", &n), n){
memset(dp, 0, sizeof(dp));
temp[1] = 1;
temp[2] = 2;
temp[3] = 4;
for (i=4;i<=n;i++){
for (j=1;j<=3;j++){
temp[i]+=temp[i... | main.c: In function 'main':
main.c:8:16: error: 'dp' undeclared (first use in this function)
8 | memset(dp, 0, sizeof(dp));
| ^~
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
|
s946218611 | p00168 | C | #include <stdio.h>
#include <string.h>
int main(void)
{
int n;
int temp[31];
int i,j;
while (scanf("%d", &n), n){
memset(dp, 0, sizeof(dp));
temp[1] = 1;
temp[2] = 2;
temp[3] = 4;
for (i=4;i<=n;i++){
for (j=1;j<=3;j++){
temp[i]+=temp[... | main.c: In function 'main':
main.c:9:16: error: 'dp' undeclared (first use in this function)
9 | memset(dp, 0, sizeof(dp));
| ^~
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
|
s147980425 | p00168 | C | #include <stdio.h>
#include <string.h>
int main(void)
{
int n;
int temp[31];
int i,j;
while (scanf("%d", &n), n){
memset(dp, 0, sizeof(temp));
temp[1] = 1;
temp[2] = 2;
temp[3] = 4;
for (i=4;i<=n;i++){
for (j=1;j<=3;j++){
temp[i]+=tem... | main.c: In function 'main':
main.c:9:16: error: 'dp' undeclared (first use in this function)
9 | memset(dp, 0, sizeof(temp));
| ^~
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
|
s554603055 | p00168 | C | #include <stdio.h>
#include <string.h>
int main()
{
int n;
int temp[31];
int i,j;
while (scanf("%d", &n), n){
memset(dp, 0, sizeof(temp));
temp[1] = 1;
temp[2] = 2;
temp[3] = 4;
for (i=4;i<=n;i++){
for (j=1;j<=3;j++){
temp[i]+=temp[i-... | main.c: In function 'main':
main.c:9:16: error: 'dp' undeclared (first use in this function)
9 | memset(dp, 0, sizeof(temp));
| ^~
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
|
s658982889 | p00168 | C | #include <stdio.h>
#include <string.h>
int main()
{
int n;
int temp[31];
int i,j;
while (scanf("%d", &n), n){
memset(dp, 0, sizeof(temp));
temp[1] = 1;
temp[2] = 2;
temp[3] = 4;
for (i=4;i<=n;i++){
for (j=1;j<=3;j++){
temp[i]+=temp[i-... | main.c: In function 'main':
main.c:9:16: error: 'dp' undeclared (first use in this function)
9 | memset(dp, 0, sizeof(temp));
| ^~
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
|
s291061543 | p00168 | C | #include<stdio.h>
int main(){
long long dp[31]={0,1,2,4};
int i,n;
for(i=4;i<=30;i++){
dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
}
while(scanf("%d",&n),n){
printf("%d\n", | main.c: In function 'main':
main.c:12:3: error: expected expression at end of input
12 | printf("%d\n",
| ^~~~~~
main.c:12:3: error: expected declaration or statement at end of input
main.c:12:3: error: expected declaration or statement at end of input
|
s754220578 | p00168 | C | #include<stdio.h>
int main()
{
int n;
int a[31] = {1,1,2};
for(int i=3 ; i <= 30 ; i++ ){
a[i] = a[i-1] + a[i-2] + a[i-3];
}
scanf("%d",&n);
printf("%d",a[n]/10/365+1);
}
~
~ ... | main.c:12:1: error: expected identifier or '(' before '~' token
12 | ~
| ^
|
s777141387 | p00168 | C | void main(){int n,a[64],i;ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)a[i]=a[i-1]+a[i-2]+a[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}} | main.c: In function 'main':
main.c:1:27: error: 'ans' undeclared (first use in this function)
1 | void main(){int n,a[64],i;ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)a[i]=a[i-1]+a[i-2]+a[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}}
| ^~~
main.c:1:27: note... |
s496954936 | p00168 | C | main(){n,a[31]={1,1,2};for(n=3;n<31;)a[n++]=a[n-1]+a[n-2]+a[n-3];for(;scanf("%d",&n),n;)printf("%d\n",a[n]/10/365+1);} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){n,a[31]={1,1,2};for(n=3;n<31;)a[n++]=a[n-1]+a[n-2]+a[n-3];for(;scanf("%d",&n),n;)printf("%d\n",a[n]/10/365+1);}
| ^~~~
main.c: In function 'main':
main.c:1:8: error: 'n' undeclared (first use in this function)
1 | main(){n,a[31]=... |
s856318220 | p00168 | C | int main(){int a[31]={4,1,1,2};for(;*a<31;)a[*a++]=a[*a-1]+a[*a-2]+a[*a-3];for(;scanf("%d",a),*a;)printf("%d\n",a[*a]/3650+1);} | main.c: In function 'main':
main.c:1:48: error: lvalue required as increment operand
1 | int main(){int a[31]={4,1,1,2};for(;*a<31;)a[*a++]=a[*a-1]+a[*a-2]+a[*a-3];for(;scanf("%d",a),*a;)printf("%d\n",a[*a]/3650+1);}
| ^~
main.c:1:81: error: implicit declaration ... |
s435114312 | p00168 | C | #include <stdio.h>
int main(void)
{
__int64 ans[31];
int a, i;
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];
}
while (1){
scanf("%d", &a);
if (!a){
break;
}
printf("%d\n", ans[a] / 3650 + ((a % 3650 == 0) ? 0 : 1));
}
return ... | main.c: In function 'main':
main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'?
5 | __int64 ans[31];
| ^~~~~~~
| __int64_t
|
s294872703 | p00168 | C | #include <stdio.h>
#include <windows.h>
int memo[31];
int getways( int n );
int main( void )
{
int n;
int year;
scanf("%d",&n);
year = (getways(n)/10)/365+1;
printf("%d\n",year);
return 0;
}
int getways( int n )
{
int ways;
if( memo[n] != 0 )
{
return memo[n];
}
if( n <= 1 )
{
return 1;
}
... | main.c:2:10: fatal error: windows.h: No such file or directory
2 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s743209786 | p00168 | C | main(i,n[99]){for(n[1]=1,n[2]=2,n[3]=4,i=4;i-31;n[i]=n[i-1]+n[i-2]+n[i++-3]);for(;scanf("%d",&i)*i;printf("%d\n",n[i]/3650+(n[i]%3650?1:0)));} | main.c:1:9: error: expected ')' before '[' token
1 | main(i,n[99]){for(n[1]=1,n[2]=2,n[3]=4,i=4;i-31;n[i]=n[i-1]+n[i-2]+n[i++-3]);for(;scanf("%d",&i)*i;printf("%d\n",n[i]/3650+(n[i]%3650?1:0)));}
| ^
| )
|
s743318916 | p00168 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
int dp[50];
int n;
void init() {
dp[1] = dp[2] = dp[3] = 1;
for (int i = 1; i <= 30; i++) {
dp[i+1] += dp[i];
dp[i+2] += dp[i];
dp[i+3] += dp[i];
}
}
signed main() {
init();
while (1) {
cin >> n;
if (n == 0) break;
... | a.cc: In function 'int main()':
a.cc:25:5: error: expected ',' or ';' before 'cout'
25 | cout << max(1LL, year + (days >= 1)) << endl;
| ^~~~
|
s161643815 | p00168 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long INF=1LL << 60;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
vector<int> dan;
vector<int> dp(35,0);
int N;
for(int i=0;i<35;i++){
int tmp;
cin>>tmp;
if(tmp==0) break;
dan.push_back(tmp); ... | a.cc: In function 'int main()':
a.cc:27:9: error: expected ',' or ';' before 'if'
27 | if(dp[i]%3650!=0) tmp++;
| ^~
|
s043782728 | p00168 | C++ | a = [1, 1, 2]
for i in range(3, 31):
a.append(sum(a[-3:]))
while True:
n = int(input())
if not n:
break
print(((a[n] + 9) / 10 + 364) / 365) | a.cc:1:1: error: 'a' does not name a type
1 | a = [1, 1, 2]
| ^
|
s629366764 | p00168 | C++ | #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int dp[31][31];
int n;
while(1){
cin >> n;
if(n==0)break;
memset(dp, 0, sizeof(dp));
dp[1][1] = 1;
dp[1][2] = 1;
dp[1][3] = 1;
for (int i = 1; i <= 27; i++){
for (int i2 = 1; i2 <= 27; i2++){
dp[i + 1][i2 + 1] += dp[i][i2];
dp... | a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
10 | 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... |
s994833837 | p00168 | C++ | #include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
cout << num(n) <<endl;
return 0;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:8:15: error: 'n' was not declared in this scope
8 | cout << num(n) <<endl;
| ^
a.cc:8:11: error: 'num' was not declared in this scope; did you mean 'enum'?
8 | cout << num(n) <<endl;
| ^~~
| enum
|
s931286651 | p00168 | C++ | #include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
cout << num((int)s) <<endl;
return 0;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:8:15: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
8 | cout << num((int)s) <<endl;
| ^~~~~~
a.cc:8:11: error: 'num' was not declared in this scope; did you mean 'enum'?
8 | cout << num((int)s) <<en... |
s706621279 | p00168 | C++ | #include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
cout << num(stoi(strPlus)) <<endl;
return 0;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:8:20: error: 'strPlus' was not declared in this scope
8 | cout << num(stoi(strPlus)) <<endl;
| ^~~~~~~
a.cc:8:11: error: 'num' was not declared in this scope; did you mean 'enum'?
8 | cout << num(stoi(strPlus)) <<endl;
| ^~~
... |
s482469411 | p00168 | C++ | #include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
cout << num(stoi(s)) <<endl;
return 0;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:8:11: error: 'num' was not declared in this scope; did you mean 'enum'?
8 | cout << num(stoi(s)) <<endl;
| ^~~
| enum
|
s923093336 | p00168 | C++ | #include <iostream>
using namespace std;
int num(int n);
int main()
{
string s;
cin >> s;
int n = stoi(s)
cout << num(n) <<endl;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'cout'
11 | cout << num(n) <<endl;
| ^~~~
|
s693338744 | p00168 | C++ | #include <iostream>
using namespace std;
int num(int n);
int main()
{
string s;
cin >> s;
int n = std::stoi;
cout << num(n) <<endl;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:10:16: error: cannot resolve overloaded function 'stoi' based on conversion to type 'int'
10 | int n = std::stoi;
| ^~~~
|
s397557349 | p00168 | C++ | #include <iostream>
using namespace std;
int num(int n);
int main()
{
int n;
cout << num(cin>>n) <<endl;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:9:18: error: cannot convert 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
9 | cout << num(cin>>n) <<endl;
| ~~~^~~
| |
| std::basic_istream<char>::__istream_type {aka std::... |
s315370264 | p00168 | C++ | #include <iostream>
using namespace std;
int num(int n);
int main(){
int n;
cout << num(cin>>n) <<endl;
}
int num(int n){
if(n<0)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:8:18: error: cannot convert 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
8 | cout << num(cin>>n) <<endl;
| ~~~^~~
| |
| std::basic_istream<char>::__istream_type {aka std::... |
s720815218 | p00168 | C++ | #include <iostream>
using namespace std;
int num(int n);
int main(){
int n;
cin>>n;
cout << num(n)//3650+1 <<endl;
}
int num(int n){
if(n<1)return 0;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
9 | cout << num(n)//3650+1 <<endl;
| ^
| ;
10 | }
| ~
|
s316328237 | p00168 | C++ | #include <iostream>
using namespace std;
int main(){
int n;cin >> n;
cout << num(num(n)/3650+1) <<endl;
}
int num(int n){
if(n<0)return 0;
if(n==0)return 1;
return num(n-1)+num(n-2)+num(n-3);
} | a.cc: In function 'int main()':
a.cc:5:15: error: 'num' was not declared in this scope; did you mean 'enum'?
5 | cout << num(num(n)/3650+1) <<endl;
| ^~~
| enum
a.cc:5:11: error: 'num' was not declared in this scope; did you mean 'enum'?
5 | cout << num(num(n)/3650+1)... |
s709545978 | p00168 | C++ | #include <iostream>
using namespace std;
int f(int n){
if(n<0)
return 0;
if(n==0)
return 1;
if ( memo[n]!= -1 )
return memo[n];
return f(n-1)+f(n-2)+f(n-3);
}
int main(){
int n;
memo.resize(31,-1);
while(1){
cin >> n;
if(n==0)
break;
... | a.cc: In function 'int f(int)':
a.cc:8:10: error: 'memo' was not declared in this scope
8 | if ( memo[n]!= -1 )
| ^~~~
a.cc: In function 'int main()':
a.cc:15:5: error: 'memo' was not declared in this scope
15 | memo.resize(31,-1);
| ^~~~
|
s287554903 | p00168 | C++ | #include <iostream>
using namespace std;
VI memo;
int f(int n){
if(n<0)
return 0;
if(n==0)
return 1;
if ( memo[n]!= -1 )
return memo[n];
return f(n-1)+f(n-2)+f(n-3);
}
int main(){
int n;
memo.resize(31,-1);
while(1){
cin >> n;
if(n==0)
br... | a.cc:3:1: error: 'VI' does not name a type
3 | VI memo;
| ^~
a.cc: In function 'int f(int)':
a.cc:9:10: error: 'memo' was not declared in this scope
9 | if ( memo[n]!= -1 )
| ^~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'memo' was not declared in this scope
16 | memo.re... |
s812918326 | p00168 | C++ | #include <iostream>
using namespace std;
vector<int> memo;
int f(int n){
if(n<0)
return 0;
if(n==0)
return 1;
if ( memo[n]!= -1 )
return memo[n];
return f(n-1)+f(n-2)+f(n-3);
}
int main(){
int n;
memo.resize(31,-1);
while(1){
cin >> n;
if(n==0)
... | a.cc:3:1: error: 'vector' does not name a type
3 | vector<int> memo;
| ^~~~~~
a.cc: In function 'int f(int)':
a.cc:9:10: error: 'memo' was not declared in this scope
9 | if ( memo[n]!= -1 )
| ^~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'memo' was not declared in this scope
... |
s793319472 | p00168 | C++ | #include <iostream>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
c... | a.cc:6:9: error: 'vector' does not name a type
6 | typedef vector<int> VI;
| ^~~~~~
a.cc:7:9: error: 'vector' does not name a type
7 | typedef vector<VI > VVI;
| ^~~~~~
a.cc:8:9: error: 'vector' does not name a type
8 | typedef vector<string> VS;
| ^~~~~~
a.cc:9:9: ... |
s986817883 | p00168 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int p[31];
p[0] = 1;
p[1] = 1;
p[2] = 2;
for (int i = 3; i <= 30; ++i)
{
p[i] = p[i-1] + p[i-2] + p[i-3];
}
while(1){
int y;
cin >> n;
if(n == 0){
break;
}
y = p[n] / 10 / 365 + 1;
cout << y << endl... | a.cc: In function 'int main()':
a.cc:18:24: error: 'n' was not declared in this scope
18 | cin >> n;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.