submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s900425684 | p04019 | C++ | #include <iostream>
#include<iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
#define... | a.cc: In function 'int main()':
a.cc:45:9: error: 'else' without a previous 'if'
45 | else No;
| ^~~~
|
s461473879 | p04019 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))... | a.cc: In function 'int main()':
a.cc:29:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
29 | if(X[i] = "S") sflag = true;
| ^~~
| |
| const char*... |
s909016594 | p04019 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))... | a.cc:29:14: error: extended character is not valid in an identifier
29 | if(X[i] = 'S') sflag = true;
| ^
a.cc:30:14: error: extended character is not valid in an identifier
30 | if(X[i] = 'N') nflag = true;
| ^
a.cc:31:14: error: extended character is not v... |
s586011010 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, n = 1, w = 1, e = 1, s = 1;
string s;
cin >> s;
for(i=0; i<s.length(); i++){
if(s[i] == 'N'){
n = 0;
}else if(s[i] == 'W'){
w = 0;
}else if(s[i] == 'S'){
s = 0;
}else{
... | a.cc: In function 'int main()':
a.cc:6:12: error: conflicting declaration 'std::string s'
6 | string s;
| ^
a.cc:5:33: note: previous declaration as 'int s'
5 | int i, n = 1, w = 1, e = 1, s = 1;
| ^
a.cc:8:18: error: request for member 'length' in ... |
s220783270 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, n == 1, w == 1, e == 1, s == 1;
string s;
cin >> s;
for(i=0; i<s.length(); i++){
if(s[i] == 'N'){
n = 0;
}else if(s[i] == 'W'){
w = 0;
}else if(s[i] == 'S'){
s = 0;
}else... | a.cc: In function 'int main()':
a.cc:5:14: error: expected initializer before '==' token
5 | int i, n == 1, w == 1, e == 1, s == 1;
| ^~
a.cc:10:13: error: 'n' was not declared in this scope
10 | n = 0;
| ^
a.cc:12:13: error: 'w' was not declared in this scope... |
s776350296 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n == 1, w == 1, e == 1, s == 1;
string s;
cin >> s;
for(i=0; i<s.length(); i++){
if(s[i] == 'N'){
n = 0;
}else if(s[i] == 'W'){
w = 0;
}else if(s[i] == 'S'){
s = 0;
}else{
... | a.cc: In function 'int main()':
a.cc:5:11: error: expected initializer before '==' token
5 | int n == 1, w == 1, e == 1, s == 1;
| ^~
a.cc:8:9: error: 'i' was not declared in this scope
8 | for(i=0; i<s.length(); i++){
| ^
a.cc:10:13: error: 'n' was not declared in this sco... |
s379942849 | p04019 | C++ | #include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int n=0;
int s=0;
int w=0;
int e=0;
for(int i=0;i<s.size();i++){
if(s.at(i)=='N')n++;
else if(s.at(i)=='S')s++;
else if(s.at(i)=='W')w++;
else e++;
}
if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==0)||(w==0&&e!=0)){
... | a.cc: In function 'int main()':
a.cc:8:7: error: conflicting declaration 'int s'
8 | int s=0;
| ^
a.cc:5:10: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:13:27: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
13 | else if(s.at(i)... |
s450652138 | p04019 | C++ | #include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int n=0,s=0,w=0,e=0;
for(int i=0;i<s.size();i++){
if(s.at(i)=='N')n++;
else if(s.at(i)=='S')s++;
else if(s.at(i)=='W')w++;
else e++;
}
if((n!=0&&s==0)||(n==0&&s!=0)||(w!=0&&e==0)||(w==0&&e!=0)){
cout << "No" << end... | a.cc: In function 'int main()':
a.cc:7:11: error: conflicting declaration 'int s'
7 | int n=0,s=0,w=0,e=0;
| ^
a.cc:5:10: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:10:27: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
10 | ... |
s261347902 | p04019 | C++ | #include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#define REP(i, N) for(int i = 0; i < N; ++i)
#define FOR(i, M, N) for(int i = M; i < N; ++i)
using namespace std;
int main() {
string trip;
cin >> trip;
bool N = 0, W = 0, S = 0, E = 0;
N = bool(min(count(trip.... | a.cc: In function 'int main()':
a.cc:17:21: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type, int)'
17 | N = bool(min(count(trip.begin(), trip.end(), 'N'), 1));
| ~~~^~~~~~... |
s315697643 | p04019 | C++ | #include <iostream>
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main() {
char s[5] = "NSEW";
char str[1001] = {};
cin >> str;
int N = strlen(str);
bool f[4] = { false,false,false,false };
for (int i = 0; i < N; i++) {
for (int k = 0; k < 4; k++) {
... | a.cc:31:2: error: stray '#' in program
31 | }#include <iostream>
| ^
a.cc:31:3: error: 'include' does not name a type
31 | }#include <iostream>
| ^~~~~~~
a.cc:40:5: error: redefinition of 'int main()'
40 | int main() {
| ^~~~
a.cc:10:5: note: 'int main()' previously defined here
10 ... |
s085792695 | p04019 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
string s;
cin >> s;
int N = 0, int W = 0;
int S = 0; int E = 0;
bool NS = false; bool WE = false;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'N') {
N++;
... | a.cc: In function 'int main()':
a.cc:13:20: error: expected unqualified-id before 'int'
13 | int N = 0, int W = 0;
| ^~~
a.cc:21:25: error: 'W' was not declared in this scope
21 | W++;
| ^
a.cc:30:14: error: 'W' was not declare... |
s269205363 | p04019 | C++ | #include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<unistd.h>
#include <array>
#include <map>
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;
struct point{
int x... | a.cc: In function 'int main()':
a.cc:161:22: error: expected ';' before ':' token
161 | cout<<"Yes"<<endl:
| ^
| ;
|
s236126510 | p04019 | C++ | =begin
, \ / ,
/ \ )\__/( / \
/ \ (_\ /_) / \
____/_____\__\@ @/___/_____\____
| |\../| |
| \VV/ |
| ------hoi------- |
|_________________________________|
| /\ / \\ \ /\... | a.cc:2:17: error: stray '\' in program
2 | , \ / ,
| ^
a.cc:3:12: error: stray '\' in program
3 | / \ )\__/( / \
| ^
a.cc:3:18: error: stray '\' in program
3 | / \ )\__/( / \
| ^
a.cc:4:13: er... |
s554039202 | p04019 | C++ | #include<algorithm>
#include<iostream>
#include<functional>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
string x;
char y;
int ns=0,ew=0,n=0,e=0,w=0,s=0;
cin>>x;
for(int i=0;i<x.size();i++){
y=x[i];
if(y=='N')
n++;
else if(y=='E')
e++;
else if(y=='S')
s+... | a.cc: In function 'int main()':
a.cc:27:11: error: lvalue required as left operand of assignment
27 | if(ns=1 and ew=1)
| ~~^~~~~~
a.cc:29:16: error: lvalue required as left operand of assignment
29 | else if(ns=0 and ew=0)
| ~~^~~~~~
|
s658772669 | p04019 | C++ | #include<algorithm>
#include<iostream>
#include<functional>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
string x;
char y;
int ns=0,ew=0,n=0,e=0,w=0,s=0;
cin>>x;
for(int i=0;i<x.size();i++){
y=x[i];
if(y==N)
n++;
else if(y==E)
e++;
else if(y==S)
s++;
... | a.cc: In function 'int main()':
a.cc:14:11: error: 'N' was not declared in this scope
14 | if(y==N)
| ^
a.cc:16:16: error: 'E' was not declared in this scope
16 | else if(y==E)
| ^
a.cc:18:16: error: 'S' was not declared in this scope
18 | else if(y==S)
| ... |
s902138500 | p04019 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main() {
int S=0,N=0,E=0,W=0;
bool ans=false;
string A;
cin >> A;
for(int i=0; i<A.size(); i++){
if(A[i]=='S') S+=1;
if(A[i]=='N') N+=1;
if(A[i]=='E') E+=1;
if(A[i]=='W... | a.cc: In function 'int main()':
a.cc:46:2: error: expected '}' at end of input
46 | }
| ^
a.cc:26:12: note: to match this '{'
26 | }if(E==1){
| ^
a.cc:46:2: error: expected '}' at end of input
46 | }
| ^
a.cc:9:12: note: to match this '{'
9 | int main() {
| ... |
s865586854 | p04019 | C++ | #include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
type... | a.cc: In function 'int main()':
a.cc:33:14: error: expected unqualified-id before '[' token
33 | if(string[i] == 'N' && counter_n == 0){
| ^
a.cc:35:21: error: expected unqualified-id before '[' token
35 | } else if(string[i] == 'E' && counter_e == 0){
| ^
a.cc... |
s977139268 | p04019 | C++ | #include<iostream>
#include<string>
using namespace std;
int main{
string s;
cin >> s;
bool a[4] = {};
for(int i = 0; i < s.size();i++){
if(s[i] == 'E') a[0] = 1;
if(s[i] == 'W') a[1] = 1;
if(s[i] == 'N') a[2] = 1;
if(s[i] == 'S') a[3] = 1;
}
if(a[0] == a[1] && a[2] == a[3]) cout << "... | a.cc:6:5: error: cannot declare '::main' to be a global variable
6 | int main{
| ^~~~
a.cc:7:10: error: expected primary-expression before 's'
7 | string s;
| ^
a.cc:7:10: error: expected '}' before 's'
a.cc:6:9: note: to match this '{'
6 | int main{
| ^
a.cc:8:3: er... |
s071842726 | p04019 | C++ | #include<iostream>
#include<string>
int main{
string s;
cin >> s;
bool a[4] = {};
for(int i = 0; i < s.size();i++){
if(s[i] == 'E') a[0] = 1;
if(s[i] == 'W') a[1] = 1;
if(s[i] == 'N') a[2] = 1;
if(s[i] == 'S') a[3] = 1;
}
if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
else c... | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/includ... |
s366799517 | p04019 | C++ | #include<iostream>
#include<string>
int main{
string s;
cin >> s;
bool a[4] = {};
for(int i = 0; i < s.size;i++){
if(s[i] == 'E') a[0] = 1;
if(s[i] == 'W') a[1] = 1;
if(s[i] == 'N') a[2] = 1;
if(s[i] == 'S') a[3] = 1;
}
if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
else cou... | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/includ... |
s732657449 | p04019 | C++ | #include "bits/stdc++.h"
using namespace std;
int main() {
string S;
cin >> S;
int N, H, E, W;
N = 0;
H = 0;
E = 0;
W = 0;
for (int i = 0; i < S.size(); i++) {
if (S[i] == 'N') {
N++;
}
else if (S[i] == 'S') {
H++;
}
else ... | a.cc: In function 'int main()':
a.cc:28:79: error: expected ')' before '{' token
28 | if ((max(N, H) > 0 && min(N, H) == 0) || (max(E, W) > 0 && min(E, W) == 0) {
| ~ ^~
| ... |
s649270016 | p04019 | C++ | #include "bits/stdc++.h"
using namespace std;
int main() {
string S;
cin >> S;
int N, S, E, W;
N = 0;
S = 0;
E = 0;
W = 0;
for (int i = 0; i < S.size(); i++) {
if (S[i] == 'N') {
N++;
}
else if (S[i] == 'S') {
S++;
}
else ... | a.cc: In function 'int main()':
a.cc:8:12: error: conflicting declaration 'int S'
8 | int N, S, E, W;
| ^
a.cc:5:12: note: previous declaration as 'std::string S'
5 | string S;
| ^
a.cc:10:9: error: ambiguous overload for 'operator=' (operand types are 'std::string' {ak... |
s588401886 | p04019 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
const int N = 1005;
char s[N];
int main(){
scanf("%s",s);
int n = strlen(s);
int x = 0, y = 0;
for(int i=0;i<n;i++){
if(s[i]=='N') {
++y;
}
if(s[i]=='S'){
--y;
}
if(s[i]=='E'){... | a.cc: In function 'int main()':
a.cc:12:13: error: 'strlen' was not declared in this scope
12 | int n = strlen(s);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include <cstring>
... |
s527255109 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int w=0, s=0, n=0, e=0;
for (int i=0; i<s.size(); i++) {
if (s.at(i)=='W') w++;
else if (s.at(i)=='S') s++;
else if (s.at(i)=='N') n++;
else if (s.at(i)=='E') e++;
}
if (w==0||s==0||n==0||e==0) cout << "No" << e... | a.cc: In function 'int main()':
a.cc:7:12: error: conflicting declaration 'int s'
7 | int w=0, s=0, n=0, e=0;
| ^
a.cc:5:10: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:10:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
10 ... |
s549863177 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
bool n,w,s,e;
n=s=w=e=false;
for(int i=0;i<s.size();i++){
if(s[i]=='S') s=true;
if(s[i]=='W') w=true;
if(s[i]=='E') e=true;
if(s[i]=='N') n=true;
}
if(w==e&&s==n) cout<<"Yes";
else cout<<"No";
} | a.cc: In function 'int main()':
a.cc:6:12: error: conflicting declaration 'bool s'
6 | bool n,w,s,e;
| ^
a.cc:4:10: note: previous declaration as 'std::string s'
4 | string s;
| ^
a.cc:7:6: error: cannot convert 'std::__cxx11::basic_string<char>' to 'bool' in assignment
7... |
s926299900 | p04019 | C++ | #include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int news[4] = {0};
for ( int i = 0; i < s.size(); i++ ){
if ( s[i] == "N" ) news[0] = 1;
if ( s[i] == "E" ) news[1] = 1;
if ( s[i] == "W" ) news[2] = 1;
if ( s[i] == "S" ) news[3] = 1;
}
if( news[0] == news[2]... | a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if ( s[i] == "N" ) news[0] = 1;
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if ( s[i] == "E" ) news[1] = 1;
a.cc:13:15: error: ISO... |
s655375527 | p04019 | C++ | /****Author: Barish Namazov****/
#include <bits/stdc++.h>
using namespace std;
/***TEMPLATE***/
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define endl '\n'
const int max4 = 10004;
const int maxx = 100005;
const int max6 = 1000... | a.cc: In function 'int main()':
a.cc:67:16: error: conflicting declaration 'int s'
67 | int n = 0, s = 0, e = 0, w = 0;
| ^
a.cc:65:12: note: previous declaration as 'std::string s'
65 | string s;
| ^
a.cc:74:11: error: no match for 'operator+' (operand types are 'int... |
s417618580 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
getline(cin,sTR);
bool n, s, w, e;
for(int i = 0; i < str.length(); i++)
if(str[i] == 'E')
e = true;
else if(str[i] == 'W')
w = true;
else if(str[i] == 'N')
n = true;
... | a.cc: In function 'int main()':
a.cc:6:17: error: 'sTR' was not declared in this scope; did you mean 'str'?
6 | getline(cin,sTR);
| ^~~
| str
|
s476639343 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
cin >> str;
int x, y;
for(int i = 0; i < n; i++)
if(str[i] == 'E')
x++;
else if(str[i] == 'W')
x--;
else if(str[i] == 'N')
y++;
else if(str[i] == 'S')
y-... | a.cc: In function 'int main()':
a.cc:8:24: error: 'n' was not declared in this scope
8 | for(int i = 0; i < n; i++)
| ^
|
s290849495 | p04019 | C++ | :
s/\(.\)\(.*\)\1/\2\1/
t
s/[NS]\(.*\)[NS]/\1/
s/[EW][EW]//
/^$/cYes
cNo | a.cc:2:3: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:6: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:8: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
| ^
a.cc:2:12: error: stray '\' in program
2 | s/\(.\)\(.*\)\1/\2\1/
... |
s711167355 | p04019 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int a,u=0;l=0,d=0,r=0;
string s;
cin >> s;
for(int i=0;i<(int)s.size();i++){
if(s[i]=='N')u=1;
if(s[i]=='E')r=1;
if(s[i]=='W')l=1;
if(s[i]=='S')d=1;
}
if(u==d && r==l)cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:11: error: 'l' was not declared in this scope
5 | int a,u=0;l=0,d=0,r=0;
| ^
a.cc:5:15: error: 'd' was not declared in this scope
5 | int a,u=0;l=0,d=0,r=0;
| ^
a.cc:5:19: error: 'r' was not declared in this scope
5 | int a,u=0;l=0,d... |
s758733549 | p04019 | C++ | #include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <regex>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pl4 = pair<ll,ll>;
using vi = vector<int>;
using v... | a.cc: In function 'll salv(vll)':
a.cc:109:1: warning: no return statement in function returning non-void [-Wreturn-type]
109 | }
| ^
a.cc: In function 'int main()':
a.cc:175:34: error: expected primary-expression before ')' token
175 | Yn(!((c[0]^c[1])&&(c[2]^c[3]))));
| ... |
s218015582 | p04019 | C++ | #include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <regex>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pl4 = pair<ll,ll>;
using vi = vector<int>;
using v... | a.cc: In function 'll salv(vll)':
a.cc:109:1: warning: no return statement in function returning non-void [-Wreturn-type]
109 | }
| ^
a.cc: In function 'int main()':
a.cc:175:34: error: expected primary-expression before ')' token
175 | Yn(!((c[0]^c[1])&&(c[2]^c[3]))))
| ... |
s668171569 | p04019 | C++ | #include<bits/stdc++.h>
#define res register int
#define ll long long
#define N 100000
#define inf 0x3f3f3f3f
using namespace std;
int n,w,s,e;
char a[N];
inline bool check()
{
if(w&&e&&n&&s)return 1;
if(w&&e&&!n&&!s)return 1;
if(!w&&!e&&n&&s)return 1;
if(!w&&!e&&!n&&!s)return 1;
return 0;
}
int ... | a.cc: In function 'int main()':
a.cc:22:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
22 | for(res i=0;i<=strlen(a)-1;i++)
| ^
a.cc: At global scope:
a.cc:36:5: error: redefinition of 'int n'
36 | int n,w,s,e;
| ^
a.cc:7:5: note: 'int... |
s897644048 | p04019 | C++ | #include<bits/stdc++.h>
#define res register int
#define ll long long
#define N 100000
#define inf 0x3f3f3f3f
using namespace std;
int n,w,s,e;
char a[N];
inline bool check()
{
if(w&&e&&n&&s)return 1;
if(w&&e&&!n&&!s)return 1;
if(!w&&!e&&n&&s)return 1;
if(!w&&!e&&!n&&!s)return 1;
return 0;
}
int ... | a.cc: In function 'int main()':
a.cc:22:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
22 | for(res i=0;i<=strlen(a)-1;i++)
| ^
a.cc: At global scope:
a.cc:36:5: error: redefinition of 'int n'
36 | int n,w,s,e;
| ^
a.cc:7:5: note: 'int... |
s609074026 | p04019 | C++ | #include<bits/stdc++.h>//万能头文件
#define reg register//听说能提速,只能定义为局部变量
using namespace std;
string ss;
int w,n,e,s;
inline bool check()//判断是否符合条件
{
if(w==1&&e==1&&n==1&&s==1)return 1;
if(w==1&&e==1&&n==0&&s==0)return 1;
if(w==0&&e==0&&n==1&&s==1)return 1;
if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合
r... | a.cc: In function 'bool check()':
a.cc:11:40: error: '\U00008fd9\U00004e9b\U000090fd\U00007b26\U00005408' was not declared in this scope
11 | if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合
| ^~~~~~~~~~
a.cc: In function 'int nain()':
a.cc:17:17: warning: ISO C++17 does not ... |
s517368759 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
string ss;
bool w,n,e,s;
inline bool check()
{
if(w==e&&n==s)return 1;
return 0;
}
int main()
{
getline(cin,ss);
for(int i=0;i<ss.length();i++){
if(ss[i]=='W')w=1;
else if(ss[i]=='N')n=1;
else if(ss[i]=='E')e=1;
else ss[i]=='S')s=1;
i... | a.cc: In function 'int main()':
a.cc:17:28: error: expected ';' before ')' token
17 | else ss[i]=='S')s=1;
| ^
| ;
|
s396554344 | p04019 | C++ | #pragma GCC optimize(2)
#include<bits/stdc++.h>
#define reg register
using namespace std;
typedef long long ll;
int sleep(){
int j=0;
for(int i=1;i<=1000001;i++) j++;
return j;
}
string ss;
int w,n,e,s;
inline bool check()
{
if(w==1&&e==1&&n==1&&s==1)return 1;
if(w==1&&e==1&&n==0&&s==0)return 1;
if(w==0&... | a.cc: In function 'int nain()':
a.cc:24:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
24 | for(reg int i=0;i<ss.length();i++)
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): unde... |
s744231455 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
char s[1000000];
int a[500];
int main()
{
scanf("%s",s+1);
int len=strlen(s+1);
for(int i=1;i<=n;i++)
a[s[i]]++;
if(a['S']==a['N']&&a['E']==a['W'])
printf("Yes");
else
printf("No");
} | a.cc: In function 'int main()':
a.cc:9:24: error: 'n' was not declared in this scope
9 | for(int i=1;i<=n;i++)
| ^
|
s223284028 | p04019 | C++ | #include<bits/stdc++.h>//万能头文件
#define reg register//听说能提速,只能定义为局部变量
using namespace std;
string ss;
int w,n,e,s;
inline bool check()//判断是否符合条件
{
if(w==1&&e==1&&n==1&&s==1)return 1;
if(w==1&&e==1&&n==0&&s==0)return 1;
if(w==0&&e==0&&n==1&&s==1)return 1;
if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合
r... | a.cc: In function 'bool check()':
a.cc:11:40: error: '\U00008fd9\U00004e9b\U000090fd\U00007b26\U00005408' was not declared in this scope
11 | if(w==0&&e==0&&n==0&&s==0)return 1;这些都符合
| ^~~~~~~~~~
a.cc: In function 'int nain()':
a.cc:17:17: warning: ISO C++17 does not ... |
s721654857 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int n, s, w, e;
int main(){
cin>>s;
for(int i=0; i<s.size(); i++){
if(s[i] == 'N'){ n++; }
if(s[i] == 'W'){ w++; }
if(s[i] == 'E'){ e++; }
if(s[i] == 'S'){ s++; }
}
if(s > 0 && n == 0){ cout<<"No"; return 0; }
if(n > 0 && s == 0){ cout<<"No"; r... | a.cc:5:8: error: conflicting declaration 'int s'
5 | int n, s, w, e;
| ^
a.cc:4:8: note: previous declaration as 'std::string s'
4 | string s;
| ^
a.cc: In function 'int main()':
a.cc:15:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
15 | if(s[i] == 'S'... |
s797740548 | p04019 | C++ | #include<iostream>
using namespace std;
string s;
ll n, s, w, e;
int main(){
cin>>s;
for(int i=0; i<s.size(); i++){
if(s[i] == 'N'){ n++; }
if(s[i] == 'W'){ w++; }
if(s[i] == 'E'){ e++; }
if(s[i] == 'S'){ s++; }
}
if(s > 0 && n == 0){ cout<<"No"; return 0; }
if(n > 0 && s == 0){ cout<<"No"; return ... | a.cc:5:1: error: 'll' does not name a type
5 | ll n, s, w, e;
| ^~
a.cc: In function 'int main()':
a.cc:12:22: error: 'n' was not declared in this scope
12 | if(s[i] == 'N'){ n++; }
| ^
a.cc:13:22: error: 'w' was not declared in this scope
13 | if(s[i] == 'W'){ w++; }
... |
s698070363 | p04019 | C++ | #include <iostream>
using namespace std;
int main()
{
string S;
cin >> S;
int n = 1, w = 1, s = 1, e = 1;
for(int i = 0; i < N; i++){
if(S.at(i) == 'N'){
n++;
}
if(S.at(i) == 'W'){
w++;
}
if(S.at(i) == 'S'){
s++;
}
if(S.at(i) == 'E'){
... | a.cc: In function 'int main()':
a.cc:10:28: error: 'N' was not declared in this scope
10 | for(int i = 0; i < N; i++){
| ^
|
s386908859 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int x, y, z, t;
x = y = 0;
cin >> s;
for(int i = 0; i < s.length(); i++){
if(s[i] == 'N') x++;
else if(s[i] == 'W') t++;
else if(s[i] == 'S') z++;
else y++;
}
if((x && y || (!x && !y)) && ... | a.cc: In function 'int main()':
a.cc:16:59: error: expected ';' before 'cout'
16 | if((x && y || (!x && !y)) && (!z && !t || (z && t) ) cout << "Yes";
| ^~~~~
| ;
a.cc:17:5: error: ex... |
s175680550 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
int a=S.size();
int n,w,s,e;
n=0; w=0; s=0; e=0;
for(int i=0;i<a;i++){
if(S.at(i)=='N')n++;
if(S.at(i)=='W')w++;
if(S.at(i)=='S')s++;
if(S.at(i)=='E')e++;
}
if(n!=0 && s==0 || n==0 && s!=0){
cout << "No" << endl;}
... | a.cc: In function 'int main()':
a.cc:17:16: error: lvalue required as left operand of assignment
17 | else if(w!=0 && e=0 || w==0 && e!=0){
| ~~~~~^~~~
|
s346578806 | p04019 | C++ | #include <bits/stdc++.h>
using namespace sstd;
int main(){
bool C[4]={0,0,0,0};
string S;
cin >> S;
for(int i=0;i<S.length();i++){
if(S[i]=='N'){C[0]=true;}
if(S[i]=='S'){C[1]=true;}
if(S[i]=='E'){C[2]=true;}
if(S[i]=='W'){C[3]=true;}
}
if(C[0]==C[1] && C[2]==C[3]){
cout << "Yes" << end... | a.cc:2:17: error: 'sstd' is not a namespace-name
2 | using namespace sstd;
| ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
6 | string S;
| ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/stri... |
s711501665 | p04019 | C++ | #include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
w... | a.cc: In function 'int main()':
a.cc:38:1: error: expected primary-expression before '/' token
38 | /
| ^
a.cc:39:17: error: expected primary-expression before 'if'
39 | if(desH(auxH,antH) && desV(auxV,antV)) printf("Yes\n");
| ^~
a.cc:40:17: error: 'else' without a pre... |
s370125006 | p04019 | C | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
int MCG(int a, int b)
{
if(a%b ==0)
return b;
else
return MCG(b,a%b);
}
int main()
{
map<char,int>mapa;
mapa['N']=0;
mapa['S']=0;
mapa['W']=0;
mapa['E']=0;
int i,va... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s593150803 | p04019 | C++ | #include <stdin.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(s... | a.cc:1:10: fatal error: stdin.h: No such file or directory
1 | #include <stdin.h>
| ^~~~~~~~~
compilation terminated.
|
s861829071 | p04019 | C++ | #include <stdint.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(... | a.cc: In function 'int main()':
a.cc:15:15: error: 'scanf' was not declared in this scope
15 | while(scanf("%s",ruta)!=EOF){
| ^~~~~
a.cc:15:33: error: 'EOF' was not declared in this scope
15 | while(scanf("%s",ruta)!=EOF){
| ^~~
a.cc:2:1: ... |
s820664613 | p04019 | C | #include <stdint.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(... | main.c:3:1: error: unknown type name 'bool'
3 | bool desH(char c, char d){
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdint.h>
+++ |+#include <stdbool.h>
2 |
main.c: In function 'desH':
main.c:4:84: er... |
s198122326 | p04019 | C | #include <stdin.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
while(s... | main.c:1:10: fatal error: stdin.h: No such file or directory
1 | #include <stdin.h>
| ^~~~~~~~~
compilation terminated.
|
s534726259 | p04019 | C | #include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
w... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s434823653 | p04019 | C++ | #include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
w... | a.cc: In function 'int main()':
a.cc:38:1: error: expected primary-expression before '/' token
38 | /
| ^
a.cc:39:17: error: expected primary-expression before 'if'
39 | if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
| ^~
a.cc:40:17: error: 'else' without a pre... |
s637389206 | p04019 | C++ | #include <bits/stdc++.h>
bool desH(char c, char d){
if ((c=='N' && d=='S') || (c=='S' && d=='N') || (c=='o' && d=='o')) return true;
return false;
}
bool desV(char c, char d){
if ((c=='E' && d=='W') || (c=='W' && d=='E') || (c=='o' && d=='o') ) return true;
return false;
}
int main(){
int i;
char ruta[2000];
w... | a.cc: In function 'int main()':
a.cc:38:1: error: expected primary-expression before '/' token
38 | /
| ^
a.cc:39:17: error: expected primary-expression before 'if'
39 | if(desH(auxH,antH) && desV(auxV,antV)) printf("YES\n");
| ^~
a.cc:40:17: error: 'else' without a pre... |
s270431137 | p04019 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;
int main() {
register int i; int N = 0, S = 0, W = 0, E = 0;
char str[1010];
gets(str);
for( i = 0; i < (int) strlen(str); ++i )
N |= str[i] == 'N', S |= str[i] == 'S', W |= str[i] == 'W', E |= str... | a.cc: In function 'int main()':
a.cc:9:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
9 | register int i; int N = 0, S = 0, W = 0, E = 0;
| ^
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(s... |
s328042386 | p04019 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <string>
#include <cmath>
using namespace std;
int main(void){
string s;
cin >> s;
int n, w, s, e;
for(int i=0;i<s.length();i++){
if(s[i]=='N'){
n++;
}
if(s[i]=='W'){
w++;
}
if(s[i]=='S'){
s++;
}
if(s[i]==... | a.cc: In function 'int main()':
a.cc:12:19: error: conflicting declaration 'int s'
12 | int n, w, s, e;
| ^
a.cc:10:16: note: previous declaration as 'std::string s'
10 | string s;
| ^
a.cc:21:26: error: no 'operator++(int)' declared for postfix '++' [-... |
s753899835 | p04019 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
#include <numeric>
using namespace std;
int main(){
string S;
cin>>S;
int n=0,w=0,s=0,e=0;
for (int i = 0; i < S.size(); i++){
if (S[i] == 'N') {n++;}
if (S[i] == 'W') {w++;}
if (S[i] == 'S') {s++;}
if (S[i] == 'E') {e... | a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
28 | }
| ^
a.cc:9:11: note: to match this '{'
9 | int main(){
| ^
|
s438877541 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
bool n, e, w, s;
int main()
{
string S; cin >> S;
for (int i = 0; i < s.size(); i++) {
if (S[i] == 'N') n = true;
if (S[i] == 'S') e = true;
if (S[i] == 'E') w = true;
if (S[i] == 'W') s = true;
}
cout << (n ^ s || e ^ w ?... | a.cc: In function 'int main()':
a.cc:10:27: error: request for member 'size' in 's', which is of non-class type 'bool'
10 | for (int i = 0; i < s.size(); i++) {
| ^~~~
|
s799551516 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
bool n, e, w, s;
int main()
{
string s; cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'N') n = true;
if (s[i] == 'S') e = true;
if (s[i] == 'E') w = true;
if (s[i] == 'W') s = true;
}
cout << (n ^ s || e ^ w ?... | a.cc: In function 'int main()':
a.cc:17:16: error: no match for 'operator^' (operand types are 'bool' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
17 | cout << (n ^ s || e ^ w ? "No" : "Yes") << endl;
| ~ ^ ~
| | |
| | std::string {aka s... |
s658389950 | p04019 | C++ | //#define NDEBUG
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#... | a.cc:72:18: error: expected nested-name-specifier before '.' token
72 | template<typename..R>void println(R..r) { print(r...);fputc('\n', stdout); }
| ^
a.cc:72:18: error: expected '>' before '.' token
a.cc:72:27: error: variable or field 'println' declared void
72 | template<typename..R>vo... |
s598351285 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int a = 0, b = 0, N;
char sir[1009];
int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);
gets (sir + 1), N = strlen (sir + 1);
for (int i=1; i<=N; i++)
{
char c = sir[i];
if (c == 'N') a |= 1;
else
if (c == 'S') a |= 2;
i... | a.cc: In function 'int main()':
a.cc:13:1: error: 'gets' was not declared in this scope; did you mean 'getw'?
13 | gets (sir + 1), N = strlen (sir + 1);
| ^~~~
| getw
|
s032508031 | p04019 | C++ | lkjklasjlk | a.cc:1:1: error: 'lkjklasjlk' does not name a type
1 | lkjklasjlk
| ^~~~~~~~~~
|
s347299091 | p04019 | C | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int n;
string s;
bool dp[1010][3][3];
int main()
{
cin >> s;
n = s.size();
for(int i = 0;i < 1010;i++)
{
for(int j = 0;j < 3;j++)
{
for(int k = 0;k < 3;k++)
{
dp[i][j][k] = false;
}
}
}
dp[0][1][1] = true;
for(i... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s875689229 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1000000007;
const int INF=1e7;
const LL LINF=1e18;
int main(){
string s;
cin >> s;
int n=-1,w=-1,s=-1,e=-1;
for(int i=0;i<s.lenght();i++){
if(s[i]=='W') w=1;
if(s[i]=='N') n=1;
... | a.cc: In function 'int main()':
a.cc:12:19: error: conflicting declaration 'int s'
12 | int n=-1,w=-1,s=-1,e=-1;
| ^
a.cc:10:12: note: previous declaration as 'std::string s'
10 | string s;
| ^
a.cc:13:21: error: 'std::string' {aka 'class std::__cxx11::basic_string... |
s234263462 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x,kari=0;
bool
int ans=0;
int N=10,S=10, E=10, W=10;
char direction[1005];
cin>>direction;
kari=strlen(direction);
for(int i=0;i<kari;i++){
if(direction[i]=='N')N=0;
if(direction[i]=='S')S=0;
... | a.cc: In function 'int main()':
a.cc:5:5: error: two or more data types in declaration of 'ans'
5 | bool
| ^~~~
|
s308049059 | p04019 | C++ | v | a.cc:1:1: error: '\U0000ff56' does not name a type
1 | v
| ^~
|
s525151612 | p04019 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#defi... | a.cc: In function 'int main()':
a.cc:30:19: error: conflicting declaration 'int S'
30 | int N=0,W=0,E=0,S=0;
| ^
a.cc:28:10: note: previous declaration as 'std::string S'
28 | string S;
| ^
a.cc:39:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
... |
s161171563 | p04019 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#defi... | a.cc: In function 'int main()':
a.cc:31:15: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
31 | if(count(S,S+L,'N')==count(S,S+L,'S')&&count(S,S+L,'W')==count(S,S+L,'E')){
| ~^~
| | |
| | ... |
s158517825 | p04019 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string a;
cin >> a;
bool n = find(a.begin(), a.end(), 'N') != a.end();
bool e = find(a.begin(), a.end(), 'E') != a.end();
bool w = find(a.begin(), a.end(), 'W') != a.end();
bool s = find(a.begin(), a.end(), 'S') != a.end();
cout << (... | a.cc: In function 'int main()':
a.cc:8:16: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char)'
8 | bool n = find(a.begin(), a.end(), 'N') != a.end();
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr... |
s583174024 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
char s[1005];
int main() {
int l, n = 0, so = 0, e = 0, w = 0;
gets(s);
l = strlen(s);
for (int i = 0; i < l; i++) {
if (s[i] == 'N')
n++;
if (s[i] == 'S')
so++;
if (s[i] == 'W')
w++;
if (... | a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s075741429 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
char s[1005];
int main() {
int l, n = 0, so = 0, e = 0, w = 0;
gets(s);
l = strlen(s);
for (int i = 0; i <= l; i++) {
if (s[i] == 'N')
n++;
if (s[i] == 'S')
so++;
if (s[i] == 'W')
w++;
if ... | a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s089524732 | p04019 | C++ | S=raw_input()
print "No" if ("S" in S)+("N" in S)==1 or ("W" in S)+("E" in S)==1 else "Yes" | a.cc:1:1: error: 'S' does not name a type
1 | S=raw_input()
| ^
|
s904267826 | p04019 | C++ | s = raw_input()
i=lambda c:c in s
print "No"*((i('N')^i('S'))or(i('W')^i('E')))or"Yes" | a.cc:1:1: error: 's' does not name a type
1 | s = raw_input()
| ^
|
s066426568 | p04019 | C++ | // ConsoleApplication1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
#include <memory>
int main()
{
bool n = false, s = false, w = false, e = false;
while(int c = std::cin.get())
{
if (c == EOF)break;
switch (c)
{
case 'N':
n = true;
break;
case 'S':
s = true;... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s831260586 | p04019 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <bitset>
#include <cmath>
using namespace std;
const int kMax = 2200;
const int kMaxPr = 500;
bitset < kMax > used;
void Init(vector < int > &prime) {
int index = 0;
for (int pr = 2; pr < kMax; pr ++) {
if (used[pr]) {
continue;
}
... | a.cc: In function 'int main(int, const char**)':
a.cc:118:2: error: expected '}' at end of input
118 | }
| ^
a.cc:31:40: note: to match this '{'
31 | int main(int argc, char const *argv[]) {
| ^
|
s346783452 | p04019 | C | #include<stdio.h>
int main(void)
{
int i;
char S[1001];
scanf("%s",S);
int N = sizeof(S);
for (i = 0; i < N; i++) {
if (S[i] == 'N') n += 1;
if (S[i] == 'S') n -= 1;
if (S[i] == 'E') e += 1;
if (S[i] == 'W') e -= 1;
}
if (n == 0 && e == 0) {
printf("Yes\n");
} e... | main.c: In function 'main':
main.c:10:24: error: 'n' undeclared (first use in this function)
10 | if (S[i] == 'N') n += 1;
| ^
main.c:10:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:24: error: 'e' undeclared (first use in this... |
s908204603 | p04019 | C | #include<stdio.h>
int main(void)
{
char S[1001];
scanf("%s",S);
int N = sizeof(S);
for (i = 0; i < N; i++) {
if (S[i] == 'N') n += 1;
if (S[i] == 'S') n -= 1;
if (S[i] == 'E') e += 1;
if (S[i] == 'W') e -= 1;
}
if (n == 0 && e == 0) {
printf("Yes\n");
} else {
... | main.c: In function 'main':
main.c:8:11: error: 'i' undeclared (first use in this function)
8 | for (i = 0; i < N; i++) {
| ^
main.c:8:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:24: error: 'n' undeclared (first use in this function)
9... |
s626059658 | p04019 | C++ | include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define inf 0x3fffffff
int main()
{
char a[1500];
int i, t, n,len,flag1,flag2;
while (scanf("%s", a) != EOF)
{
flag1=flag2=0;
len = strlen(a);
for (i = 0; i < len; i++)
{
if (a[i] == 'N... | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from /usr/include/c++/14/math.h:36,
from a.cc:3:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null... |
s172353554 | p04019 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;
int main()
{
int i,n,a,b,c,d;
char s[1000];
gets(s);
a=b=c=d=0;
n=strlen(s);
for(i=0;i<n;i++)
{
if(s[i]=='N') a++;
if(s[i]=='S') b++;
if(s[i]=='W') c++;
if(s[i]==... | a.cc: In function 'int main()':
a.cc:12:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | gets(s);
| ^~~~
| getw
|
s179304650 | p04019 | C++ | #include <map>
#include <queue>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f
int main()
{
char s[2000];
int n, x, y, a, b, i, sum, flag;
std::ios::sync_with_stdio(false);
while (gets(s)!='\0... | a.cc: In function 'int main()':
a.cc:23:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
23 | while (gets(s)!='\0')
| ^~~~
| getw
|
s519892358 | p04019 | C++ | #include <map>
#include <queue>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f
int main()
{
char s[2000];
int n, x, y, a, b, i, sum, flag;
std::ios::sync_with_stdio(false);
while (gets(s))
{
... | a.cc: In function 'int main()':
a.cc:23:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
23 | while (gets(s))
| ^~~~
| getw
|
s752016099 | p04019 | C |
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
int flag1 = 0;
int flag2 = 0;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == 'N'&&flag1==0)
flag1 = 1;
if (s[i] == 'S'&&flag1 == 0)
flag1 = -1;
if (s[i] == 'E'&&flag2 ... | main.c:2:10: fatal error: cstdio: No such file or directory
2 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s094982376 | p04019 | C++ | #include<stdio.h>
#include<string.h>
//using namespace std;
int main()
{
char str[1000];
while (gets(str))
{
int x = 0, y = 0;
for (int i = 0; str[i] != '\0'; i++)
{
if (str[i] == 'W')
x++;
else if (str[i] == 'E')
x--;
else if (str[i] == 'N')
y++;
else if (str[i] == 'S')
y--;
}
... | a.cc: In function 'int main()':
a.cc:7:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | while (gets(str))
| ^~~~
| getw
|
s242935697 | p04019 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<stack>
#include<queue>
using namespace std;
int main()
{
char str[1000];
while (gets(str))
{
int x = 0, y = 0;
for (int i = 0; str[i] != '\0'; i++)
{
if (str[i] == 'W')
x++;
else if (str[i] == 'E')
... | a.cc: In function 'int main()':
a.cc:12:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | while (gets(str))
| ^~~~
| getw
|
s985023097 | p04019 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;
int main()
{
int i,n,a,b,c,d;
char s[1000];
while(gets(s))
{
a=b=c=d=0;
n=strlen(s);
for(i=0;i<n;i++)
{
if(s[i]=='N') a++;
if(s[i]=='S') b++;
if(s[i]=='W') c++;
... | a.cc: In function 'int main()':
a.cc:12:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | while(gets(s))
| ^~~~
| getw
|
s503249209 | p04019 | C++ | NSNNSNSN
| a.cc:1:1: error: 'NSNNSNSN' does not name a type
1 | NSNNSNSN
| ^~~~~~~~
|
s007209358 | p04019 | C++ | #include <bits/stdc++.h>
//#include <boost/functional/hash.hpp>
//example: unordered_set< pair<int,int>,boost::hash< std::pair<int, int> > > used;
//priority_queue< pair<int,pair<int,int> >, vector<pair<int,pair<int,int>>>, greater<pair<int,pair<int,int> > > > pqueue; //cost, vertex(行き先)
using namespace std;
#defin... | a.cc: In function 'int main()':
a.cc:44:21: error: request for member 'length' in 's', which is of non-class type 'bool'
44 | for(int i=0;i<s.length();i++){
| ^~~~~~
a.cc:45:17: error: invalid types 'bool[int]' for array subscript
45 | switch(s[i]){
| ^
|
s797755402 | p04019 | C++ | #include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#incl... | a.cc: In function 'int main()':
a.cc:51:31: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
51 | cout << "Yes" < endl;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
... |
s375163923 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define LL long long
#define ULL unsigned long long
#define PB push_back
#define MP make_pair
#define PII pair<int,int>
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define IN freopen("in", "r", stdin);
#define OUT freopen("out", "w", st... | a.cc: In function 'int main()':
a.cc:30:14: error: 'couta' was not declared in this scope
30 | else couta<<"Yes"<<endl;
| ^~~~~
|
s036402786 | p04019 | C++ | #include <cstdio>
#include <cstring>
char S[1024];
int D[256];
int main() {
scanf("%s", S);
memset(D, 0, sizeof D);
for (int i = 0; S[i]; i++)
D[S[i]] = 1;
if (D['W'] != D['E'] || D['N'] != D['S'])
printf("No\n");
else
printf("Yes\n");
return 0;
}
[z | a.cc:17:1: error: expected unqualified-id before '[' token
17 | [z
| ^
|
s225052076 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
const int INF = 1e9;
#define int ll;
int n;
int a[MAX_N+10];
signed main(){
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
int ans=0;
for(int i=1;i<=n;i++){
ans+=a[i]/2;
a[i]%=2;
if(a[i]==1 && a[i+1]!=0 && i!=n){
a[i+1]--;
... | a.cc:7:13: error: 'll' does not name a type
7 | #define int ll;
| ^~
a.cc:9:1: note: in expansion of macro 'int'
9 | int n;
| ^~~
a.cc:9:5: error: 'n' does not name a type
9 | int n;
| ^
a.cc:7:13: error: 'll' does not name a type
7 | #define int ll;
| ... |
s717245418 | p04019 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
#include<cmath>
#include <vector>
using namespace std;
int main(void)
{
int X = 0, Y = 0,a =0,b=0;
int a, b, c, d, e;
int i;
string n;
cin >> n;
a = n.size();
for (i = 0; i < a; i++)
{
if (n[i] == 'N')
{
Y = Y + 1;
}
else if (n[i] == 'S')
{... | a.cc: In function 'int main()':
a.cc:12:13: error: redeclaration of 'int a'
12 | int a, b, c, d, e;
| ^
a.cc:11:26: note: 'int a' previously declared here
11 | int X = 0, Y = 0,a =0,b=0;
| ^
a.cc:12:16: error: redeclaration of 'int b'
12 | ... |
s905513002 | p04019 | C++ | #include "stdio.h"
#include <string.h>
int main(void){
// int num;
char dir[1000];
int n_fla=0,e_flag=0,w_flag=0,s_flag=0,i,result=0;
scanf("%s",dir);
for(i=0;i<strlen(dir);i++){
if(dir[i] == 'N'){
n_flag = 1;
}else if(dir[i] == 'E'){
e_flag = 2;
}els... | a.cc: In function 'int main()':
a.cc:11:13: error: 'n_flag' was not declared in this scope; did you mean 's_flag'?
11 | n_flag = 1;
| ^~~~~~
| s_flag
a.cc:20:14: error: 'n_flag' was not declared in this scope; did you mean 's_flag'?
20 | result = n_flag + e_flag... |
s215589018 | p04019 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S') {
ans[0]--;
}
else if(a[i]=='W'){
ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
}
if (ans[0] == 0 && ans[1] == 0) {
co... | a.cc: In function 'int main()':
a.cc:15:9: error: 'a' was not declared in this scope
15 | else if(a[i]=='W'){
| ^
|
s014795912 | p04019 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S'){
ans[0]--;
}
else if (a[i] == 'W'){
ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
}
if (ans[0] == 0 && ans[1] == 0) {
... | a.cc: In function 'int main()':
a.cc:15:10: error: 'a' was not declared in this scope
15 | else if (a[i] == 'W'){
| ^
|
s836689073 | p04019 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S') {
ans[0]--;
}
else if (a[i] == 'W') {ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
}
if (ans[0] == 0 && ans[1] == 0) {... | a.cc: In function 'int main()':
a.cc:15:10: error: 'a' was not declared in this scope
15 | else if (a[i] == 'W') {ans[1]++;
| ^
|
s054007925 | p04019 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int ans[2] = {0,0};
cin >> s;
for (int i = 0; s[i] != '\0'; i++) {
if (s[i] == 'N') {
ans[0]++;
}
else if (s[i] == 'S') {
ans[0]--;
}
else if (a[i] == 'W') {
ans[1]++;
}
else if (a[i] == 'E') {
ans[1]--;
}
... | a.cc: In function 'int main()':
a.cc:17:26: error: 'a' was not declared in this scope
17 | else if (a[i] == 'W') {
| ^
|
s936797236 | p04019 | Java |
import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char[] s = sc.next().toCharArray();
String[] tmp = new String[s.length];
// System.out.println(s);
boolean Ncount = false;
boolean Wcount = false;
boolean Scount = false;
boolean ... | Main.java:4: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s779151483 | p04019 | Java | import java.io.*;
import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String path = r.readLine();
int p = 0;
for (int j = 0; j < path.length(); j++)
p |= (path.char... | Main.java:14: error: incompatible types: unexpected return value
return p == 3 || p == 12 || p == 15 ? "Yes" : "No";
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.