submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s687295854 | p03797 | C | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define print printf("%ld", answer)
int main(void){
longlong N, M, answer, k, l;
scanf("%ld", &N);
scanf("%ld", &M);
if(N>=0&&M<=1000000000000)
{
if(M%2==0)
{
k = M/2;
if(N>=k)
{
answer = k;
}
if(N==k-1)
{
... | main.c: In function 'main':
main.c:7:3: error: unknown type name 'longlong'
7 | longlong N, M, answer, k, l;
| ^~~~~~~~
|
s632775343 | p03797 | C | #include<stdio.h>
int main()
{
int snum,cnum,ans;
ans=0
scanf("%d %d",&snum,&cnum);
if(snum*2>cnum) {
ans+=(int)(cnum/2);
}else{
ans+=(int)((cnum-snum*2)/4)+snum;
}
printf("%d\n",ans);
return 0;
} | main.c: In function 'main':
main.c:6:14: error: expected ';' before 'scanf'
6 | ans=0
| ^
| ;
7 | scanf("%d %d",&snum,&cnum);
| ~~~~~
|
s667624569 | p03797 | C | #include<stdio.h>
int main()
{
int snum,cnum,ans;
scanf("%d %d",&snum,&cnum);
if(snum>=cnum*2) ans=snum;
if(snum<cnum*2) ans=(int)((snum-2cnum)/3)+snum;
printf("%d\n",ans);
return 0;
} | main.c: In function 'main':
main.c:8:41: error: invalid suffix "cnum" on integer constant
8 | if(snum<cnum*2) ans=(int)((snum-2cnum)/3)+snum;
| ^~~~~
|
s946029142 | p03797 | C | #include<stdio.h>
int main()
{
int N,M,ans;
scanf("%d %d",&N,&M);
if(N>=M*2) ans=N;
if(N<M*2) ans=(int)((M-2N)/3)+N;
printf("%d",ans);
return 0;
} | main.c: In function 'main':
main.c:8:32: error: invalid suffix "N" on integer constant
8 | if(N<M*2) ans=(int)((M-2N)/3)+N;
| ^~
|
s546137169 | p03797 | C | #include<stdio.h>
int main()
{
int N,M,ans;
scanf("%d %d",N,M);
if(N>=M*2) ans=N;
if(N<M*2) ans=(int)((M-2N)/3)+N;
printf("%d",ans);
return 0;
} | main.c: In function 'main':
main.c:8:32: error: invalid suffix "N" on integer constant
8 | if(N<M*2) ans=(int)((M-2N)/3)+N;
| ^~
|
s823796020 | p03797 | C | #include<stdio.h>
Int main()
{
int N,M,ans;
scanf("%d %d",N,M);
if(N>=M*2) ans=N;
if(N<M*2) ans=(M-2N)/3+N;
printf("%d",ans);
return 0;
} | main.c:3:1: error: unknown type name 'Int'; did you mean 'int'?
3 | Int main()
| ^~~
| int
main.c: In function 'main':
main.c:8:26: error: invalid suffix "N" on integer constant
8 | if(N<M*2) ans=(M-2N)/3+N;
| ^~
|
s237205345 | p03797 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long a = scan.nextlong();
long b = scan.nextlong();
long c = b-a*2;
long d = c/4;
System.out.println(a+d);
}
} | Main.java:5: error: cannot find symbol
long a = scan.nextlong();
^
symbol: method nextlong()
location: variable scan of type Scanner
Main.java:6: error: cannot find symbol
long b = scan.nextlong();
^
symbol: method nextlong()
location: variable scan of type Scanner
2 errors
|
s298755765 | p03797 | C++ | #include <iostream>
int main() {
int N;
std::cin >> N;
int remainder = 1;
for (int i = 1; i <= N; i++) {
remainder = remainder * i
remainder %= 10e+9 +7;
}
std::cout << remainder << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:28: error: expected ';' before 'remainder'
8 | remainder = remainder * i
| ^
| ;
9 | remainder %= 10e+9 +7;
| ~~~~~~~~~
|
s778609894 | p03797 | C++ | #include <iostream>
using namespace std;
int N, M;
int main(){
cin >> N >> M;
// long long int ns = N;
// long long int rc = M - N * 2;
// while(rc < 0){
// ns --;
// rc = M - rc*2;
// }
long long int ns = min(N, M/2);
long long int rs = m - ns * 2;
ns += rc / 4;
cout << ns << endl;
}
| a.cc: In function 'int main()':
a.cc:14:28: error: 'm' was not declared in this scope
14 | long long int rs = m - ns * 2;
| ^
a.cc:15:15: error: 'rc' was not declared in this scope; did you mean 'rs'?
15 | ns += rc / 4;
| ^~
| ... |
s182420440 | p03797 | C++ | #include <iostream>
using namespace std;
int main()
{
__int64 N, M, cnt = 0;
cin >> N >> M;
if (N >= M * 2)
cnt = N;
else
cnt = N + (M - 2 * N) / 4;
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
6 | __int64 N, M, cnt = 0;
| ^~~~~~~
| __int64_t
a.cc:7:16: error: 'N' was not declared in this scope
7 | cin >> N >> M;
| ^
a.cc:... |
s639050893 | p03797 | C++ | #include<iostream>
using namespace std;
int main(){
long long a,b;
std::cin>>a>>b;
if(a=>(b/2)){
std::cout<<(b/2);
}else{
std::cout<<(a+((b-2a)/4));
}
} | a.cc: In function 'int main()':
a.cc:6:14: error: expected primary-expression before '>' token
6 | if(a=>(b/2)){
| ^
a.cc:9:35: error: unable to find numeric literal operator 'operator""a'
9 | std::cout<<(a+((b-2a)/4));
| ^~
|
s107618413 | p03797 | C++ | #include<iostream>
int main ()
{
long long int n,m;
//std::string s;
std::cin>>n >> m /*>>c>>s*/;
if (2*n>=m)
{
long long int j;
j=m/2
stdu:cout<<j /*<< " "*/ <<std::endl;
}
else
{
long long int k;
k=(m-2*n)/4;
std::... | a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before 'stdu'
12 | j=m/2
| ^
| ;
13 | stdu:cout<<j /*<< " "*/ <<std::endl;
| ~~~~
|
s571890486 | p03797 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long s = sc.nextInt();
long c = sc.nextInt();
long result = 0;
if (c <= s * 2) {
result = Math.round(c / 2);
c = c % 2;
} else {
result = s;
c = c - s * 2;
result = result + c / 4;
}
Syste... | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s183556912 | p03797 | C++ | let id x = x
let (n,m) = Scanf.scanf "%d %d\n" (fun n m -> (n,m))
let sc s c x =
if (2*s) <= c then ((c-2*s),s) else (0,c/2)
let cx = sc n m 0
let c = fst cx
let x = snd cx
let ans = x + c/4
let () = Printf.printf "%d\n" ans | a.cc:1:1: error: 'let' does not name a type
1 | let id x = x
| ^~~
|
s801924278 | p03797 | C | #include <stdio.h>
int main ()
{
int ans=0,n,m,i;
scanf("%d%d",&n,&m);
ans=n;
if(n*2<m)
{
while(m-4>0)
{
m-=4;
ans++;
}
printf("%d",ans);
return 0;
}
| main.c: In function 'main':
main.c:18:1: error: expected declaration or statement at end of input
18 | }
| ^
|
s431938799 | p03797 | C++ | #include<stdio.h>
#include<stdlib.h>
long long int n,m,a,b,c;
int main(void){
scanf("%lld",n);
scanf("%lld",m);
a = n - m / 2;
if(a < 0){
b = a / 4
}else{
b = n
}
printf("%lld",b)
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:11: error: expected ';' before '}' token
11 | b = a / 4
| ^
| ;
12 | }else{
| ~
a.cc:13:6: error: expected ';' before '}' token
13 | b = n
| ^
| ;
14 | }
| ~
a.cc:15:17: error: expected ... |
s290444804 | p03797 | C++ | #include<stdio.h>
#include<stdlib.h>
long long int n,m,a,b,c;
int main(void){
scanf("%lld",n);
scanf("%lld",m);
a = n - m / 2;
if(a < 0){
b = a / 4
}else{
b = n
}
printf("%lld",b)
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:11: error: expected ';' before '}' token
11 | b = a / 4
| ^
| ;
12 | }else{
| ~
a.cc:13:6: error: expected ';' before '}' token
13 | b = n
| ^
| ;
14 | }
| ~
a.cc:15:17: error: expected ... |
s936292094 | p03797 | C | #include<stdio.h>
int main()
{
int i,j,n,m;
scanf("%d%d",&n,&m);
if(2*n<=m)
printf("%d",int(n+(m-2*n)*1.0/4));
else printf("%d",int(n-(2*n-m)*1.0/4));
} | main.c: In function 'main':
main.c:7:21: error: expected expression before 'int'
7 | printf("%d",int(n+(m-2*n)*1.0/4));
| ^~~
main.c:8:26: error: expected expression before 'int'
8 | else printf("%d",int(n-(2*n-m)*1.0/4));
| ^~~
|
s170309855 | p03797 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(void){
long long N, M;
cin >> N >> M;
int total = 0;
if(2*N <= M){
total = N + (M - 2 * N) / 4;
}
else{
total = floor(M / 2);
}
cout << total << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:17: error: 'floor' was not declared in this scope
17 | total = floor(M / 2);
| ^~~~~
|
s439740975 | p03797 | C++ | #include <iostream>
using namespace std;
int main()
{
long long n;
long long i;
long long o;
cin >> n;
cin >> i;
o = 1;
if (n <= i * 2)
o = n + (i - 2 * n) / 4;
else (i <= n / 2)
o = i / 2;
cout << o << endl;
} | a.cc: In function 'int main()':
a.cc:22:27: error: expected ';' before 'o'
22 | else (i <= n / 2)
| ^
| ;
23 | o = i / 2;
| ~
|
s189137851 | p03797 | C++ | #include <iostream>
using namespace std;
int main()
{
long long n;
long long i;
long long o;
cin >> n;
cin >> i;
o = 1;
if (n <= i * 2)
o = n + (i - 2 * n) / 4;
else if (i =< n / 2)
o = i / 2;
else
o = n;
cout << o << endl;
} | a.cc: In function 'int main()':
a.cc:22:21: error: expected primary-expression before '<' token
22 | else if (i =< n / 2)
| ^
|
s949339359 | p03797 | C++ | #include <iostream>
using namespace std;
int main()
{
long long n;
long long i;
long long o;
cin >> n;
cin >> i;
o = 1;
if (n <= i * 2)
o = n + (i - 2 * n) / 4;
else if (i < n/2)
o=i/2
else
o = n;
cout << o << endl;
} | a.cc: In function 'int main()':
a.cc:23:22: error: expected ';' before 'else'
23 | o=i/2
| ^
| ;
24 |
25 | else
| ~~~~
|
s131199095 | p03797 | C++ | #include <iostream>
using namespace std;
int main() {
int n, m, scc;
cin >> n >> m;
if (n-m/2==0)scc=n;
else if(n-m/2>0)scc=m/2;
else if (n-m/2<0)scc=n+(m-n*2)/4;
cout << scc << '/n';
// your code goes here
return 0;
} | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:12:24: warning: multi-character character constant [-Wmultichar]
12 | cout << scc << '/n';
| ^~~~
a.cc:3:1: error: '\U000000a0' does not name a type
3 |
| ^
|
s546831922 | p03797 | C | #include <stdio.h>
int main (void)
{
int i,n,m,ans=0;
scanf("%d%d",&n,&m);
if(n*2>=m)
{
ans+=m/2;
}
else
{
ans+=n;
m=m-n*2;
ans+=m/4
}
printf("%d",&ans);
return 0;
} | main.c: In function 'main':
main.c:17:13: error: expected ';' before '}' token
17 | ans+=m/4
| ^
| ;
18 | }
| ~
|
s527520838 | p03797 | C++ | #include<iostream>
using namespace std;
int main() {
int s, c, x = 0;;
cin >> s >> c;
while(1){
if(s < 1 || c < 2) break;
if (s >= 1 || c >= 2) {
x++;
s -= 1;
c -= 2;
}
}
while(1) {
if(c < 4) break;
if(c >= 4) {
x++;
c -= 4;
}
}
cout << x << endl
... | a.cc: In function 'int main()':
a.cc:25:20: error: expected ';' before 'return'
25 | cout << x << endl
| ^
| ;
26 |
27 | return 0;
| ~~~~~~
|
s846053051 | p03797 | Java | import java.util.Scanner;
/**
* Created by User on 2017/02/18.
*/
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long n = scanner.nextLong();
long m = scanner.nextLong();
int count = 0;
while (n > 0) {
n-... | Main.java:6: error: illegal character: '\u3000'
public class Main?{
^
1 error
|
s360632772 | p03797 | C++ | #include <iostream>
using namespace std;
int main()
{
_I64_MAX n;
_I64_MAX i;
_I64_MAX o;
cin >> n;
cin >> i;
o = 1;
if (n <= i * 2)
o = n + (i - 2*n) / 4;
else
o = n;
cout << o << endl;
} | a.cc: In function 'int main()':
a.cc:6:9: error: '_I64_MAX' was not declared in this scope
6 | _I64_MAX n;
| ^~~~~~~~
a.cc:8:17: error: expected ';' before 'i'
8 | _I64_MAX i;
| ^~
| ;
a.cc:10:17: error: expected ';' before 'o'
10 | ... |
s190366236 | p03797 | C | #include<stdio.h>
#include<math.h>
int main(void){
int n,m,k,i=0;
scanf("%d %d",&n,&m);
while(n<m) {
m=m-n*2; i++
}
k=m/4;
printf("%d",i+k);
return 0;
} | main.c: In function 'main':
main.c:9:15: error: expected ';' before '}' token
9 | m=m-n*2; i++
| ^
| ;
10 | }
| ~
|
s606023383 | p03797 | C++ | #include <iostream>
using namespace std;
int main()
{
_I64_MAX n;
_I64_MAX i;
_I64_MAX o;
cin >> n;
cin >> i;
o = 1;
if (n <= i * 2)
o = n + (i - 2*n) / 4;
else
o = n;
cout << o << endl;
} | a.cc: In function 'int main()':
a.cc:6:9: error: '_I64_MAX' was not declared in this scope
6 | _I64_MAX n;
| ^~~~~~~~
a.cc:8:17: error: expected ';' before 'i'
8 | _I64_MAX i;
| ^~
| ;
a.cc:10:17: error: expected ';' before 'o'
10 | ... |
s714103533 | p03797 | C++ | #include <iostream>
using namespace std;
int main() {
int n, m, scc;
cin >> n >> m;
if (n==m/2)scc=n;
else if (n>m/2)scc=m/2;
else if (n<m/2)scc=n+(m-n*2)/4;
cout << scc << '\n';
// your code goes here
return 0;
} | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:3:1: error: '\U000000a0' does not name a type
3 |
| ^
|
s737380864 | p03797 | C++ | #include <iostream>
using namespace std;
int mod = 1000000007;
int main() {
// your code goes here
int N;
cin >> N;
for(long long i= 1,j = 1;i <= N;i++){
j *= i;
j %= mod;
}
cout << j << endl;
int N,M;
cin >> N >> M;
if(N/2 > M){
cout << M+(N-2*M)/4 << endl;
}
else{
cout << N/2 << endl;
}
return 0... | a.cc: In function 'int main()':
a.cc:13:17: error: 'j' was not declared in this scope
13 | cout << j << endl;
| ^
a.cc:14:13: error: redeclaration of 'int N'
14 | int N,M;
| ^
a.cc:7:13: note: 'int N' previously declared here
7 | int N;
| ... |
s253115406 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b;
long long s=0;
cin>>a>>b;
s+=a;
b-=a*2;
if(b<0)s+=b*2
s+=b/4;
cout<<s<<endl;
} | a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before 's'
9 | if(b<0)s+=b*2
| ^
| ;
10 | s+=b/4;
| ~
|
s173021573 | p03797 | C++ | #define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
using namespace std;
int main(){
long long N,M;
cin >> N >> M;
... | a.cc: In function 'int main()':
a.cc:25:27: error: expected ';' before '{' token
25 | else(nokori_c < 0){
| ^
| ;
|
s121322019 | p03797 | Java | import java.util.Scanner;
import java.util.ArrayList;
import java.util.HashSet;
import java.lang.Integer;
import java.lang.StringBuilder;
import java.lang.Math;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long N = in.nextLong();
long M =... | Main.java:30: error: reached end of file while parsing
ozaw
^
1 error
|
s601429433 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long int n, m;
cin >> n >> m;
if(m<2*n) coutn << m/2 << endl;
else cout << n+((m-2*n)/4) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:15: error: 'coutn' was not declared in this scope
7 | if(m<2*n) coutn << m/2 << endl;
| ^~~~~
|
s849927000 | p03797 | C | #include <stdio.h>
int main (void){
int M,N,a,b,c,d;
scanf("%d %d",&M,&N);
a=2*M+N;
b=(a-a%4)/4;
if (N>=2*b) printf("%d\n",b);
if (N<2*b) {
c=(N-N%2)/2;
printf("%d\n",c);
}
}
return 0; | main.c:13:1: error: expected identifier or '(' before 'return'
13 | return 0;
| ^~~~~~
|
s368419333 | p03797 | C | #include <stdio.h>
int main (void){
int M,N,a,b,c,d;
scanf("%d %d",&M,&N);
a=2*M+N;
b=(a-a%4)/4;
if (N>=2*b) printf("%d\n",b);
if (N<2*b) {
c=(N-N%2)/2;
printf("%d\n",c);
}
}
return 0; | main.c:13:1: error: expected identifier or '(' before 'return'
13 | return 0;
| ^~~~~~
|
s768664370 | p03797 | C++ | #include <stdio.h>
int main (void){
int M,N,a,b,c,d;
scanf("%d %d",&M,&N);
a=2*M+N;
b=(a-a%4)/4;
if (N>=2*b) printf("%d\n",b);
if (N<2*b) {
c=(N-N%2)/2;
printf("%d\n",c);
}
}
return 0; | a.cc:13:1: error: expected unqualified-id before 'return'
13 | return 0;
| ^~~~~~
|
s397849637 | p03797 | C++ | int main() {
long n, m;
std::cin >> n >> m;
long cnt = 0;
while (true) {
if (n >= 1 && m >= 2) {
n--;
m -= 2;
cnt++;
}
else if (n == 0 && m > 2){
n++;
m -= 2;
}
else {
break;
}
}
std::cout << cnt << std::endl;
} | a.cc: In function 'int main()':
a.cc:3:14: error: 'cin' is not a member of 'std'
3 | std::cin >> n >> m;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int main() {
a.cc:21:14... |
s392101479 | p03797 | C++ | #include <stdio.h>
int main (void){
int M,N,a,b,c,d;
scanf("%d %d",&M,&N);
a=2*M+N;
b=(a-a%4)/4;
if (N>=2*b) printf("%d\n",b);
if (N<2*b) {
c=(N-N%2)/2;
printf("%d\n",c);
}
return 0; | a.cc: In function 'int main()':
a.cc:12:10: error: expected '}' at end of input
12 | return 0;
| ^
a.cc:2:16: note: to match this '{'
2 | int main (void){
| ^
|
s381363803 | p03797 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
static const int INF = 1 << 28;
#define D(x) cout << x << endl;
#define d(x) cout << x;
typedef... | a.cc:24:18: error: declaration does not declare anything [-fpermissive]
24 | typedef int long long;
| ^~~~
|
s792483183 | p03798 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
#include<map>
#include<stack>
#include<set>
#include<utility>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ll> P;
typedef unsigned long long i... | a.cc: In function 'int main()':
a.cc:46:23: error: 'class std::vector<char>' has no member named 'substr'
46 | cout<<A.substr(0,N)<<endl;
| ^~~~~~
|
s892327817 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define agewari(a, b) ((ll)a + ((ll)b - 1)) / b
const int MOD = 1000000007;
const long long INF = 1LL << 60;
using Graph = vector<vector<ll>>;
int main()
{
ll n;
string s;
cin >> n >> s;... | a.cc: In function 'int main()':
a.cc:89:10: error: redeclaration of 'char ans'
89 | char ans;
| ^~~
a.cc:47:10: note: 'char ans' previously declared here
47 | char ans;
| ^~~
a.cc:131:10: error: redeclaration of 'char ans'
131 | char ans;
| ^~~
a.cc:47:10... |
s492542800 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x)... | a.cc: In function 'int main()':
a.cc:135:2: error: 'else' without a previous 'if'
135 | else cout << -1 << endl;
| ^~~~
|
s029784581 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using vvl = vector<vector<long>>;
using pii = pair<int, int>;
using pil ... | /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
|
s704212523 | p03798 | C++ | #include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>
#define BEGIN(x) x.begin(... | a.cc: In function 'bool check(int, std::string&, const std::string&)':
a.cc:69:42: error: 'answer' was not declared in this scope; did you mean 'Answer'?
69 | now = guess(S[0], Answer.back(), answer[0]);
| ^~~~~~
| ... |
s488551849 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define S 0
#define W 1
... | a.cc: In function 'int main()':
a.cc:31:49: error: 'i' was not declared in this scope
31 | ans[n+2] = (ans[0]+ans[1]+(s.at(i)!='o'))%2;
| ^
|
s812050486 | p03798 | C++ | #include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#de... | a.cc: In function 'int main()':
a.cc:78:22: error: expected '}' at end of input
78 | cout << -1 << endl;
| ^
a.cc:28:11: note: to match this '{'
28 | int main(){
| ^
|
s450437645 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
string s;
cin>>N>>s;
vector<int> animal={1,-1};
vector<int> ss(N);
bool flag=false;
for(int i=0;i<2;i++){
for(int j=0;j<2;j++){
int ss.at(0)=animal.at(i);
int ss.at(1)=animal.at(j);
for(int k=1;k<N-1;k++){
int ... | a.cc: In function 'int main()':
a.cc:13:13: error: expected initializer before '.' token
13 | int ss.at(0)=animal.at(i);
| ^
a.cc:14:13: error: expected initializer before '.' token
14 | int ss.at(1)=animal.at(j);
| ^
|
s314535877 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
vecetor<bool> solve(int n, vector<bool> &s)
{
for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++)
{
vector<bool> res(n);
res[0] = i;
res[1] = j;
for(int k = 2; k < n; k++)
res[k] = (res[k - 2] ^ re... | a.cc:4:1: error: 'vecetor' does not name a type
4 | vecetor<bool> solve(int n, vector<bool> &s)
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:34:28: error: 'solve' was not declared in this scope
34 | vector<bool> res = solve(n, v);
| ^~~~~
|
s515450952 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
vecetor<bool>(int n, vector<bool> &s)
{
for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++)
{
vector<bool> res(n);
res[0] = i;
res[1] = j;
for(int k = 2; k < n; k++)
res[k] = (res[k - 2] ^ res[k - ... | a.cc:4:1: error: 'vecetor' does not name a type
4 | vecetor<bool>(int n, vector<bool> &s)
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:34:28: error: 'solve' was not declared in this scope
34 | vector<bool> res = solve(n, v);
| ^~~~~
|
s641451320 | p03798 | Java | mport java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String input = sc.next();
char[] result = new char[n];
Arrays.fill(result, 'S');
if (input.charAt... | Main.java:1: error: class, interface, enum, or record expected
mport java.util.Arrays;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
|
s143611517 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
char p[101000];
int S[101000],P[101000],n;
int main()
{
scanf ("%d",&n);
scanf ("%S",p);
int i,j;
for(i=0;p[i];i++)
{
if(p[i]=='o')P[i+1]=0;
else P[i+1]=1;
}
P[n+1]=P[1];
for(i=0;i<8;i++)
{
S[0]=i&1;
S[1]=(i>>1)&1;
S[2]=(i>>2)&1;
for(j=2;j<=n+1;j++)
{
S[j+1]=S[j-2]... | a.cc: In function 'int main()':
a.cc:25:48: error: expected identifier before numeric constant
25 | if(S[0]^S[n]^S[1]^S[n+1]||S[1]^S[n+1]^[2]^S[n+2])continue;
| ^
a.cc: In lambda function:
a.cc:25:50: error: expected '{' before '^' token
25 | if... |
s612960006 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
const int M=le6;
int a[M];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef LOCAL
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int n;
string s;
cin>>n>>s;
s=s+s;
for(int i1=0;i1<2;i1++)
{
for(int i2=0;i2<2... | a.cc: In function 'int main()':
a.cc:5:13: error: 'le6' was not declared in this scope
5 | const int M=le6;
| ^~~
a.cc:6:7: error: size of array 'a' is not an integral constant-expression
6 | int a[M];
| ^
a.cc:7:9: warning: empty parentheses were disambiguated as a function declar... |
s994131360 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,m,i,j,f[100010],yc[100010];
bool g;
cin>>n;
char x;
for(i=1;i<=n;i++){
cin>>x;
if(x=='o')f[i]=1;
else f[i]=0;
}
yc[1]=1;yc[2]=1;
g=0;
for(i=3;i<=n;i++){
if(yc[i-1]==1){
if(f[i-1]==1)
yc[i]=yc[i-2];
else{
if(yc[i-2]==1)yc... | a.cc: In function 'int main()':
a.cc:109:12: error: 'gx' was not declared in this scope; did you mean 'x'?
109 | if(gx==0){
| ^~
| x
|
s615264038 | p03798 | C++ | // luogu-judger-enable-o2
#include<bits/stdc++.h>
#define lson (o<<1)
#define rson (o<<1|1)
#define fi first
#define sc second
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
using namespace std;
const double pi=acos(-1);
const double eps=1e-6;... | a.cc: In function 'int main()':
a.cc:62:17: error: 'wlf' was not declared in this scope
62 | wlf[0]=i&1;
| ^~~
|
s389115595 | p03798 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define MATH_PI 3.14159265358979323846264338327950288419716939
#define DIVIDER9 1000000007
#define lli long long int
#include <iostream>
#include <string.h>
#include <fstream>
#include <math.h>
using namespace std;
#ifdef _WIN32
#pragma warning(disable : 4101)
signed wait(){
char wai... | a.cc: In function 'int main()':
a.cc:238:9: error: 'GC' was not declared in this scope; did you mean 'gc'?
238 | GC(s);
| ^~
| gc
|
s760356128 | p03798 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define MATH_PI 3.14159265358979323846264338327950288419716939
#define DIVIDER9 1000000007
#define lli long long int
#include <iostream>
#include <string.h>
#include <fstream>
#include <math.h>
using namespace std;
#ifdef _WIN32
#pragma warning(disable : 4101)
signed wait(){
char wai... | a.cc: In function 'int main()':
a.cc:238:9: error: 'Gc' was not declared in this scope; did you mean 'gc'?
238 | Gc(s);
| ^~
| gc
|
s101522965 | p03798 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define MATH_PI 3.14159265358979323846264338327950288419716939
#define DIVIDER9 1000000007
#define lli long long int
#include <iostream>
#include <string.h>
#include <fstream>
#include <math.h>
using namespace std;
#ifdef _WIN32
#pragma warning(disable : 4101)
signed wait(){
char wai... | a.cc: In function 'int main()':
a.cc:238:9: error: 'Gc' was not declared in this scope; did you mean 'gc'?
238 | Gc(s);
| ^~
| gc
|
s626695320 | p03798 | C++ | #include <iostream>
#include <sstream>
#include <vector>
#include <cassert>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <tuple>
#include <regex>
#include <map>
#include <cstdint>
#include <set>
#include <deque>
using namespace std;
using ull = unsigned long lo... | a.cc: In function 'std::string solve(std::string)':
a.cc:28:27: error: 'setanimals' was not declared in this scope
28 | const auto ret1 = setanimals(s, "SS");
| ^~~~~~~~~~
|
s730658670 | p03798 | C++ | bool ok(char a,char x,char y,char b)
{
if(x=='o'&&y=='S'&&a=='S'&&b=='S')return true;
if(x=='o'&&y=='S'&&a=='W'&&b=='W')return true;
if(x=='x'&&y=='S'&&a=='S'&&b=='W')return true;
if(x=='x'&&y=='S'&&a=='W'&&b=='S')return true;
if(x=='o'&&y=='W'&&a=='S'&&b=='W')return true;
if(x=='o'&&y=='W'&&a=='W'&&b=='S')return... | a.cc: In function 'void dfs(int)':
a.cc:15:17: error: 'n' was not declared in this scope
15 | if(now==n-1)
| ^
a.cc:17:23: error: 't' was not declared in this scope
17 | if(ok(t[n-2],s[n-1],t[n-1],t[0])&&ok(t[n-1],s[0],t[0],t[1]))end_(t);
| ... |
s627977833 | p03798 | C | #include<bits/stdc++.h>
using namespace std;
int n;
string s,t;
char c[2]={'W','S'};
void end_(string t)
{
cout<<t;
exit(0);
}
char change(char c)
{
if(c=='S')
return 'W';
else
return 'S';
}
bool ok(char a,char x,char y,char b)
{
if(x=='o'&&y=='S'&&a=='S'&&b=='S')return true;
if(x=='o'&&y=='S'&&a=='W'&&b=='W'... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s235963570 | p03798 | C++ | #ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;
typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define p... | a.cc: In function 'int main()':
a.cc:288:13: error: 'i' was not declared in this scope
288 | FOR(i,0,4){
| ^
a.cc:288:9: error: 'FOR' was not declared in this scope
288 | FOR(i,0,4){
| ^~~
|
s981735713 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
int n, flg=0;
string s, ss, str[4]={"SS","SW","WS","WW"};
cin >> n >> s;
for(int i=0;i<4;++i){
ss = str[i];
for(int j=1;j<s.size();++j){
if(ss[j]=="S"){
if(ss[j-1]=="S"){
if(s[j]=="o"){
ss += "S";
... | a.cc: In function 'int main()':
a.cc:13:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if(ss[j]=="S"){
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(ss[j-1]=="S"){
a.cc:15:18: error: ISO C++ forbids comparison ... |
s062756244 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
int n;
string s;
vector<char> a,b,c,d;
int main(){
cin>>n>>s;
a.push_back('S');
a.push_back('S');
b.push_back('S');
b.push_back('W');
c.push_back('W');
c.push_back('S');
d.push_back('W');
d.push_back('W');
for(int i=1;i<n;i++){
if(a[i]=='S'){
if... | a.cc: In function 'int main()':
a.cc:163:2: error: expected '}' at end of input
163 | }
| ^
a.cc:148:26: note: to match this '{'
148 | if(c.front()==c.back()){
| ^
a.cc:163:2: error: expected '}' at end of input
163 | }
| ^
a.cc:141:26: note: to match this '{'
141 ... |
s374304135 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
string s;cin>>s;
int a[n+1];
int g=0,h;
vector<int>b={1,1,2,2};
vector<int>c={1,2,1,2};
for(int j=0;j<4;j++){
a[0]=b.at(j);a[1]=c.at(j);
if(a[0]==1){
if(a[1]==1){
if(s[0]=='o'){
h=1;
}
... | a.cc: In function 'int main()':
a.cc:89:7: error: break statement not within loop or switch
89 | break;
| ^~~~~
a.cc: At global scope:
a.cc:92:3: error: expected unqualified-id before 'if'
92 | if(g==1){
| ^~
a.cc:98:3: error: expected unqualified-id before 'else'
98 | else if(g==... |
s992133306 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
string s;cin>>s;
int a[n+1];
int g=0,h;
vector<int>b={1,1,2,2};
vector<int>c={1,2,1,2};
for(int j=0;j<4;j++){
a[0]=b.at(j);a[1]=c.at(j);
if(a[0]==1){
if(a[1]==1){
if(s[i]=='o'){
h=1;
}
... | a.cc: In function 'int main()':
a.cc:14:16: error: 'i' was not declared in this scope
14 | if(s[i]=='o'){
| ^
a.cc:22:16: error: 'i' was not declared in this scope
22 | if(s[i]=='o'){
| ^
a.cc:32:16: error: 'i' was not declared in this scope
32 | ... |
s606300280 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(n);i++)
int gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%b);
}
int lcm(int a,int b){
return a/gcd(a,b)*b;
}
int n,ok=-1;
string s;
string ans[4]={"SS","SW","WS","WW"};
signed main(){
cin>... | a.cc: In function 'int main()':
a.cc:20:56: error: incompatible types in assignment of 'char' to 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
20 | if((s[j]=='o')^(ans[i][j-1]==ans[i][j]))ans+='W';
| ~~~^~~~~
|
s092054449 | p03798 | C++ | #include <cstdio>
#include <string>
using namespace std;
int n;
bool *isO;
char *ans;
void assign(char zero, char one) {
char a[n];
a[0] = zero;
a[1] = one;
for (int i = 2; i < n; i++) {
if ((a[i-1] == 'S') == isO[i-1]) {
a[i] = a[i-2];
} else {
if (a[i-2] == 'S... | a.cc: In function 'void assign(char, char)':
a.cc:27:13: error: 'strcpy' was not declared in this scope
27 | strcpy(ans, a);
| ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <string>
+++ |+#inc... |
s944463187 | p03798 | C++ | #include<iostream>
#include<string>
#include<complex>
#include<vector>
#include<algorithm>
#include<functional>
#include<array>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define INF 1e+9
int main() {
int n;
cin >> n;
string s;
cin >> s;
bool ans = false;
vector<char> v(100005);... | a.cc: In function 'int main()':
a.cc:35:22: error: redeclaration of 'std::vector<char> v'
35 | vector<char> v(100005);
| ^
a.cc:21:22: note: 'std::vector<char> v' previously declared here
21 | vector<char> v(100005);
| ^
a.cc:49:22: error: rede... |
s468070147 | p03798 | C++ | #include<iostream>
#include<string>
#include<complex>
#include<vector>
#include<algorithm>
#include<functional>
#include<array>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define INF 1e+9
int main() {
int n;
cin >> n;
string s;
cin >> s;
bool ans = false;
vector<char> v;
v[1] =... | a.cc: In function 'int main()':
a.cc:35:22: error: redeclaration of 'std::vector<char> v'
35 | vector<char> v;
| ^
a.cc:21:22: note: 'std::vector<char> v' previously declared here
21 | vector<char> v;
| ^
a.cc:49:22: error: redeclaration of 'st... |
s112238847 | p03798 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
string s;
cin>>s;
string x(n,'0');
x[0]='S';
x[1]='S';
for(int i=1;i<n-1;i++){
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='S')x[i+1]='S';
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='W')x[i+1]='W';
if(s[i]=='o'&&x[i]=='W'&&x[i-1]=='S')x[i+1]='W';
... | a.cc: In function 'int main()':
a.cc:115:54: error: lvalue required as unary '&' operand
115 | else if(x[n-1]=='W'&&x[n-2]==x[0])f=&true;
| ^~~~
a.cc:120:47: error: lvalue required as unary '&' operand
120 | if(x[0]=='S'&&x[n... |
s259741634 | p03798 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
string s;
cin>>s;
string x(n,'0');
x[0]='S';
x[1]='S';
for(int i=1;i<n-1;i++){
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='S')x[i+1]='S';
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='W')x[i+1]='W';
if(s[i]=='o'&&x[i]=='W'&&x[i-1]=='S')x[i+1]='W';
... | a.cc: In function 'int main()':
a.cc:26:9: error: 'f' was not declared in this scope
26 | f=true;
| ^
|
s369031837 | p03798 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
string s;
cin>>s;
string x(n,'0');
x[0]='S';
x[1]='S';
for(int i=1;i<n-1;i++){
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='S')x[i+1]='S';
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='W')x[i+1]='W';
if(s[i]=='o'&&x[i]=='W'&&x[i-1]=='S')x[i+1]='W';
... | a.cc: In function 'int main()':
a.cc:37:47: error: expected primary-expression before '=' token
37 | if(x[0]=='S'&&x[n-1]==x[1])f&&=true;
| ^
a.cc:73:47: error: expected primary-expression before '=' token
73 | if(x[0]=='S'&&x[n-1... |
s112165089 | p03798 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
string s;
cin>>s;
string x(n,'0');
x[0]='S';
x[1]='S';
for(int i=1;i<n-1;i++){
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='S')x[i+1]='S';
if(s[i]=='o'&&x[i]=='S'&&x[i-1]=='W')x[i+1]='W';
if(s[i]=='o'&&x[i]=='W'&&x[i-1]=='S')x[i+1]='W';
... | a.cc: In function 'int main()':
a.cc:55:14: error: redeclaration of 'bool f'
55 | bool f=false;
| ^
a.cc:26:14: note: 'bool f' previously declared here
26 | bool f=false;
| ^
a.cc:84:14: error: redeclaration of 'bool f'
84 | bool f=false;
| ... |
s868400204 | p03798 | C++ | #include<iostream>
#include<queue>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<functional>
#include<set>
using namespace std;
#define int long long
typedef pair<int, int>P;
int w[4][100005];
signed main() {
int n; cin >> n;
string s; cin >> s;
memset(w, -1, sizeof(w))... | a.cc: In function 'int main()':
a.cc:17:9: error: 'memset' was not declared in this scope
17 | memset(w, -1, sizeof(w));
| ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
9 | #include<set>
+++ |+#include <cstring>
... |
s585224280 | p03798 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n,a=0,b=[100000];
string s;
cin>>n>>s;
for(int i=1;i<n;i++)
{
if(s[i]=="x")
{a++
b[a]=i;}
}
if(a%2==1){
cout<<"-1";
return 0}
for(int i=0;i<a;i=i+2)
{
for(int j=b[i]+1;j<b[i+1];j++)
{s[j]="w";}}
cout<<s;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:14: error: expected identifier before numeric constant
5 | int n,a=0,b=[100000];
| ^~~~~~
a.cc: In lambda function:
a.cc:5:21: error: expected '{' before ';' token
5 | int n,a=0,b=[100000];
| ^
a.cc: In function 'int main()':
a.... |
s715944300 | p03798 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
char ans[10001],spe[10001];
int n;
bool c(char l)
{
switch(l)
{
case 'o':return true;
case 'x':return false;
case 'S':return true;
case 'W':return false;
}
}
char c(bool l){return (l?'S':'W');}
char func(int i,int j)
{return (c((c(spe[i])==c(ans[i]))==(c(spe[j]))... | a.cc: In function 'bool comp(char, char)':
a.cc:24:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
24 | {spe[i]==func[i];}
| ^
a.cc:24:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
24 | {spe[i]==func[i];}
| ~~~~~~^~~~~~~~~
a.cc:... |
s922758877 | p03798 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
char ans[10001],spe[10001];
int n;
bool c(char l)
{
switch(l)
{
case 'o':return true;
case 'x':return false;
case 'S':return true;
case 'W':return false;
}
}
char c(bool l){return (l?'S':'W');}
char func(int i,int j)
{return (c((c(spe[i])==c(ans[i]))==(c(spe[j]))... | a.cc: In function 'bool comp(char, char)':
a.cc:24:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
24 | {spe[i]=func[i];}
| ^
a.cc:24:15: error: invalid conversion from 'char (*)(int, int)' to 'char' [-fpermissive]
24 | {spe[i]=func[i];}
| ~~~~~~^
| ... |
s428143873 | p03798 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
char ans[10001],spe[10001];
bool c(char l)
{
switch(l)
{
case 'o':return true;
case 'x':return false;
case 'S':return true;
case 'W':return false;
}
}
char c(bool l){return (l?'S':'W');}
char func(int i,int j)
{return (c((c(spe[i])==c(ans[i]))==(c(spe[j]))));}
bo... | a.cc: In function 'bool comp(char, char)':
a.cc:22:11: error: 'n' was not declared in this scope
22 | for(i=2;i<n;i++)
| ^
a.cc:23:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
23 | {spe[i]=func[i];}
| ^
a.cc:23:15: error: invalid conversion from 'char... |
s363490199 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;
int main(){
int n;
string s;
cin>>n>>s;
string ans(n,'S');
if(s[0]=='o'){
ans[1... | a.cc: In function 'int main()':
a.cc:95:12: error: redeclaration of 'std::string ans'
95 | string ans(n,'W');
| ^~~
a.cc:14:12: note: 'std::string ans' previously declared here
14 | string ans(n,'S');
| ^~~
|
s146063568 | p03798 | C | #include <stdio.h>
#define MAXNUM 100001
char judge[MAXNUM] = {'\0'};
int animal[MAXNUM] = {-1};
void solve(char judge, int *animal);
int main(void)
{
int N = 0;
int i;
scanf("%d", &N);
scanf("%s", judge);
animal[0] = 0; //S:0, W:1
animal[N - 1] = 1;
for (i = 0; i < N; i++)
judge... | main.c: In function 'main':
main.c:19:9: error: called object 'judge' is not a function or function pointer
19 | judge(i);
| ^~~~~
main.c:4:6: note: declared here
4 | char judge[MAXNUM] = {'\0'};
| ^~~~~
main.c:35:9: error: called object 'judge' is not a function or function poin... |
s434217616 | p03798 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
string _s;
cin>>n>>_s;
bool s[100200] = {};
for(int i = 0;i < n;i++)s[i] = _s[i] == 'o' ? 0 : 1;
bool b[100200] = {};
for(int q = 0;q < 3;q++){
b[0] = q&1;
b[1] = q&2;
for(int i = 2;i < n;i++){
b[i] ... | a.cc: In function 'int main()':
a.cc:19:18: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int')
19 | cout << s[j] == 0 ? 'S' : 'W';
| ~~~~~~~~~~~~ ^~ ~
| | |
| | int
... |
s952583642 | p03798 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
string _s;
cin>>n>>_s;
bool s[100200] = {};
for(int i = 0;i < n;i++)s[i] = _s[i] == 'o' ? 0 : 1;
bool b[100200] = {};
for(int q = 0;q < 3;q++){
b[0] = q&1;
b[1] = q&2;
for(int i = 2;i < n;i++){
b[i] = b[i-2] ^ s[i-1];
}
if(b[n-1] == b[1] ^ s[0]){
for(int j = 0... | a.cc: In function 'int main()':
a.cc:19:11: error: 'i' was not declared in this scope
19 | cout << s[i] == 0 ? 'o' : 'x';
| ^
|
s806506989 | p03798 | C++ | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
char *search(char a, char b, char *s, int N) {
char *ans = (char *)malloc(N + 1);
ans[0] = a;
ans[1] = b;
for (int i = 0; i < N - 1; i++) {
if (s[i + 1] == 'o' && ans[i + 1] == 'S') {
ans[i + 2] = ans[i];
} else if (... | a.cc: In function 'int main()':
a.cc:53:14: error: 'epoch1' was not declared in this scope; did you mean 'epoch0'?
53 | } else if (epoch1 != NULL) {
| ^~~~~~
| epoch0
a.cc:55:14: error: 'epoch2' was not declared in this scope; did you mean 'epoch0'?
55 | } else if (epoch2... |
s727785432 | p03798 | C++ | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <math.h>
#include <map>
#include <set>
#define sc scanf
#define pr printf
using namespace std;
typedef long long ll;
const int N = 100000+100;
bool ans[N];
char str[N];
bool hander_ans(int n);
boo... | a.cc: In function 'bool hander_ans(int)':
a.cc:76:50: error: expected ';' before '{' token
76 | if((is_right(n-1,0,n-2) && is_right(0,1,n-1))
| ^
| ;
77 | {
| ~ ... |
s321530346 | p03798 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll query(int left, int now, char c) {
if(now == 0) {
return (c == 'o') ? left : (left+1) % 2;
}
return (c == 'x') ? left : (left+1) % 2;
}
int arr[100001];
const int dir[4] = {{0,0},{0,1},{1,0},{1,1}};
string solve(ll n, string s) {
for(... | a.cc:13:44: error: cannot convert '<brace-enclosed initializer list>' to 'const int' in initialization
13 | const int dir[4] = {{0,0},{0,1},{1,0},{1,1}};
| ^
a.cc:13:44: error: cannot convert '<brace-enclosed initializer list>' to 'const int' in initialization
a.cc:13... |
s446155249 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef int64_t ll;
#define REP(i,m,n) for (int i=m;i<n;i++)
#define FOR(i,m,n,a) for(int i=m;i<n;i+=a)
const ll MOD=1e9+7;
int n;
int MAX=100000;
char p[MAX+2];
bool ans[MAX+2];
bool solve(){
REP(i,2,(n+2)+1){
if(p[i-1]=='o'){
ans[i]=(ans[i-1])?ans[i-2]:(!ans[... | a.cc:10:11: error: size of array 'p' is not an integral constant-expression
10 | char p[MAX+2];
| ~~~^~
a.cc:11:13: error: size of array 'ans' is not an integral constant-expression
11 | bool ans[MAX+2];
| ~~~^~
|
s911467612 | p03798 | C | #include <stdio.h>
int main()
{
int N;
char S[100001];
int syu[100001];
int i;
scanf("%d", &N);
scanf("%s", &S);
// 1 = S
// -1 = W
while(k < 4) {
if(k == 0) {
syu[0] = 1;
syu[1] = 1;
} else if(k == 1) {
syu[0] = 1;
syu[1] = -1;
} else if(k == 2) {
syu[0] ... | main.c: In function 'main':
main.c:15:9: error: 'k' undeclared (first use in this function)
15 | while(k < 4) {
| ^
main.c:15:9: note: each undeclared identifier is reported only once for each function it appears in
|
s362676746 | p03798 | C++ | #include <sstream>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
typedef long long ll;
#define REP(i,n) for(int ... | a.cc: In function 'int main()':
a.cc:64:83: error: 'isExitst' was not declared in this scope; did you mean 'isExist'?
64 | else if(check[j][i+1] == 'W' && check[j][i] != check[j][0]) { isExitst = j; break; }
| ... |
s266155328 | p03798 | C++ | #include "stdafx.h"
#include <stdio.h>
int main () {
long long int N,i;
int a[10000],b[10000],c,j,k;
scanf("%lld", &N);
char S[10000],T[10000];
scanf("%s", S);
for(i=0;i<N;i++){
if (S[i]=='o') a[i]=1;
if (S[i]=='x') a[i]=-1;
}
for(j=-1;j<=1;j=j+2){
for(k=-1;k<=1;k=k+2){
b[0]=j, b[1]=k;
for(i=0;i<N-2;i++){
if(b[i+1]*a[i... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s470499517 | p03798 | C | #include <stdio.h>
int main () {
long long int N,i;
int a[10000],b[10000],c,j,k;
scanf("%lld", &N);
char S[N-1],T[N-1];
scanf("%s", S);
for(i=0;i<N;i++){
if (S[i]=='o') a[i]=1;
if (S[i]=='x') a[i]=-1;
}
for(j=-1;j<=1;j=j+2){
for(k=-1;k<=1;k=k+2){
b[0]=j, b[1]=k;
for(i=0;i<N-2;i++){
if(b[i+1]*a[i+1]==1) b[i+2]=b[i];
i... | main.c: In function 'main':
main.c:12:1: error: stray '\302' in program
12 | <U+00A0>
| ^~~~~~~~
|
s344395879 | p03798 | C | #include <stdio.h>
int main () {
long long int N,i;
int a[10001],b[10001],c,j,k;
scanf("%lld", &N);
char S[N+1],T[N+1];
scanf("%s", S);
for(i=1;i<=N;i++){
if (S[i-1]=='o') a[i]=1;
if (S[i-1]=='x') a[i]=-1;
}
for(j=-1;j<=1;j=j+2){
for(k=-1;k<=1;k=k+2){
b[1]=j, b[2]=k;
for(i=1;i<=N-2;i++){
if(b[i+1]*a[i+1]==1) b[i+2]=b... | main.c: In function 'main':
main.c:12:1: error: stray '\302' in program
12 | <U+00A0>
| ^~~~~~~~
|
s431039497 | p03798 | C | #include<stdio.h>
#define S 100003
int N;
char list[S];
char s[S];
char getInv(char c){
if( c == 'S' ){
return 'W';
}
return 'S';
}
void output(){
int i;
for( i = 1; i <= N; i++ ){ printf("%c", list[i]); }
printf("\n");
return;
}
/*
void say(){
int r, i;
const char Sans[2] = {'x', 'o'};
const char Wans... | main.c: In function 'main':
main.c:85:19: error: subscripted value is neither array nor pointer nor vector
85 | s[N+1] = S[1];
| ^
|
s003670663 | p03798 | C | #include <stdio.h>
int main () {
int N,a[10000],b[10000],i;
scanf("%d", &N);
char S[N+1],T[N+1];
scanf("%s", S);
for(i=1;i<=N;i++){
if (S[i-1]=='o') a[i]=1;
if (S[i-1]=='x') a[i]=-1;
}
b[1]=1, b[2]=1;
for(i=1;i<=N-2;i++){
if(b[i+1]*a[i+1]==1) b[i+2]=b[i];
if(b[i+1]*a[i+1]==-1) b[i+2]=-b[i];
}
if(a[N]*b[N]==b[N-1]*b[1... | main.c: In function 'main':
main.c:11:1: error: stray '\302' in program
11 | <U+00A0>
| ^~~~~~~~
main.c:25:1: error: stray '\302' in program
25 | <U+00A0>
| ^~~~~~~~
main.c:39:1: error: stray '\302' in program
39 | <U+00A0>
| ^~~~~~~~
main.c:53:1: error: stray '\302' in program
53 | <U+00A... |
s420448354 | p03798 | C | #include <stdio.h>
int main () {
int N,a[10000],b[10000],i;
scanf("%d", &N);
char S[N+1],T[N+1];
scanf("%s", S);
for(i=1;i<=N;i++){
if (S[i-1]=='o') a[i]=1;
if (S[i-1]=='x') a[i]=-1;
}
b[1]=1, b[2]=1;
for(i=1;i<=N-2;i++){
if(b[i+1]*a[i+1]==1) b[i+2]=b[i];
if(b[i+1]*a[i+1]==-1) b[i+2]=-b[i];
}
if(a[N]*b[N]==b[N-1]*b[1... | main.c: In function 'main':
main.c:11:1: error: stray '\302' in program
11 | <U+00A0>
| ^~~~~~~~
main.c:25:1: error: stray '\302' in program
25 | <U+00A0>
| ^~~~~~~~
main.c:31:52: error: 'c' undeclared (first use in this function)
31 | if(a[N]*b[N]==b[N-1]*b[1] && a[1]*b[1]==b[N]*b[2]&&c==0) {
... |
s970094241 | p03798 | C++ | #include <iostream>
#include <string>
using namespace std;
int mod = 1000000007;
bool ii[100000],oo[100000];
void p(){
string str;
for(int i = 0;i < N;i++){
if(oo[i]) str += 'S';
else str += 'W';
}
cout << str;
}
int main() {
// your code goes here
int N;
string in,out;
cin >> N;
cin >> in;
for(int i ... | a.cc: In function 'void p()':
a.cc:10:27: error: 'N' was not declared in this scope
10 | for(int i = 0;i < N;i++){
| ^
|
s389239100 | p03798 | C++ | /* . ∧_∧
( ´・ω・)
//\ ̄ ̄旦\
// ※ \___\
\\ ※ ※ ※ ヽ
\ヽ-___--___ヽ*/
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n);
#define vsort(v) sort(v.begin(),v.end());
#define vvso... | a.cc:46:9: error: 'cout' does not name a type
46 | cout<<-1<<endl;
| ^~~~
a.cc:47:1: error: expected declaration before '}' token
47 | }
| ^
|
s277749132 | p03798 | C++ | #include <bits/stdc++.h>
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
using namespace std;
int uni[1000010];
void init(int N){
for(int i=0;i<N;i++){
uni[i]=-1;
}
}
int root(int a){
if(uni[a] < 0)return a;
else return uni[a] = root(uni[a]);
}
bool... | a.cc: In function 'void ch()':
a.cc:40:17: error: 'n' was not declared in this scope
40 | for(int i=0;i<n-1;i++){
| ^
a.cc:41:8: error: 's' was not declared in this scope
41 | if(s[i]=='o' && animal[i]==1){
| ^
a.cc:51:8: error: 's' was not declared in this scope
51 | ... |
s031581406 | p03798 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N;
string str;
cin >> N >> str;
bool nxor[N];
for (int i = 0; i < N; i++) {
nxor[i] = (str[i] == 'o');
}
int line[N];
line[0] = 0;
line[1] = 0;
for (int i = 2; i < N; i++) {
if (line[i-1] == 0) {
line[i] = (nxor[i-1] ? line[i-2] : ~line[i-2]);
}
else {
lin... | a.cc: In function 'int main()':
a.cc:33:14: error: expected ']' before '}' token
33 | if (!line[N-1} && !nxor[N-1] && line[N-2] == line[0]) {
| ^
| ]
a.cc:33:14: error: expected ')' before '}' token
33 | if (!line[N-1} && !nxor[N-1] && line[N-2] == line[0]) {
| ~ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.