submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s795294780 | p00475 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define REP(i,b) FOR(i,0,b)
int a[100000];
int b[100000];
int amn=INT_MAX,amx=INT_MIN,bmn=INT_MAX,bmx=INT_MIN,n,c,d,ow=INT_MIN,oh = INT_MIN;
int main(){
scanf("%d",&n);
REP(i,n){
scanf("%d %d",&c,&d);
a[i] = c+d;
... | a.cc:8:9: error: 'INT_MAX' was not declared in this scope
8 | int amn=INT_MAX,amx=INT_MIN,bmn=INT_MAX,bmx=INT_MIN,n,c,d,ow=INT_MIN,oh = INT_MIN;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <algorithm>
... |
s694421058 | p00475 | C++ | #include <cstdio>
#include <stdc++.h>
using namespace std;
#define R for(i=0;i<n;++i)
int a[1<<17],b[1<<17],amn=1e7,amx=-1e7,bmn=1e7,bmx=-1e7,n,c,d,ow=-1e7,oh=1e7,i;
int main(){
scanf("%d",&n);
R{
scanf("%d %d",&c,&d);
a[i] = c+d;
b[i] = c-d;
amn = min(amn,a[i]);
amx = max(amx,a[i]);
bmn = min(bmn,b[i]);
... | a.cc:2:10: fatal error: stdc++.h: No such file or directory
2 | #include <stdc++.h>
| ^~~~~~~~~~
compilation terminated.
|
s303022833 | p00475 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef pair<int,int> pi;
int n;
pi a[100005];
int solve(){
int s = 0, e = 400000;
while (s != e) {
int m = (s+e)/2;
int xl = 1e9, yl = 1e9, xh = -1e9, yh = -1e9;
for (int j=0; j<n; j++) {
if(a[j... | a.cc: In function 'int main()':
a.cc:38:22: error: 'maxv1' was not declared in this scope
38 | a[i].first = maxv1 - a[i].first;
| ^~~~~
|
s179299726 | p00475 | C++ | //E? Nanndatte?
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1... | a.cc: In function 'int main()':
a.cc:113:1: error: jump to label 'fail'
113 | fail:;
| ^~~~
a.cc:66:69: note: from here
66 | if(y[0][0]-y[0][1]>mid || y[1][0]-y[1][1]>mid) goto fail;
| ^~~~
a.cc:71:28: note: crosses... |
s841349123 | p00475 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typede... | a.cc: In function 'int main()':
a.cc:113:25: error: 'next2' was not declared in this scope; did you mean 'nextup'?
113 | next2;
| ^~~~~
| nextup
a.cc:97:59: error: label 'next2' used but not defined
97 | ... |
s974277294 | p00475 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typede... | a.cc: In function 'int main()':
a.cc:113:25: error: 'next2' was not declared in this scope; did you mean 'nextup'?
113 | next2;
| ^~~~~
| nextup
a.cc:97:59: error: label 'next2' used but not defined
97 | ... |
s414605862 | p00476 | C | #include <stdio.h>
#include <string.h>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) > (b) ? (b) : (a))
#define MAX_N (100000)
typedef __int64 ll;
typedef struct {
ll val;
int pos;
} SEG;
SEG seg[1 << 18];
ll data[1 << 18], datb[1 << 18];
SEG dummy;
int seg_size;
void init(int N)
{
se... | main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'?
8 | typedef __int64 ll;
| ^~~~~~~
| __int64_t
|
s648488331 | p00476 | C | #include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef struct {
int plus, pos;
} Dungeon;
bool operator < (const Dungeon &a, const Dungeon &b)
{
if (a.plus != b.plus){
return (a.plus < b.plus);
}
else {
return (a.pos < b.pos);
}
... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s377909625 | p00476 | C++ | #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
//const int INF = 1e8;
using namespace std;
#define int long long
const int MAX_N = 100010;
class segTre... | a.cc:65:2: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
65 | ???//1-index????????°??¨
a.cc: In function 'int main()':
a.cc:65:1: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:65:2: error: expected primary-expression before '?' token
65... |
s538504745 | p00476 | C++ | #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
//const int INF = 1e8;
using namespace std;
#define int long long
const int MAX_N = 100010;
class segTre... | a.cc:65:2: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
65 | ???//1-index????????°??¨
a.cc: In function 'int main()':
a.cc:65:1: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:65:2: error: expected primary-expression before '?' token
65... |
s256811461 | p00476 | C++ | #include <iostream>
#include <cstdio>
#include <map>
#include <deque>
using namespace std;
long long d[100000];
long long h[100000];
long long s[100000];
int main(){
long long N,H,mx;
cin >> N >> H;
mx = H;
for(int i = 0 ; i < N-1 ; i++){
cin >> d[i] >> h[i];
s[i+1] = s[i] + d[i];
}
int ans = 0;
deque<int... | a.cc: In function 'int main()':
a.cc:47:41: error: 'flag' was not declared in this scope
47 | flag = 1;
| ^~~~
|
s377969445 | p00476 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <deque>
using name... | a.cc: In function 'int main()':
a.cc:43:21: error: 'class std::deque<std::pair<long long int, long long int> >' has no member named 'push'
43 | deq.push(mp(b,totd));
| ^~~~
|
s330168889 | p00476 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typede... | a.cc: In member function 'void segtree::lazy_evaluate(int)':
a.cc:35:33: error: continue statement not within a loop
35 | if(x*2+2>=maxs) continue;
| ^~~~~~~~
a.cc: In member function 'll segtree::query(int, int, int, int, int)':
a.cc:65:33: error: unable to find... |
s241723869 | p00477 | Java | import java.io.*;
import java.util.*;
public class TotalTimes {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int sec = 0;
for (int i = 0; i < 4; i++)
sec += Integer.parseInt(sc.nextLine());
System.out.println(sec / 60);... | Main.java:4: error: class TotalTimes is public, should be declared in a file named TotalTimes.java
public class TotalTimes {
^
1 error
|
s748154134 | p00477 | C | #include<stdio.h>
int main(){
int a,b,c,d,x,y;
scanf("%d %d %d %d",&a,&b,&c,%d);
x=(a+b+c+d)/60;
y=(a+b+c+d)%60;
printf("%d\n",x);
printf("%d\n",y);
return(0);
} | main.c: In function 'main':
main.c:4:32: error: expected expression before '%' token
4 | scanf("%d %d %d %d",&a,&b,&c,%d);
| ^
|
s139586825 | p00477 | C | #include<stdio.h>
int main(void)
{
int a,x=0,i;
for (i=0;i<4;i++)
{
scanf("%d",&a)
x=x+a;
}
a=x/60
i=x%60
printf("%d\n%d\n",a,i);
return 0;
} | main.c: In function 'main':
main.c:7:20: error: expected ';' before 'x'
7 | scanf("%d",&a)
| ^
| ;
8 | x=x+a;
| ~
main.c:10:9: error: expected ';' before 'i'
10 | a=x/60
| ^
| ;
11 | i=x%60... |
s219040604 | p00477 | C | #include<stdio.h>
int main(void)
{
int a,x=0,i;
for (i=0;i<4;i++)
{
scanf("%d",&a)
x=x+a;
}
a=x/60;
i=x%60;
printf("%d\n%d\n",a,i);
return 0;
} | main.c: In function 'main':
main.c:7:20: error: expected ';' before 'x'
7 | scanf("%d",&a)
| ^
| ;
8 | x=x+a;
| ~
|
s945578010 | p00477 | C | #include<stdio.h>
int main(void){
int a,b=0,i;
for(i=0;i<4;i++){
scanf("%d"&a);
b+=a;
}
printf("%d\n%d\n",b/60,b%60);
return 0;
} | main.c: In function 'main':
main.c:5:27: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d"&a);
| ~~~~^
| |
| char *
|
s394268586 | p00477 | C | #include <stdio.h>
#include <cstring>
int main(){
int i1[2] = {0};
int ansers[5] = {0};
int total = 1;
for(int n = 0;n < 6; n++){
scanf("%d",&total);
if(total == 0){
for(int x = 0; x < n; x++) printf("%d\n",ansers[x]);
return 0;
}
memset(i1,0,sizeof(i1));
for(int n = 0; n < ... | main.c:2:10: fatal error: cstring: No such file or directory
2 | #include <cstring>
| ^~~~~~~~~
compilation terminated.
|
s117900304 | p00477 | C | #include<stdio.h>
int main(){
int time[4];
int i;
for(i=0;i<4;i++){
scanf("%d",time[i]);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
x>=60 && x<=3599;
x %= 60
int a;
a = x
x = time[0]+time[1]+time[2]+time[3];
x -=a
x /= 60
printf("#d\n",x);
printf("#d\n",a);
} | main.c: In function 'main':
main.c:11:8: error: expected ';' before 'int'
11 | x %= 60
| ^
| ;
12 | int a;
| ~~~
main.c:13:1: error: 'a' undeclared (first use in this function)
13 | a = x
| ^
main.c:13:1: note: each undeclared identifier is reported only once for each... |
s779919257 | p00477 | C | #include<stdio.h>
int main(void){
int time[4];
int i;
for(i=0;i<4;i++){
scanf("%d",time[i]);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
x %= 60;
int a;
a = x;
y = time[0]+time[1]+time[2]+time[3];
y -= a;
y /= 60;
printf("#d\n",y);
printf("#d\n",a);
return 0;
} | main.c: In function 'main':
main.c:13:9: error: 'y' undeclared (first use in this function)
13 | y = time[0]+time[1]+time[2]+time[3];
| ^
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
|
s112309322 | p00477 | C | #include<stdio.h>
int main(void){
int time[4];
int i;
for(i=0;i<=3;i++){
scanf("%d\n",time[i]);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
a = x/60;
b = x%60;
printf("%d\n",a);
printf("%d\n",b);
return 0;
} | main.c: In function 'main':
main.c:11:5: error: 'a' undeclared (first use in this function)
11 | a = x/60;
| ^
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:5: error: 'b' undeclared (first use in this function)
12 | b = x%60;
... |
s129108329 | p00477 | C | #include<stdio.h>
int main(void){
int i;
int a;
int b;
int c;
int d;
for(i=0;i<=3;i++){
scanf("%d%d%d%d",a,b,c,d);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
int e,f;
e = x/60;
f = x%60;
printf("%d\n",e);
printf("%d\n",f);
return 0;
} | main.c: In function 'main':
main.c:13:9: error: 'time' undeclared (first use in this function)
13 | x = time[0]+time[1]+time[2]+time[3];
| ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
1 | #include<stdio.h>
+++ |+#include... |
s868660788 | p00477 | C | #include<stdio.h>
int main(void){
int a[4];
int x;
for(i=0;i<=3;i++){
scanf("%d",a[i]);
x += a[i];
}
printf("%d/n%d/n",x/60,x%60);
return 0;
} | main.c: In function 'main':
main.c:5:5: error: 'i' undeclared (first use in this function)
5 | for(i=0;i<=3;i++){
| ^
main.c:5:5: note: each undeclared identifier is reported only once for each function it appears in
|
s486540819 | p00477 | C | #include<stdio.h>
int main(void){
int a[4];
int x,i;
for(i=0;i<=3;i++){
scanf("%d",a[i]);
x += a[i];
}
printf("%d/n%d/n",x/60,x%%60);
return 0;
} | main.c: In function 'main':
main.c:9:30: error: expected expression before '%' token
9 | printf("%d/n%d/n",x/60,x%%60);
| ^
|
s359546584 | p00477 | C | #include<stdio.h>
int main(){
int a[4];
int x;i;
x = 0;
for(i=0;i<4;i++){
scanf("%d",a[i]);
x += a[i];
}
printf("%d/n%d/n",x/60,x%60);
return 0;
} | main.c: In function 'main':
main.c:4:7: error: 'i' undeclared (first use in this function)
4 | int x;i;
| ^
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
|
s436150826 | p00477 | C | #include<stdio.h>
int main(){
int a[4];
int x,i;
x = 0;
for(i=0;i<4;i++){
scanf("%d",a[i]);
x = x+a[i];
}
printf("%d/n",&x/60);
printf("%d/n",&x%60);
return 0;
} | main.c: In function 'main':
main.c:10:17: error: invalid operands to binary / (have 'int *' and 'int')
10 | printf("%d/n",&x/60);
| ~~^
| |
| int *
main.c:11:17: error: invalid operands to binary % (have 'int *' and 'int')
11 | printf("%d/n",&x%60);
... |
s228109977 | p00477 | C | #include<stdio.h>
int main(){
int x = 0, i, t;
for(i = 0;i < 4;i++){
scanf("%d", &t);
x += t;
}
printf("%d\n%d\n", x / 60, x % 60)
} | main.c: In function 'main':
main.c:9:37: error: expected ';' before '}' token
9 | printf("%d\n%d\n", x / 60, x % 60)
| ^
| ;
10 | }
| ~
|
s462497475 | p00477 | C | #include <stdio.h>
int main()
{
int sec;
int min;
int total_sec=0, total_min=0;
int i;
for(i=0; i<4; i++){
scanf("%d", &sec);
total_sec += sec;
}
while(total_sec>=60){
total_min+++
total_sec-=60;
}
printf("%d\n%d\n", total_min, total_sec);
return 0;
} | main.c: In function 'main':
main.c:15:26: error: lvalue required as left operand of assignment
15 | total_sec-=60;
| ^~
|
s259735936 | p00477 | C | #include <stdio.h>
int main()
{
int sec;
int total_sec=0, total_min=0;
int i;
for(i=0; i<4; i++){
scanf("%d", &sec);
total_sec += sec;
}
while(total_sec>=60){
total_min+++
total_sec-=60;
}
printf("%d\n%d\n", total_min, total_sec);
return 0;
} | main.c: In function 'main':
main.c:14:26: error: lvalue required as left operand of assignment
14 | total_sec-=60;
| ^~
|
s493757081 | p00477 | C | #include <stdio.h>
int main(){
int i,sum=0,byo[4];
int hun,byo;
for(i=0;i<4;i++){
scanf("%d",&byo[i]);
sum+=byo[i];
}
hun=sum/60;
byo=sum%60;
printf("%d\n",hun);
printf("%d\n",byo);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: conflicting types for 'byo'; have 'int'
5 | int hun,byo;
| ^~~
main.c:4:13: note: previous declaration of 'byo' with type 'int[4]'
4 | int i,sum=0,byo[4];
| ^~~
|
s035343426 | p00477 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,d,x,y,z,ans;
scanf(%d %d %d %d",&a,&b,&c,&d);
x=a+b+c+d;
y=x/60;
z=x%60;
printf("%d\n",y);
printf("%d\n",z);
return 0;
}
| a.cc:5:26: warning: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^
a.cc:5:26: error: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc... |
s082047990 | p00477 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,d,x,y,z,ans;
scanf(%d %d %d %d",&a,&b,&c,&d);
x=a+b+c+d;
y=x/60;
z=x%60;
printf("%d\n",y);
printf("%d\n",z);
return 0;
}
| a.cc:5:26: warning: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^
a.cc:5:26: error: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc... |
s069852653 | p00477 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int ans=0, a;
for(int i=0; i<4; ++i){
scanf(" %d", &a);
ans += a;
}
int x=ans/60;
ans-=x*60;
printf("%d\n%d\n", x, ans);3151
return 0;
} | a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before 'return'
15 | printf("%d\n%d\n", x, ans);3151
| ^
| ;
16 |
17 | return 0;
| ~~~~~~
|
s425662897 | p00477 | C++ | #include<string>
#include<cstdio>
#include<cctype>
#include<iostream>
#include <algorithm>
#include<cmath>
#include<queue>
using namespace std;
int main(){
int second[5]={0}, ans[3];
cin >>a[1]>>a[2]>>a[3]>>a[4];
ans[2]=a[1]+a[2]+a[3]+a[4];
ans[1]=ans[3]/60;
ans[2]%=60;
... | a.cc: In function 'int main()':
a.cc:12:15: error: 'a' was not declared in this scope
12 | cin >>a[1]>>a[2]>>a[3]>>a[4];
| ^
|
s372565104 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,x,y;
cin>>a>>b>>c>>d>>'\n';
x=(a+b+c+d)/60;
y=(a+b+c+d)%60;
cout<<x<<'\n';
cout<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| ... |
s587309172 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,x,y;
cin>>a>>b>>c>>d>>'\n';
x=(a+b+c+d)/60;
y=(a+b+c+d)%60;
cout<<x<<'\n'<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| ... |
s376004218 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,x,y;
cin>>a>>b>>c>>d>>'\n';
x=(a+b+c+d)/60;
y=a+b+c+-x*60;
cout<<x<<'\n'<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| ... |
s287347921 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d>>'\n';
int x,y;
x=(a+b+c+d)/60;
y=a+b+c+d-x*60;
cout<<x<<'\n'<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| ... |
s381483334 | p00477 | C++ | int main() {
int t,sum=0,m,s;
for(int i=1; i<=4; i++){
cin>>t;
sum+=t;
}
m=sum/60;
s=sum-60*m;
cout<<m<<endl<<s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:17: error: 'cin' was not declared in this scope
4 | cin>>t;
| ^~~
a.cc:10:9: error: 'cout' was not declared in this scope
10 | cout<<m<<endl<<s<<endl;
| ^~~~
a.cc:10:18: error: 'endl' was not declared in this scope... |
s991522927 | p00477 | C++ | #include<iostream>
using namespace std;int a,sum;
main(){for(int i=0i<4;i++){cin>>a;sum+=a;}cout<<a/60<<endl<<a%60<<endl;} | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){for(int i=0i<4;i++){cin>>a;sum+=a;}cout<<a/60<<endl<<a%60<<endl;}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:20: error: invalid operands of types '__complex__ int' and 'int' to binary 'operator<'
3 | main()... |
s830831108 | p00477 | C++ | #include<stdio.h>
int main(void)
{
????????int m=0, n=0, i=0, j=0;
????????int a=0;
????????for (i = 0; i < 4; i++) {
????????????????scanf("%d", &a);
????????????????m = m + a;
????????}
????????n = m % 60;
????????m = m / 60;
????????printf("%d\n%d", m, n);
????????return 0;
}
?? | a.cc: In function 'int main()':
a.cc:4:1: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:2: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:3: error: expected primary-expression before '?' token
... |
s767603078 | p00477 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int data[5];
for(int i = 0;i < 5;i++)cin >> data;
cout << *min_element(data,data + 3) + *min_element(data + 3,data + 5) - 50 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:31: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [5]')
6 | for(int i = 0;i < 5;i++)cin >> data;
| ~~~ ^~ ~~~~
| | |
| ... |
s583584949 | p00477 | C++ | #include<iostream>
using namespase std;
int mian()
{
int a;
int sum=0;
int x,y;
int i;
for(i=0;i<4;i++)
{
cin >> a;
sum+=a;
}
x=sum/60;
sum%=60;
y=sum;
cout << x << endl;
cout << y << endl;
return 0;
} | a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'int mian()':
a.cc:12:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
12 | cin >> a;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/inclu... |
s460103766 | p00477 | C++ | #include<iostream>
using namespace std;
int mian()
{
int a;
int sum=0;
int x,y;
int i;
for(i=0;i<4;i++)
{
cin >> a;
sum+=a;
}
x=sum/60;
sum%=60;
y=sum;
cout << x << endl;
cout << y << endl;
return 0;
} | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s753559342 | p00477 | C++ | #include <iostream>
using namespace std;
int main(){
int data[4]={};
int sum =0;
for(int i =0;i < 4;i++)
{
cin >> data[i] >> endl;
sum = data[i];
}
cout << sum/60 << endl;
cout << sum%60 << endl;
}
| a.cc: In function 'int main()':
a.cc:10:22: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
10 | cin >> data[i] >> endl;
| ~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/i... |
s497372107 | p00477 | C++ | a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);} | a.cc:1:1: error: 'a' does not name a type
1 | a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);}
| ^
|
s371967856 | p00477 | C++ | int a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);} | a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
1 | int a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);}
| ^
|
s261055448 | p00477 | C++ | i;main(j){for(;~scanf("%d",&j)||!printf("%d\n%d\n",i/60,i%60);)i+=j;} | a.cc:1:1: error: 'i' does not name a type
1 | i;main(j){for(;~scanf("%d",&j)||!printf("%d\n%d\n",i/60,i%60);)i+=j;}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | i;main(j){for(;~scanf("%d",&j)||!printf("%d\n%d\n",i/60,i%60);)i+=j;}
| ^
|
s024647028 | p00477 | C++ | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);} | a.cc:1:1: error: 's' does not name a type
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ... |
s572992882 | p00477 | C++ | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);} | a.cc:1:1: error: 's' does not name a type
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ... |
s851198417 | p00477 | C++ | i;main(j){while(~scanf("%d",&j))i+=j;!printf("%d\n%d\n",i/60,i%60);} | a.cc:1:1: error: 'i' does not name a type
1 | i;main(j){while(~scanf("%d",&j))i+=j;!printf("%d\n%d\n",i/60,i%60);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | i;main(j){while(~scanf("%d",&j))i+=j;!printf("%d\n%d\n",i/60,i%60);}
| ^
|
s811591884 | p00477 | C++ | main(s,i){return~scanf("%d",&i)?main(s+i):!printf("%d\n%d\n",s/60,s%60);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(s,i){return~scanf("%d",&i)?main(s+i):!printf("%d\n%d\n",s/60,s%60);}
| ^
|
s878745321 | p00477 | C++ | int main(){int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);a+=b+c+d;printf("%d\n%d\n",a/60,a%60);} | a.cc: In function 'int main()':
a.cc:1:24: error: 'scanf' was not declared in this scope
1 | int main(){int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);a+=b+c+d;printf("%d\n%d\n",a/60,a%60);}
| ^~~~~
a.cc:1:63: error: 'printf' was not declared in this scope
1 | int main(){int a,b,c,d;scan... |
s330806938 | p00477 | C++ | #include<cstdio>
int main(){
int res=0,t;
for(int i=0;i<4;i++){
scanf("%d",&t);
res+=t
}
printf("%d\n%d\n",res/60,res%60);
} | a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before '}' token
7 | res+=t
| ^
| ;
8 | }
| ~
|
s437773721 | p00477 | C++ | #include<cstdio>
int main(){
int res=0,t;
for(int i=0;i<4;i++){
scanf("%d",&t);
res+=t
}
printf("%d\n%d\n",res/60,res%60);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before '}' token
7 | res+=t
| ^
| ;
8 | }
| ~
|
s179179998 | p00477 | C++ | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int sum = 0;
for(int i=0;i<4;i++){
sum += sc.nextInt();
}
System.out.println(sum/60);
System.out.println(sum%60);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s243353319 | p00477 | C++ | #incloud<stdio.h>
int main(){
int a,b,c,d,sum;
scanf("%d%d%d%d",&a,&b,&c,&d);
sum = a+b+c+d;
printf("%d\n%d",sum%60,sum/60);
} | a.cc:1:2: error: invalid preprocessing directive #incloud; did you mean #include?
1 | #incloud<stdio.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:5:1: error: 'scanf' was not declared in this scope
5 | scanf("%d%d%d%d",&a,&b,&c,&d);
| ^~~~~
a.cc:7:1: error: 'printf' was not dec... |
s490206124 | p00477 | C++ | #include "stdafx.h"
int main (){
int a,b,c,d;
scanf("%d%d%d%d", &a, &b, &c, &d);
a=a+b+c+d;
printf("%d\n%d", a/60, a%60);
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s945011429 | p00477 | C++ | int main (void){
int a,b,c,d;
scanf("%d%d%d%d", &a, &b, &c, &d);
a=a+b+c+d;
printf("%d\n%d", a/60, a%60);
} | a.cc: In function 'int main()':
a.cc:3:9: error: 'scanf' was not declared in this scope
3 | scanf("%d%d%d%d", &a, &b, &c, &d);
| ^~~~~
a.cc:5:9: error: 'printf' was not declared in this scope
5 | printf("%d\n%d", a/60, a%60);
| ^~~~~~
a.cc:1:1: note: 'printf' is defin... |
s806841576 | p00477 | C++ | #include <stdio.h>
int main(void){
int a;
int b;
int c;
int d;
int e;
int f;
int i;
int x;
scanf('%d%d%d%d',&a,&b,&c,&d);
x = a+b+c+d;
e = x/60;
f = x%60;
printf('%d\n',&e);
printf('%d\n',&f);
return 0;
} | a.cc:11:11: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
11 | scanf('%d%d%d%d',&a,&b,&c,&d);
| ^~~~~~~~~~
a.cc:15:12: warning: multi-character character constant [-Wmultichar]
15 | printf('%d\n',&e);
| ^~~~~~
a.cc:16:12: warning: multi-c... |
s173599463 | p00477 | C++ | #include <iostream>
using namespace std;
int main() {
int sum = 0;
for (int i = ; i < 4; i++) {
int x;
cin >> x;
sum += x;
}
cout << sum / 60 << endl;
cout << sum % 60 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:22: error: expected primary-expression before ';' token
6 | for (int i = ; i < 4; i++) {
| ^
|
s197938713 | p00477 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int a;
cin >>a;
int b;
cin >>b;
int c;
cin >>c;
int d;
cin >>d;
int e;
e=a+b+c+d;
int f;
f=0;
while(e=>60){
f=f+1;
e=e-60;}
cout << e<<endl;
cout << f<<endl;} | a.cc: In function 'int main()':
a.cc:17:9: error: expected primary-expression before '>' token
17 | while(e=>60){
| ^
|
s845608333 | p00477 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b, c, d;
int total = 0;
cin >> a >> b >> c >> d;
total = a + b + c + d;
int m, s
s = total % 60;
m = total / 60;
cout << m << endl << s << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:5: error: expected initializer before 's'
11 | s = total % 60;
| ^
a.cc:14:26: error: 's' was not declared in this scope
14 | cout << m << endl << s << endl;
| ^
|
s542223608 | p00477 | C++ | #include <iostream>
int main()
{
int a,b,c,d;
cin >> a >> b >> c >> d;
int sum=0;
sum=a+b+c+d;
cout << sum/60 << endl;
cout << sum%60 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> a >> b >> c >> d;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Link... |
s068425300 | p00478 | Java | import java.util.*;
class Main{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
String s,s2;
int n,de=0;
s = in.next();
n = in.nextInt();
for(int i=0;i<n;i++)
{
s2 = in.next();
int ln = s2.length();
s2 = s2 + s2;
while(ln*2-- > 0)
{
if(s2.contains(s))
... | Main.java:15: error: unexpected type
while(ln*2-- > 0)
^
required: variable
found: value
1 error
|
s114740943 | p00478 | Java | import java.util.*;
public class MainA {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int n = sc.nextInt();
String[] strs = new String[n];
String[] strss = new String[n];
for (int i = 0; i < n; i++) {
strs[i] = sc.next();
strss[i] = strs[i] + ... | Main.java:3: error: class MainA is public, should be declared in a file named MainA.java
public class MainA {
^
1 error
|
s057533284 | p00478 | Java | import java.io.*;
import java.util.*;
public class Ring {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int n = Integer.parseInt(sc.nextLine()), res = 0;
for (int i = 0; i < n; i++) {
String rin... | Main.java:4: error: class Ring is public, should be declared in a file named Ring.java
public class Ring {
^
1 error
|
s313411842 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
char *p;
int n,i;
int sum=0;
scanf("%s\n%d\n",&ch,&n);
char ring[n][21];
for(i=0;i<n;i++){
scanf("%s\n",&ring[i]);
ring[n+i]=ring[i];
}
for(i=0;i<n;i++){
if(strchr(ring[n],ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:10: error: assignment to expression with array type
12 | ring[n+i]=ring[i];
| ^
main.c:15:19: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Wint-conversion]
15 | if(strchr(ring[n],ch)==1)sum++;
| ^~
... |
s650641452 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
int n,i;
int sum=0;
int ring[21];
int ring2[21];
scanf("%s\n%d\n",&ch,&n);
for(i=0;i<n;i++){
scanf("%s\n",&ring);
ring2 = ring;
strcat(ring,ring2);
if(strchr(ring,ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:7: error: assignment to expression with array type
12 | ring2 = ring;
| ^
main.c:13:8: error: passing argument 1 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types]
13 | strcat(ring,ring2);
| ^~~~
| |
| ... |
s990256937 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
int n,i;
int sum=0;
char ring[21];
char ring2[21];
scanf("%s\n%d\n",&ch,&n);
for(i=0;i<n;i++){
scanf("%s\n",&ring);
ring2 = ring;
strcat(ring,ring2);
if(strchr(ring,ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:7: error: assignment to expression with array type
12 | ring2 = ring;
| ^
main.c:14:16: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Wint-conversion]
14 | if(strchr(ring,ch)==1)sum++;
| ^~
| ... |
s494646038 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
int n,i;
int sum=0;
char ringa[21];
char ringb[21];
scanf("%s\n%d\n",&ch,&n);
for(i=0;i<n;i++){
scanf("%s\n",&ringa);
ringb = ringa;
strcat(ringa,ringb);
if(strchr(ringa,ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:7: error: assignment to expression with array type
12 | ringb = ringa;
| ^
main.c:14:17: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Wint-conversion]
14 | if(strchr(ringa,ch)==1)sum++;
| ^~
| ... |
s011342754 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(void){
char a[11],c[11],b[21];
int i,j,n,c=0;
scanf("%s",a[11]);
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",c[11]);
for(j=0;j<20;j++){
if(j<10){
b[j]=a[j];
}
else{
b[j]=a[j-10];
}
}
if(strstr(b a){
c++;
}
}
printf("%d",&c);
return ... | main.c: In function 'main':
main.c:5:19: error: conflicting types for 'c'; have 'int'
5 | int i,j,n,c=0;
| ^
main.c:4:20: note: previous declaration of 'c' with type 'char[11]'
4 | char a[11],c[11],b[21];
| ^
main.c:18:28: error: expected ')' befo... |
s542885370 | p00478 | C | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
}}}}}printf("%d\n",s);exit(0);} | main.c:1:1: warning: data definition has no type or storage class
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^
main.c:1:1: error: type defaults to 'int'... |
s898167341 | p00478 | C | #include <cstdio>
#include <string.h>
int i;
int n,num=0;
int main(){
char search[10];
while(search[i]!=NULL) scanf("%c\n",&search[i]);
scanf("%d\n",&n);
for(int j=0;j<n;j++){
char array[10];
char array2[20];
scanf("%c",&array[i]);
strncat(array2,array,10);
strncpy(array2,array,10);
if (strpbrk(arr... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s957893605 | p00478 | C | #include <stdio.h>
int main(int argc,char* argv[]) {
char searchfor[11];
int ringnum;
int i;
int count;
char ring[11];
char ringbuf[21];
scanf("%s",searchfor);
scanf("%d",&ringnum);
count=0;
for(i=0;i<ringnum;i++) {
fscanf(in,"%s",ring);
strcpy(ringbuf,ring);
strcat(ringbuf,ring);
if(strstr(ringbuf,s... | main.c: In function 'main':
main.c:14:24: error: 'in' undeclared (first use in this function); did you mean 'i'?
14 | fscanf(in,"%s",ring);
| ^~
| i
main.c:14:24: note: each undeclared identifier is reported only once for each function it appe... |
s395420731 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char a[11];
char b[21];
int n;
int i,j,k;
bool f,f2;
int ans=0;
scanf("%s",a);
scanf("%d",&n);
for(i=0;i<n;i++){
f=false;
scanf("%s",b);
for(j=0;j<10;j++)b[j+10]=b[j];
for(j=0;j<10;j++){
f2=true;
for(k=0;k<strlen(a);k++){
if(a[k]!=b[j+k])f2=fal... | main.c: In function 'main':
main.c:8:9: error: unknown type name 'bool'
8 | bool f,f2;
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include<string.h>
+++ |+#include <stdbool.h>
3 | int main(){
main.... |
s729774331 | p00478 | C | #include <stdio.h>
int main(){
char moji[11],moji2[20],moji3[11];
int n,i,j,k,kai=0;
gets(moji);
scanf("%d",&n);
for(i=0;i<n;i++){
gets(moji2);
for(j=0;moji2[j]!='\n';j++){
moji3[j]=moji2[j];
}
moji3[j]='\n';
for(k=0;moji3[k]!='\n';k++.j++){
moji2[j]=moji3[k];
}
moji2[j]='\n'
for(j=0;j<10;j++){
for(k=0;moji[k]==moji[... | main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(moji);
| ^~~~
| fgets
main.c:15:27: error: request for member 'j' in something not a structure or union
15 | for(k=0;moji3[k]!='\n';k++.j++){
... |
s781009471 | p00478 | C | #include <stdio.h>
int main(){
char moji[11]={'\0'},moji2[21]={'\0'},moji3[11]={'\0'};
int n,i,j,k,kai=0,t;
gets(moji);
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%c", &moji2[0]);
scanf("%c", &moji2[1]);
scanf("%c", &moji2[2]);
scanf("%c", &moji2[3]);
scanf("%c", &moji2[4]);
scanf("%c", &moji2[5]);
scanf("%c", &moji2[6... | main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(moji);
| ^~~~
| fgets
main.c:20:15: error: expected ';' before 'for'
20 | moji2[10]='\0'
| ^
| ;
21 | for... |
s119897212 | p00478 | C | #include <stdio.h>
int main(){
char moji[11]={'\0'},moji2[21]={'\0'},moji3[11]={'\0'};
int n,i=0,j,k,f=0,kai=0,t;
scanf("%s",moji);
scanf("%d",&n);
for(i=0;i<n;i++){
f=0;
scanf("%s",moji2);
for(j=0;j<10;j++){
moji3[j]=moji2[j];
}
moji3[10]='\0';
for(k=0;moji... | main.c: In function 'main':
main.c:35:1: error: expected declaration or statement at end of input
35 | }
| ^
|
s089009477 | p00478 | C | #include <stdio.h>
int main(){
char moji[11]={'\0'},moji2[21]={'\0'},moji3[11]={'\0'};
int n,i=0,j,k,kai=0,t;
scanf("%s",moji);
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",moji2);
for(j=0;j<10;j++){
moji3[j]=moji2[j];
}
moji3[10]='\0';
for(k=0;moji3[k]!='\0';k++)... | main.c: In function 'main':
main.c:31:1: error: expected declaration or statement at end of input
31 | }
| ^
|
s851891044 | p00478 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string find;
cin >> find;
int a;
cin >> a;
int count = 0 ;
for (int i = 0; i < a; i++)
{
string ring;
cin >> ring;
int u = ring.find();
if (loc != string::npos)
count++;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:14:34: error: no matching function for call to 'std::__cxx11::basic_string<char>::find()'
14 | int u = ring.find();
| ~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/loca... |
s418386368 | p00478 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <limits.h>
//#include <windows.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <queue>
#include <functional>
using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef ... | a.cc: In function 'void func()':
a.cc:477:38: error: expected ';' before ':' token
477 | break:
| ^
| ;
a.cc:477:38: error: expected primary-expression before ':' token
|
s120637334 | p00478 | C++ | #include<string>
using namespace std;
string sample;
int n, counter = 0;
bool solve()
{
string ring;
cin >> ring;
for (int i = 0; i < ring.size(); i++){
if (ring[i] == sample[0]){
for (int j = 1; j < sample.size(); j++){
if (sample[j] != ((ring.size() <= i + j) ? ring[i + j - ring.size()] : ring[i + j]))... | a.cc: In function 'bool solve()':
a.cc:10:9: error: 'cin' was not declared in this scope
10 | cin >> ring;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<string>
+++ |+#include <iostream>
2 | us... |
s222509308 | p00478 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string>
int main(void)
{
char str[11], ring[100][11];
int number, str_len;
scanf("%s", str);
str_len = strlen(str);
scanf("%d", &number);
for (int i = 0; i < number; i++) {
scanf("%s", ring[i]);
}
int ring_count = 0, ring_len;
for (int i = 0; i... | a.cc: In function 'int main()':
a.cc:12:19: error: 'strlen' was not declared in this scope
12 | str_len = strlen(str);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <string>
+++ |+#include... |
s727028483 | p00478 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string>
int main()
{
char str[11], ring[100][11];
int number, str_len;
scanf("%s", str);
str_len = strlen(str);
scanf("%d", &number);
for (int i = 0; i < number; i++) {
scanf("%s", ring[i]);
}
int ring_count = 0, ring_len;
for (int i = 0; i < n... | a.cc: In function 'int main()':
a.cc:12:19: error: 'strlen' was not declared in this scope
12 | str_len = strlen(str);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <string>
+++ |+#include... |
s572022043 | p00478 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main(){
int ringCount = 0;
int findCount = 0;
char targetStr[11];
char tempRing[11];
int targetStringLength;
int tempStringLength;
bool isSame = true;
cin >> targetStr >> ringCount;
targetStringLength = strlen(targetStr);
for(int i=0;i<ringCount... | a.cc: In function 'int main()':
a.cc:21:67: error: 'stringLength' was not declared in this scope; did you mean 'tempStringLength'?
21 | if(targetStr[k] != tempRing[(j+k)%stringLength]){
| ^~~~~~~~~~~~
| ... |
s261653369 | p00478 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string char1,ring;
cin>>char1;
int num=0;
cin>>num;
for(int i=0;i<num;i++){
cin>>ring;
ring=ring+ring;
string::size_type index=ring.find(char1);
if(index==string::npos){
num--;
}
}
cout<<num2<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:15: error: 'num2' was not declared in this scope; did you mean 'num'?
21 | cout<<num2<<endl;
| ^~~~
| num
|
s451695254 | p00478 | C++ | #include<iostream>
#include<string>
using namespace std;
string S,T;
int main(){
int n;cin>>S>>n;int c=0;
for(int i=0;i<n;i++){
cin>>T;T+=T;
int flag=0;
for(int i=0;i<T.size()-S.size()+1;i++){
if(T.substr(i,S.size())==S){flag=1;}
}
c+=flag;
}
cout<<flag<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:15: error: 'flag' was not declared in this scope
15 | cout<<flag<<endl;
| ^~~~
|
s376067793 | p00478 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string w, s;
cin >> N;
int cnt = 0;
Rep(i,N) {
cin >> s;
cnt += s.find(w) != string::npos;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'N' was not declared in this scope
7 | cin >> N;
| ^
a.cc:9:7: error: 'i' was not declared in this scope
9 | Rep(i,N) {
| ^
a.cc:9:3: error: 'Rep' was not declared in this scope
9 | Rep(i,N) {
| ^~~
|
s918849203 | p00478 | C++ | #include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0;i < N;i++)
int main()
{
string w, s;
cin >> N;
int cnt = 0;
Rep(i,N) {
cin >> s;
cnt += s.find(w) != string::npos;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'N' was not declared in this scope
7 | cin >> N;
| ^
|
s702622018 | p00478 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
char a[100], b[100], str[100];
int i, j, cnt = 0, n;
scanf("%s", str);
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s", a);
strcpy(b, a)
if (strstr(b, str) != 0) {
cnt++;
}
}
printf("%d\n", cnt);
} | a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before 'if'
11 | strcpy(b, a)
| ^
| ;
12 | if (strstr(b, str) != 0) {
| ~~
|
s472668311 | p00478 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
char a[100], b[100], str[100];
int i, j, cnt = 0, n;
scanf("%s", str);
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s", a);
strcpy(a, a);
if (strstr(a, str) != 0) {
cnt++;
}
}\\
printf("%d\n", cnt);
} | a.cc:16:10: error: stray '\' in program
16 | }\\
17 | printf("%d\n", cnt);
|
s323281145 | p00478 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(){
char find_str[10];
int ling_qty;
scanf("%s",&find_str);
scanf("%d",&ling_qty);
char str_buff[11];
char str_sum[20];
int find_count = 0;
for(int i = 0; i < ling_qty; i++){
scanf("%s",str_buff);
strcpy(str_sum,str_buff);
strcat(str_sum,s... | a.cc: In function 'int main()':
a.cc:17:5: error: 'strcpy' was not declared in this scope
17 | strcpy(str_sum,str_buff);
| ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <stdlib.h>
+++ |+#include <cstring>
... |
s590992845 | p00478 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
#include<string>
int main()
{
string ryuta,ryutan[101];
int n,i,m,r=0;
cin>>ryuta>>n;
for(i=1;i<=n;i++)
{
cin>>ryutan[i];
}
for(i=1;i<=n;i++)
{
m=0;
m=ryutan[i].find(ryuta);
if(m>=0)
{
r++;
}
cout<<r<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:24:10: error: expected '}' at end of input
24 | }
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s982661225 | p00478 | C++ | #include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
string rotate(string &in){
string ret=in.substr(1);
return ret+in[0];
}
bool isc(string tar,string a){
rep(i,a.size()){
if (search(a.begin(),a.end(),tar.begin(),tar.end()) != a.end())return true;
... | a.cc: In function 'bool isc(std::string, std::string)':
a.cc:13:15: error: no matching function for call to 'search(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator)'
13 | if (search(a.be... |
s016409421 | p00478 | C++ | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);} | a.cc:1:1: error: 'a' does not name a type
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:17: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(s... |
s796352613 | p00478 | C++ | a,C;main(b){for(;~scanf("%s",a?&b:&a);)strstr(strcat(strdup(&b),&b),&a)&&C++;C=!printf("%d\n",C);} | a.cc:1:1: error: 'a' does not name a type
1 | a,C;main(b){for(;~scanf("%s",a?&b:&a);)strstr(strcat(strdup(&b),&b),&a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
1 | a,C;main(b){for(;~scanf("%s",a?&b:&a);)strstr(strcat(strdup(&b),&b... |
s701827279 | p00478 | C++ | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);} | a.cc:1:1: error: 'a' does not name a type
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^
a.cc:1:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b... |
s225769162 | p00478 | C++ | #include<cstdio>
#include<cstring>
int main(){
int a,res=0;
char x[20],y[40],z[20];
scanf("%s",&x);
scanf("%d",&a);
for(int i=0;i<a;i++){
scanf("%s",&y);
strcpy(z,y);
strcat(y,);
if(strstr(y,x)){
res++;
}
}
printf("%d\n",res);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:10: error: expected primary-expression before ')' token
12 | strcat(y,);
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.