submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s802921722
p04019
C++
#include<bits/stdc++.h> using namespace std; int b,l; string s; int main(){ cin>>s; l=s.length(); for(register int i=0;i<l;++i){ if(s[i]=='S'){ b=0; for(register int i=0;i<l;++i)if(a[i]=='N'){ b=1; break; } if(!b){ ...
a.cc: In function 'int main()': a.cc:8:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 8 | for(register int i=0;i<l;++i){ | ^ a.cc:11:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 11 | for(reg...
s121718631
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S;cin>>S; int N=count(S.begin(),S.end(),'N'); int S=count(S.begin(),S.end(),'S'); int E=count(S.begin(),S.end(),'E'); int W=count(S.begin(),S.end(),'W'); if((N*S==0&&N+S>0)||(E*W==0&&E+W>0))cout<<"No"<<endl; else cout<<"Yes"<<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: conflicting declaration 'int S' 6 | int S=count(S.begin(),S.end(),'S'); | ^ a.cc:4:10: note: previous declaration as 'std::string S' 4 | string S;cin>>S; | ^ a.cc:9:8: error: no match for 'operator*' (operand types are 'int' and 'st...
s158244758
p04019
C++
#include<bits/stdc++.h> #include<cmath> #pragma GCC optimize("Ofast") using namespace std; #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() typedef long long ll; const ll MOD = 1000000007; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n...
a.cc: In function 'int main()': a.cc:78:11: error: 'n' was not declared in this scope 78 | rep(i,n){ | ^ a.cc:9:39: note: in definition of macro 'rep' 9 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) | ^
s740576335
p04019
C++
#include<bits/stdc++.h> #include<cmath> #pragma GCC optimize("Ofast") using namespace std; #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() typedef long long ll; const ll MOD = 1000000007; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n...
a.cc: In function 'int main()': a.cc:78:11: error: 'n' was not declared in this scope 78 | rep(i,n){ | ^ a.cc:9:39: note: in definition of macro 'rep' 9 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) | ^ a.cc:79:44: error: 'N' was not d...
s643678803
p04019
C++
#include<iostream> #include<cstdio> using namespace std; string str; int w,n,e,s; 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; return 0; } int nain() { getli...
/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
s788485160
p04019
C++
#include<bits/stdc++.h> using namespace std; string s; 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; return 0; } int main() { c...
a.cc:4:11: error: conflicting declaration 'int s' 4 | int w,n,e,s; | ^ a.cc:3:8: note: previous declaration as 'std::string s' 3 | string s; | ^ a.cc: In function 'bool check()': a.cc:7:27: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_s...
s915797889
p04019
C++
#include <bits/stdc++.h> using namespace std; int main () { string T; cin >> T; iny N = 0, E = 0, S = 0, W = 0; for(int i = 0; i < T.size() ;i++){ if(T.at(i) == 'N')N++; else if(T.at(i) == 'E')E++; else if(T.at(i) == 'S')S++; else if(T.at(i) == 'W')W++; } int flag = 1; if(N == 0 && S != 0)...
a.cc: In function 'int main()': a.cc:6:3: error: 'iny' was not declared in this scope; did you mean 'int'? 6 | iny N = 0, E = 0, S = 0, W = 0; | ^~~ | int a.cc:8:23: error: 'N' was not declared in this scope 8 | if(T.at(i) == 'N')N++; | ^ a.cc:9:28: error: 'E' w...
s589634150
p04019
C++
#include<iostream> #include<vector> #include<string> #include<math.h> using namespace std; int main() { int n=0,w=0,s=0,e=0; int ns = 0, we = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == 'N')n = 1; else if (s[i] == 'S')y = 1; else if (s[i] == 'W')z = 1; else if (s[i]...
a.cc: In function 'int main()': a.cc:10:16: error: conflicting declaration 'std::string s' 10 | string s; | ^ a.cc:8:21: note: previous declaration as 'int s' 8 | int n=0,w=0,s=0,e=0; | ^ a.cc:13:31: error: request for member 'length' in 's', which i...
s799340660
p04019
C
#include<stdio.h> #include<string.h> int main() { char in; int N,S,W,E; scanf("%c",&in); N = strchr(in, (int)'N'); S = strchr(in, (int)'S'); W = strchr(in, (int)'W'); E = strchr(in, (int)'E'); if (N != (null) && S != (null)){ printf("Yes\n"); } else if (W != (null) && E != (null)){ printf("Yes...
main.c: In function 'main': main.c:7:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-Wint-conversion] 7 | N = strchr(in, (int)'N'); | ^~ | | | char In file included from main.c:2: /usr/include/string.h:246:34: note: exp...
s125570878
p04019
C
#include<stdio.h> #include<string.h> int main() { char S; int N,S,W,E; scanf("%c",&S); N = strchr(S, (int)'N'); S = strchr(S, (int)'S'); W = strchr(S, (int)'W'); E = strchr(S, (int)'E'); if (N != (null) && S != (null)){ printf("Yes\n"); } else if (W != (null) && E != (null)){ printf("Yes\n"); ...
main.c: In function 'main': main.c:5:9: error: conflicting types for 'S'; have 'int' 5 | int N,S,W,E; | ^ main.c:4:8: note: previous declaration of 'S' with type 'char' 4 | char S; | ^ main.c:7:14: error: passing argument 1 of 'strchr' makes pointer from integer without a cast [-W...
s216291617
p04019
Java
import java.util*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String S = br.readLine(); br.close(); int N = S.length(); boolean[]...
Main.java:1: error: ';' expected import java.util*; ^ 1 error
s466670917
p04019
C++
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(),(a).end() #define rALL(a) (a).rbegin(),(a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; int main() { string T; cin >> T; bool N = false, W = false, S = false, E = false; for (int i = 0; i < S.size(); i+...
a.cc: In function 'int main()': a.cc:13:27: error: request for member 'size' in 'S', which is of non-class type 'bool' 13 | for (int i = 0; i < S.size(); i++){ | ^~~~
s517096021
p04019
C++
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(),(a).end() #define rALL(a) (a).rbegin(),(a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; int main() { string T; cin >> T; bool N = false, W = false, S = false, E = false; for (int i = 0; i < S.size(); i+...
a.cc: In function 'int main()': a.cc:13:27: error: request for member 'size' in 'S', which is of non-class type 'bool' 13 | for (int i = 0; i < S.size(); i++){ | ^~~~ a.cc:14:15: error: request for member 'at' in 'S', which is of non-class type 'bool' 14 | if (S.at(i) =...
s034239065
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,k; for(int i=0;i<s.length();i++){ if(s.charAt(i)=='W') w++; if(s.charAt(i)=='E') e++; if(s.charA...
Main.java:9: error: variable w might not have been initialized if(s.charAt(i)=='W') w++; ^ Main.java:10: error: variable e might not have been initialized if(s.charAt(i)=='E') e++; ^ Main.java:11: error: variable k mig...
s316030395
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)=='W') w++; if(s.charAt(i)=='E') e++; if(s.charAt(i)=='S') s++; if...
Main.java:7: error: variable s is already defined in method main(String[]) int w,e,n,s; ^ Main.java:8: error: int cannot be dereferenced for(int i=0;i<s.length();i++){ ^ Main.java:9: error: int cannot be dereferenced if(s.charAt(i)=='W') w++; ^ M...
s211698836
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)=='W') w++; if(s.charAt(i)=='E') e++; if(s.charAt(i)=='S') s++; if...
Main.java:21: error: illegal character: '\u201c' else System.out.println(?Yes?); ^ Main.java:21: error: illegal character: '\u201d' else System.out.println(?Yes?); ^ Main.java:21: error: not a statement else System.out.println(?Yes?); ^ 3 erro...
s576648921
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)==`W`) w++; if(s.charAt(i)==`E`) e++; if(s.charAt(i)==`S`) s++; if(s.charAt(i)==`N`...
Main.java:9: error: illegal character: '`' if(s.charAt(i)==`W`) w++; ^ Main.java:9: error: illegal character: '`' if(s.charAt(i)==`W`) w++; ^ Main.java:9: error: not a statement if(s.charAt(i)==`W`) w++; ...
s639978032
p04019
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String s=sc.next(); int w,e,n,s; for(int i=0;i<s.length();i++){ if(s.charAt(i)==‘W’) w++; if(s.charAt(i)==‘E’) e++; if(s.charAt(i)==‘S’) s++; if(s.charAt(i)==‘’N...
Main.java:9: error: illegal character: '\u2018' if(s.charAt(i)==?W?) w++; ^ Main.java:9: error: illegal character: '\u2019' if(s.charAt(i)==?W?) w++; ^ Main.java:9: error: not a statement if(s.charAt(i)==?W?) w++;...
s567092564
p04019
C++
#include <iostream> using namespace std; int main(void) { bool ok = true; string s; cin >> s; vector<int> news(4, 0); for (int i = 0; i < s.size(); ++i) { if (s[i] == 'N') ++news[0]; else if (s[i] == 'E') ++news[1]; else if (s[i] == 'W') ++news[2]; else if (s[i] == 'S') ++news[3]; } if (news[0] > 0 ...
a.cc: In function 'int main()': a.cc:7:9: error: 'vector' was not declared in this scope 7 | vector<int> news(4, 0); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vect...
s297537451
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; int n,w,s,e; n=0; w=0; s=0; e=0; for(int i=0;i<s.size();i++){ if(s.at(i)=='N'){ n++; }else if(s.at(i)=='W'){ w++; }else if(s.at(i)=='S'){ s++; }else if(s.at(i)=='E'){ e++; } } if(((n==0&&s=...
a.cc: In function 'int main()': a.cc:6:11: error: conflicting declaration 'int s' 6 | int n,w,s,e; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:9:5: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__c...
s803233848
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string st; cin >> st; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n*e*w*s > 0){ out = "Yes"; ...
a.cc: In function 'int main()': a.cc:9:16: error: 'begin' was not declared in this scope 9 | for(char c : s){ | ^ a.cc:9:16: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/valarray:1...
s636033384
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n*e*w*s > 0){ out = "Yes"; ...
a.cc: In function 'int main()': a.cc:7:18: error: conflicting declaration 'int s' 7 | int n=0, w = 0,s=0,e=0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] ...
s595689772
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n > 0 & w > 0 & s > 0 & e > 0){ ...
a.cc: In function 'int main()': a.cc:7:18: error: conflicting declaration 'int s' 7 | int n=0, w = 0,s=0,e=0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] ...
s270810915
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n=0, w = 0,s=0,e=0; string out = "No"; for(char c : s){ if(c == 'N'){ n++; }else if(c == 'W'){ w++; }else if(c == 'S'){ s++; }else{ e++; } if(n > 0 & w > 0 & s > 0 & e > 0){ ...
a.cc: In function 'int main()': a.cc:7:18: error: conflicting declaration 'int s' 7 | int n=0, w = 0,s=0,e=0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] ...
s658736803
p04019
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); boolean n; boolean w; boolean s; boolean e; for (int i = 0; i < S.length(); i++) { char c = S.charAt(i); if (c == 'N') { n = true...
Main.java:23: error: variable n might not have been initialized System.out.println((n^s)&&(w^e) ? "Yes" : "No"); ^ Main.java:23: error: variable s might not have been initialized System.out.println((n^s)&&(w^e) ? "Yes" : "No"); ^ Main.java:23: error: variable w ...
s843297711
p04019
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); boolean n; boolean w; boolean s; boolean e; for (int i = 0; i < N; i++) { char c = S.charAt(i); if (c == 'N') { n = true; }...
Main.java:11: error: cannot find symbol for (int i = 0; i < N; i++) { ^ symbol: variable N location: class Main 1 error
s987367232
p04019
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s;cin>>s; int n=s.size(); vector<int>a(4); for(int i=0;i<n;i++){ char p=s.at(i) if(p=='N')a.at(0)++; else if(p=='S')a.at(1)++; else if(p=='W')a.at(2)++; else a.at(3)++; } int x=0; if(a.at(0)>0){ if(a.at(1)>0){ if...
a.cc: In function 'int main()': a.cc:9:5: error: expected ',' or ';' before 'if' 9 | if(p=='N')a.at(0)++; | ^~ a.cc:10:5: error: 'else' without a previous 'if' 10 | else if(p=='S')a.at(1)++; | ^~~~
s175119804
p04019
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main(void){ int i,n,e,w,s; bool ans; string s; cin >> s; n=e=w=s=0; for (i=0;i<s.size();i++){ if (s[i]=='N') n++; else if (s[i]=='E') e++; else if (s[i]=='W') w++; else s++; } ans=((n==0 && s==0) || (n!=0...
a.cc: In function 'int main()': a.cc:8:10: error: conflicting declaration 'std::string s' 8 | string s; | ^ a.cc:6:15: note: previous declaration as 'int s' 6 | int i,n,e,w,s; | ^ a.cc:11:16: error: request for member 'size' in 's', which is of non-class type 'int' 11 |...
s874929298
p04019
C++
#include <bits/stdc++.h> #define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) #define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++) #define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--) #define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--) #define ALL(v) (v).begin(),(v).end() #define MOD 100000...
a.cc: In function 'int main()': a.cc:65:17: error: expected primary-expression before '<' token 65 | cout <<"Yes"<<<endl ; | ^
s826135516
p04019
C++
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main() { string s; cin >> s; int b =0 ,c=0,d=0,e =0; for(int i=;i<s.size();i++){ if(s[i] =='N'){ b++; } if(s[i] =='W'){ c++; } if(s[i]=='S'){ d++; } if(s[i] =='E'){ e++; ...
a.cc: In function 'int main()': a.cc:11:13: error: expected primary-expression before ';' token 11 | for(int i=;i<s.size();i++){ | ^
s561354151
p04019
C++
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main() { string a; cin >> a; int b =0 ,c=0,d=0,e =0; for(int i=;i<a.size();i++){ if(s[i] =='N'){ b++; } if(s[i] =='W'){ c++; } if(s[i]=='S'){ d++; } if(s[i] =='E'){ e++; ...
a.cc: In function 'int main()': a.cc:11:13: error: expected primary-expression before ';' token 11 | for(int i=;i<a.size();i++){ | ^ a.cc:12:8: error: 's' was not declared in this scope 12 | if(s[i] =='N'){ | ^ a.cc:15:8: error: 's' was not declared in this scope 15 | i...
s620955038
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { bool x=1 , y=1 , a=0 , b=0 , c=0 , d = 0; string s; cin >> s; for (int i = 0 ; i < (int)s.size() ; i++){ if(s[i] == 'n'){ a=1; } else if(s[i] == 'S'){ b=1; } else if(s[i] == 'W'){ c=1; } else if(s[i] == 'E'){ d=1; } if((a==0 ...
a.cc: In function 'int main()': a.cc:40:31: error: expected primary-expression before '<<' token 40 | cout << "No"; << endl; | ^~
s529067049
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { bool x=1 , y=1 , a=0 , b=0 , c=0 , d = 0; string s; cin >> s; for (int i = 0 ; i <s.size ; i++){ if(s[i] == 'n'){ a=1; } else if(s[i] == 'S'){ b=1; } else if(s[i] == 'W'){ c=1; } else if(s[i] == 'E'){ d=1; } if((a==0 && b==1)...
a.cc: In function 'int main()': a.cc:10:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig...
s005057287
p04019
C++
#include <bits/stdc++.h> using namespace std; int w; int main() { string s; cin >> s; int n = s.size(); if(n == 1){ cout << "No"; return 0; } for(int i = 0 ; i < n ; ++){ if(s[i] != s[i+1]) w++; } if(w == 1 && s[0] == s[n-1]){ cout << "Yes"; return 0; } for(int i = 0 ; i < n ; i++){ if(...
a.cc: In function 'int main()': a.cc:19:35: error: expected primary-expression before ')' token 19 | for(int i = 0 ; i < n ; ++){ | ^
s598009409
p04019
C++
#include <bits/stdc++.h> using namespace std; int w; int main() { string s; cin >> s; int n = s.size(); if(n == 1){ cout << "No"; return 0; } for(int i = 0 ; i < n ; ++){ if(s[i] != s[i+1]) w++ } if(w == 1 && s[0] == s[n-1]){ cout << "Yes"; return 0; } for(int i = 0 ; i < n ; i++){ if(s[i...
a.cc: In function 'int main()': a.cc:18:35: error: expected primary-expression before ')' token 18 | for(int i = 0 ; i < n ; ++){ | ^ a.cc:20:20: error: expected ';' before '}' token 20 | w++ | ^ | ; ...
s025065276
p04019
C++
#include <bits/stdc++.h> using namespace std; int w; int main() { string s; cin >> s; return 0; } int n = s.size(); if(n == 1){ cout << "No"; return 0; } for(int i = 0 ; i < n ; ++){ if(s[i] != s[i+1]) w++ } if(w == 1 && s[0] == s[n-1]){ cout << "Yes"; return 0; } for(int i = 0 ; i < n ;...
a.cc:15:17: error: 's' was not declared in this scope 15 | int n = s.size(); | ^ a.cc:16:9: error: expected unqualified-id before 'if' 16 | if(n == 1){ | ^~ a.cc:20:9: error: expected unqualified-id before 'for' 20 | for(int i = 0 ; i < n ; ++){ ...
s000983397
p04019
C++
#include<bits/stdc++.h> using namespace std; #define foorp(i , a , n) for (int (i) = (a); (i) < (n); (i)++) #define foorm(i , a , n) for (int (i) = (a); (i) > (n); (i)--) #define ll long long int string s; bool n , w , sb , e; int main() { cin >> s; for (int i = 0; i < (int)s.size(); i++) { if ...
a.cc: In function 'int main()': a.cc:22:24: error: expected ';' before 'if' 22 | sb = true;i | ^ | ; 23 | if (s[i] == 'E') | ~~
s480466026
p04019
C++
#include <iostream> #include <map> #include <set> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <fstream> #include <bitset> #include <queue> #include <stack> #include <deque> #include <complex> #include <iomanip> #include <stdio.h> #include <string.h> using std::cin; using std::cou...
a.cc: In function 'int main()': a.cc:100:40: error: 'cnt' was not declared in this scope; did you mean 'int'? 100 | for (int i = 0; i < s.size(); i++) cnt[s[i]]++; | ^~~ | int a.cc:101:9: error: 'cnt' was not declared in thi...
s448729532
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; bool n=false,s=false,w=false,e=false; for(int i=0;i<s.size();i++){ if(s.at(i)=='N') n=true; else if(s.at(i)=='S') s=true; else if(s.at(i)=='W') w=true; else e=true; } if(n&&s&&e&&w) cout<<"Yes"; else if(n&&s&&!e&&...
a.cc: In function 'int main()': a.cc:7:16: error: conflicting declaration 'bool s' 7 | bool n=false,s=false,w=false,e=false; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:14:7: error: no match for 'operator&&' (operand types are 'bool...
s508616287
p04019
C++
#include <iostream> #include <cstring> #include <stdlib.h> #include <vector> #include <algorithm> #include <cmath> #include <stack> #include <queue> #include <math.h> #include <string> #include <map> #include <iomanip> using namespace std; typedef long long ll; ll mod=1000000007; typedef pair<int, int> P; int main() ...
a.cc: In function 'int main()': a.cc:33:17: error: expected primary-expression before '<' token 33 | else cout <<<"No"; | ^
s536839475
p04019
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<bits/stdc++.h> #include<cmath> #include<bitset> #include<queue> #define ll long long #define itn int #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define FFOR(i,a,b) for(int i=(a);i<=(b);++i) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) ...
a.cc: In function 'int main()': a.cc:38:10: error: lvalue required as left operand of assignment 38 | if(A[1]*A[2]=0 && A[1]+A[2]>0) CAN=false; | ~~~~^~~~~ a.cc:39:10: error: lvalue required as left operand of assignment 39 | if(A[3]*A[4]=0 && A[3]+A[4]>0) CAN=false; | ~~~~^~~~~
s514240775
p04019
C++
#include <bits/stdc++.h> int main(void) { std::string s; std::cin >> s; std::bool c[4] = {false, false, false, false}; for (int i = 0; i < s.length; i++) { if (s[i] == 'N') c[0] = true; if (s[i] == 'W') c[1] = true; if (s[i] == 'S') c[2] = true; if (s[i] == 'E') c[3] = true; } if (!c[0] && ...
a.cc: In function 'int main()': a.cc:6:8: error: expected unqualified-id before 'bool' 6 | std::bool c[4] = {false, false, false, false}; | ^~~~ a.cc:7:25: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits,...
s540303968
p04019
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int main() { int w=0,e=0,n=0,s=0,ans=0; string s; cin>>s; rep(i,s.size()){ if(s[i]=='W'){ w=1; } if(s[i]=='E'){ e=1; } if(s[i]=='N'){ n=1; } if(s[i]=='S'){ s=1; } ...
a.cc: In function 'int main()': a.cc:6:10: error: conflicting declaration 'std::string s' 6 | string s; | ^ a.cc:5:19: note: previous declaration as 'int s' 5 | int w=0,e=0,n=0,s=0,ans=0; | ^ a.cc:8:11: error: request for member 'size' in 's', which is of non-class typ...
s182984213
p04019
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int main() { int w=0,e=0,n=0,s=0,ans=0; string s; cin>>s; rep(i,s.size()){ if(s[i]=='W'){ w=1; } if(s[i]=='E'){ e=1; } if(s[i]=='N'){ n=1; } if(s[i]=='S'){ s=1; } ...
a.cc: In function 'int main()': a.cc:6:10: error: conflicting declaration 'std::string s' 6 | string s; | ^ a.cc:5:19: note: previous declaration as 'int s' 5 | int w=0,e=0,n=0,s=0,ans=0; | ^ a.cc:8:11: error: request for member 'size' in 's', which is of non-class typ...
s658057554
p04019
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, n) for (ll i = j; i < n; i++) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define MAX (100000) #define pii pair<int, int> ///////////////////////////////////////////////////////// class XY{...
a.cc: In function 'void Main()': a.cc:56:10: error: conflicting declaration 'int S' 56 | int N, S, W, E; | ^ a.cc:55:10: note: previous declaration as 'std::string S' 55 | string S; cin >> S; | ^ a.cc:57:9: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in assi...
s923451596
p04019
C++
#include<bits/stdc++.h> 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++; } } bool c=true; if((n+w!=0&&n*w==0)|...
a.cc: In function 'int main()': a.cc:6:15: error: conflicting declaration 'int s' 6 | int n=0,w=0,s=0,e=0; | ^ a.cc:4:10: note: previous declaration as 'std::string s' 4 | string s; | ^ a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 15 |...
s582210784
p04019
C++
#include<bits/stdc++.h>//万能头文件 using namespace std; int w=0,n=0,e=0,s=0; string str; inline bool check()//判断是否符合条件 { if(w==n&&n==e&&e==s&&s==w)return 1; if((w+e)=>2&&(n+s)==0)return 1; if((n+s)=>2&&(w+e)==0)return 1; if((n+s)=>2&&(w+e)=>2)return 1; return 0; /* if(w==1&&e==1&&n==1&&s==1)return 1; if(w==...
a.cc: In function 'bool check()': a.cc:8:18: error: expected primary-expression before '>' token 8 | if((w+e)=>2&&(n+s)==0)return 1; | ^ a.cc:9:18: error: expected primary-expression before '>' token 9 | if((n+s)=>2&&(w+e)==0)return 1; | ^ a.cc:10:18...
s520806371
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin>>S; int Ncount=0; int Wcount=0; int Scount=0; int Ecount=0; bool Z=true; for(int i=0;i<S.size();i+;){ if(S.at(i)=='N'){ Ncount++; } if(S.at(i)=='W'){ Wcount++; } if(S.at(i)=='S'){ Scount++; ...
a.cc: In function 'int main()': a.cc:11:28: error: expected primary-expression before ';' token 11 | for(int i=0;i<S.size();i+;){ | ^ a.cc:11:28: error: expected ')' before ';' token 11 | for(int i=0;i<S.size();i+;){ | ~ ^ | ...
s417571170
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int N=-1; int E=-1; int W=-1; int S=-1; for(int i=0;i<s.size();i++){ if(S[i]=='N') N=1; if(S[i]=='E') E=1; if(S[i]=='W') W=1; if(S[i]=='S') S=1; } if(N*S<0 || E*W<0){ cout << "NO" << endl; } else cout ...
a.cc: In function 'int main()': a.cc:11:9: error: invalid types 'int[int]' for array subscript 11 | if(S[i]=='N') N=1; | ^ a.cc:12:9: error: invalid types 'int[int]' for array subscript 12 | if(S[i]=='E') E=1; | ^ a.cc:13:9: error: invalid types 'int[int]' for array subscript ...
s894718560
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S; cin >> S; int N=-1; int E=-1; int W=-1; int S=-1; for(int i=0;i<S.size();i++){ if(S[i]=='N') N=1; if(S[i]=='E') E=1; if(S[i]=='W') W=1; if(S[i]=='S') S=1; } if(N*S<0 || E*W<0){ cout << "NO" << endl; } else cout ...
a.cc: In function 'int main()': a.cc:9:7: error: conflicting declaration 'int S' 9 | int S=-1; | ^ a.cc:5:10: note: previous declaration as 'std::string S' 5 | string S; cin >> S; | ^ a.cc:16:7: error: no match for 'operator*' (operand types are 'int' and 'std::string' {aka 'std::...
s612945456
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ srting S; cin >> S; int N=-1; int E=-1; int W=-1; int S=-1; for(int i=0;i<S.size();i++){ if(S[i]=='N') N=1; if(S[i]=='E') E=1; if(S[i]=='W') W=1; if(S[i]=='S') S=1; } if(N*S<0 || E*W<0){ cout << "NO" << endl; } else cout ...
a.cc: In function 'int main()': a.cc:5:3: error: 'srting' was not declared in this scope 5 | srting S; cin >> S; | ^~~~~~ a.cc:5:20: error: 'S' was not declared in this scope 5 | srting S; cin >> S; | ^
s199660059
p04019
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define mp make_pair #define pb push_back #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) int main(){ string s; cin >> s; set<int> s; rep(i,n){ if(s[i]=='N') s.insert(0); if(s[i]=='W') s.insert(1); ...
a.cc: In function 'int main()': a.cc:12:12: error: conflicting declaration 'std::set<int> s' 12 | set<int> s; | ^ a.cc:10:10: note: previous declaration as 'std::string s' 10 | string s; | ^ a.cc:13:9: error: 'n' was not declared in this scope 13 | rep(i,n){ | ...
s750409338
p04019
C++
#include<iostream> #include<vector> using namespace std; string s; int main(){ cin>>s; bool okn = (count(s.begin(),s.end(),'N')!=0)?true:false; bool oks = (count(s.begin(),s.end(),'S')!=0)?true:false; bool okw = (count(s.begin(),s.end(),'W')!=0)?true:false; bool oke = (count(s.begin(),s.end(),'E')...
a.cc: In function 'int main()': a.cc:9:17: error: 'count' was not declared in this scope 9 | bool okn = (count(s.begin(),s.end(),'N')!=0)?true:false; | ^~~~~
s107259336
p04019
C++
#include<bits/stdc++.h> using namespace std; const int N=1e5+10; int e,Pri[N>>1],n,f; long long prc[N],a[N],w[N],c[N]; bool pri[N],flag; map <long long,int> cot; inline int Read() { int x=0,f=1; char ch=getchar(); while (ch<'0'||ch>'9') {if (ch=='-') f=-f; ch=getchar();} while (ch>='0'&&ch<='9') x=x*10+ch-...
a.cc: In function 'int main()': a.cc:30:40: error: too few arguments to function 'ssize_t read(int, void*, size_t)' 30 | for(int i=1;i<=n;i++) a[i]=read();//scanf("%lld",&a[i]); | ~~~~^~ In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24, ...
s060256478
p04019
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; int n, s, w, e; n = s = w = e = 0; cin >> s; for(int i = 0; i < s.length(); i++){ if(s[i] == 'N') n++; else if(s[i] == 'E') e++; else if(s[i] == 'S') s++; else w++; } if(n == 0 && s == 0) { if(w != 0 && e != 0) cout <...
a.cc: In function 'int main()': a.cc:6:10: error: conflicting declaration 'int s' 6 | int n, s, w, e; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:7:9: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in assignment 7 |...
s780535332
p04019
C
#include<stdio.h> int main(void){ int Go[1000],i,N=0,S=0,E=0,W=0; scanf("%s",S); for(i = 0;Go[i] != '\0';i++){ if(Go[i] == 'N'){ N = 1; }else if(Go[i] == 'S'){ S = 1; }else if(Go[i] == 'E'){ E = 1; }else if(Go[i] == 'W'){ W = 1; } } if((N = 1 && S = 0)||(N...
main.c: In function 'main': main.c:20:18: error: lvalue required as left operand of assignment 20 | if((N = 1 && S = 0)||(N = 0 && S = 1)){ | ^ main.c:20:36: error: lvalue required as left operand of assignment 20 | if((N = 1 && S = 0)||(N = 0 && S = 1)){ | ...
s283966890
p04019
C
#include<stdio.h> int main(void){ int S[1000],i,N=0,S=0,E=0,W=0; scanf("%s",S); for(i = 0;S[i] != '\0';i++){ if(S[i] == 'N'){ N = 1; }else if(S[i] == 'S'){ S = 1; }else if(S[i] == 'E'){ E = 1; }else if(S[i] == 'W'){ W = 1; } } if((N = 1 && S = 0)||(N = 0 &...
main.c: In function 'main': main.c:5:21: error: conflicting types for 'S'; have 'int' 5 | int S[1000],i,N=0,S=0,E=0,W=0; | ^ main.c:5:7: note: previous declaration of 'S' with type 'int[1000]' 5 | int S[1000],i,N=0,S=0,E=0,W=0; | ^ main.c:22:24: error: lvalue required a...
s088706137
p04019
C++
#include<bist/stdc++.h> using namespace std; int main(){ string S;cin >> S; int N = S.size(); bitset<4>bs; for(int i = 0; i < N; ++i){ switch(S[i]){ case 'S':bs[0]=1;break; case 'N':bs[1]=1;break; case 'W':bs[2]=1;break; case 'E':bs[3]=1;break; } } bool f = bs[0] == bs[1]; f |= bs[...
a.cc:1:9: fatal error: bist/stdc++.h: No such file or directory 1 | #include<bist/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s909033537
p04019
C++
#include<iostream> #include<algorithm> #include<cmath> using namespace std; int main() { int a[4]={0}; string s; cin >> s; for(int i=0; i<s.size(); i++) { if(s[i]=='S') { a[0]=1; } if(s[i]=='N') { a[1]=1; } if(s[i]=='W') { f[2]=1; } if(s[i]=='E') { f[3]=1; ...
a.cc: In function 'int main()': a.cc:17:7: error: 'f' was not declared in this scope 17 | f[2]=1; | ^ a.cc:20:7: error: 'f' was not declared in this scope 20 | f[3]=1; | ^
s552179085
p04019
C++
#include<bits/stdc++.h> using namespace std; int main(){ string S;cin>>S; int n=S.size(),a=0,b=0,c=0,d=0; for(int i=0;i<N;i++){ if(S.at(i)=='N')a++; if(S.at(i)=='S')b++; if(S.at(i)=='E')c++; if(S.at(i)=='W')d++; } int check1=0,check2=0; if((a==0 && b==0) or (a>0 && b>0))check1=1; if((c=...
a.cc: In function 'int main()': a.cc:6:17: error: 'N' was not declared in this scope 6 | for(int i=0;i<N;i++){ | ^
s448114892
p04019
C++
#include <iostream> #include <stack> using namespace std; int main(int argc, const char *argv[]) { string s; cin >> s; bool n, s, e, w; for (int i = 0; i < s.length(); i++) { switch (s[i]) { case 'N': n = true; break; case 'W': w =...
a.cc: In function 'int main(int, const char**)': a.cc:9:13: error: conflicting declaration 'bool s' 9 | bool n, s, e, w; | ^ a.cc:7:12: note: previous declaration as 'std::string s' 7 | string s; | ^ a.cc:29:21: error: no match for 'operator==' (operand types are 'std:...
s067805729
p04019
C++
#include <iostream> #include <string> #include <algorithm> #include <cstdlib> #include <cmath> #include <queue> #include <vector> #include <set> #include <map> #include <numeric> #include <iomanip> #include <tuple> using namespace std; int main(){ string S; cin>>S; int n=0,s=0,e=0,w=0; for(int i=0;i<S.siz...
a.cc: In function 'int main()': a.cc:32:17: error: expected ';' before 'cout' 32 | if((ns && ew)cout<<"Yes"<<endl; | ^~~~ | ; a.cc:33:4: error: expected primary-expression before 'else' 33 | else cout<<"No"<<endl; | ^~~~ a.cc:32:35: error: expected ')' be...
s590959979
p04019
C++
#include <iostream> #include <string> #include <iomanip> #include <ios> using namespace std; int main(void){ string word; cin >> word; int n = 0; int s = 0; int e = 0; int w = 0; int n = word.length(); for(int i=0;i<n;i++){ if(word[i] == 'n') n++; if(word[i] == 's') s++; ...
a.cc: In function 'int main()': a.cc:15:7: error: redeclaration of 'int n' 15 | int n = word.length(); | ^ a.cc:10:7: note: 'int n' previously declared here 10 | int n = 0; | ^
s654823094
p04019
C++
#include <stdc++.h> using namespace std; int main(){ string N; cin >> N; int n=0,s=0,e=0,w=0; for(int i = 0; i < N.size(); i++){ if(N[i] == 'N'){ n++; } else if(N[i] == 'S'){ s++; } else if(N[i] == 'E'){ e++; } else{ w++; } } bool c...
a.cc:1:10: fatal error: stdc++.h: No such file or directory 1 | #include <stdc++.h> | ^~~~~~~~~~ compilation terminated.
s428982184
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string dir; cin >> dir; int east = 0, west = 0, north = 0, south = 0,size = dir.size(); for (int i = 0; i < size; i++) { if (dir.at(i) == "N") north++; else if ("S" == dir.at(i)) south++; else if ("E" == dir.at(i)) east++...
a.cc: In function 'int main()': a.cc:9:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if (dir.at(i) == "N") | ~~~~~~~~~~^~~~~~ a.cc:11:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | else if ("S" == dir.at(i)) ...
s004544535
p04019
C++
include <bits/stdc++.h> using namespace std; int main() { string s; int i, cntn = 0, cnts = 0, cnte = 0, cntw = 0; cin >> s; for(i = 0; i < s.size(); i++) { if(s.at(i) == 'N') { cntn++; } else if(s.at(i) == 'S') { cnts++; } else if(s.at(i) == 'E') { ...
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:8:3: error: 'cin' was not declared in this scope 8 | cin >> s; | ^~~ a.cc:8:10:...
s662866743
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; int i, cntn = 0, cnts = 0, cnte = 0, cntw = 0; cin >> s; for(i = 0; i < s.size(); i++){ if(s.at(i) == 'N') cntn++; else if(s.at(i) == 'S') cnts++; else if(s.at(i) == 'E') cnte++; else cntw+; } if((cntn == 0 && cnts !...
a.cc: In function 'int main()': a.cc:13:15: error: expected primary-expression before ';' token 13 | else cntw+; | ^
s221903453
p04019
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String text = in.next(); in.close(); boolean u = text.contains("N"); boolean d = text.contains("S"); boolean r = text.contains("E"); boolean l = text.contains("W"...
Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s800675192
p04019
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String text = in.next(); in.close(); String dis = text.contains("N") && contains("S") && contains("W") && contains("E") ? "Yes" : "No"; ...
Main.java:8: error: cannot find symbol String dis = text.contains("N") && contains("S") && contains("W") && contains("E") ^ symbol: method contains(String) location: class Main Main.java:8: error: cannot find symbol String dis = text.contains("N") && cont...
s522531105
p04019
C++
#include <bits/stdc++.h> using namespace std; const long long mod = pow(10, 9) + 7; const long long MOD = 998244353; const long long INF = 1LL << 60; const int inf = pow(10, 9) + 7; template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;} template <class T> bool chmax(T& a, T b) {if (a ...
a.cc: In function 'int main()': a.cc:21:7: error: redeclaration of 'int N' 21 | int N = 0, W = 0, S = 0, E = 0; | ^ a.cc:18:7: note: 'int N' previously declared here 18 | int N = St.size(); | ^
s041257519
p04019
C++
#include <bits/stdc++.h> using namespace std; const long long mod = pow(10, 9) + 7; const long long MOD = 998244353; const long long INF = 1LL << 60; const int inf = pow(10, 9) + 7; template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;} template <class T> bool chmax(T& a, T b) {if (a ...
a.cc: In function 'int main()': a.cc:21:7: error: redeclaration of 'int N' 21 | int N = 0, W = 0, S = 0, E = 0; | ^ a.cc:18:7: note: 'int N' previously declared here 18 | int N = S.size(); | ^ a.cc:21:21: error: conflicting declaration 'int S' 21 | int N = 0, W = 0, S = 0, E = 0; ...
s488062380
p04019
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
a.cc: In function 'int main()': a.cc:349:9: error: 'N' was not declared in this scope 349 | REP(i,N) | ^ a.cc:108:38: note: in definition of macro 'REP' 108 | #define REP(i,n) for(int i=0;i<(int)(n);++i) | ^ a.cc: In function 'int dir(char)': a.cc:334:1: wa...
s384792563
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; bool s = 0, n = 0, w = 0, e = 0; for(int i = 0; i < s.size(); i++) { if(s[i] == 'S') { s = 1; } if(s[i] == 'E') { e = 1; } if(s[i] == 'W') { w = 1; } if(s[i] == 'N') { n = 1; }...
a.cc: In function 'int main()': a.cc:7:8: error: conflicting declaration 'bool s' 7 | bool s = 0, n = 0, w = 0, e = 0; | ^ a.cc:5:10: note: previous declaration as 'std::string s' 5 | string s; | ^ a.cc:23:8: error: no match for 'operator==' (operand types are 'std::string' {aka ...
s329704733
p04019
C++
#include<iostream> using namespace std; int main() { string S; cin >> S; bool A = false; bool B = false; bool C = false; bool D = false; for(int i = 0;i < S.size;i++) { if(S.at(i) == 'N') { A = true; } if(S.at(i) == 'W') { B = true; } if(S.at(i) == 'S') { C = true; ...
a.cc: In function 'int main()': a.cc:11:23: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig...
s406966080
p04019
C++
bool fl = false;
/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
s792390823
p04019
C++
#include <bits/stdc++.h> #define F first #define S second #define all(a) a.begin(),a.end() #define setDP(arr) memset(arr,-1,sizeof arr) #define Clear(arr) memset(arr,0,sizeof arr) #define oo 2000000000 #define inf 1000000000000000000 #define P1 31 #define P2 37 #define M 1000000007 #define M2 1000000009 #define pii pa...
a.cc: In function 'int main()': a.cc:27:25: error: 'n' was not declared in this scope 27 | for(int i = 0 ; i < n ; i++){ | ^
s856693812
p04019
C++
#include <bits/stdc++.h> #define F first #define S second #define all(a) a.begin(),a.end() #define setDP(arr) memset(arr,-1,sizeof arr) #define Clear(arr) memset(arr,0,sizeof arr) #define oo 2000000000 #define inf 1000000000000000000 #define P1 31 #define P2 37 #define M 1000000007 #define M2 1000000009 #define pii pa...
a.cc: In function 'int main()': a.cc:27:25: error: 'n' was not declared in this scope 27 | for(int i = 0 ; i < n ; i++){ | ^
s855322461
p04019
C++
#include<iostream> using namespace std; int main() { string s; cin>>s; int e=0,w=0,S=0,n=0; for(int i=0;i<s.size();i++) { if(s[i]=='E') e=1; else if(s[i]=='W') { w=1; } else if(s[i]=='S') S=1; else if(s[i]=='N') n=1; } if(e!=w||S!=n)) { cout<<"No"; } else { cout<<"Yes"; } return...
a.cc: In function 'int main()': a.cc:21:23: error: expected primary-expression before ')' token 21 | if(e!=w||S!=n)) | ^
s987231649
p04019
C++
#include<iostream using namespace std; int main() { cout<<"Yes"; return 0; }
a.cc:1:18: error: missing terminating > character 1 | #include<iostream | ^
s781257770
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; return 0; } int nain() { getline(cin,ss)...
a.cc: In function 'int nain()': a.cc:17:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 17 | 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...
s934515913
p04019
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()) #define VRSORT(v) sort(v.rbegin(), v.rend()) #define ll long long #define pb(a) push_back(a) #define INF 1000000000 #define MOD 1000000007 using namespace std; typedef pair<int,...
a.cc: In function 'int main()': a.cc:39:8: error: 'H' was not declared in this scope 39 | if(H>0&&S>0){ | ^
s373424664
p04019
C++
#include <bits/stdc++.h> #define il inline #define ri register int #define pb push_back #define mp make_pair #define fir first #define sec second #define mid ((l+r)>>1) #define MAXN 1050 #define MAXM #define mod #define inf (1<<30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) for(ri i = x; i <= y; ++i) #d...
a.cc:37:13: error: 'int y1' redeclared as different kind of entity 37 | int x1, x2, y1, y2; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++con...
s456517688
p04019
C++
#include<bits/stdc++.h> using namespace std; char s[1005]; int main() { scanf("%s",s+1); int n=strlen(s+1); for(int i=1;i<=n;i++) cnt[s[i]-'A']++; if((cnt['S'-'A']&&!cnt['N'-'A'])||(cnt['N'-'A']&&!cnt['S'-'A'])|| (cnt['W'-'A']&&!cnt['E'-'A'])||(cnt['E'-'A']&&!cnt['W'-'A'])) puts("No"); else puts("Yes...
a.cc: In function 'int main()': a.cc:8:25: error: 'cnt' was not declared in this scope; did you mean 'int'? 8 | for(int i=1;i<=n;i++) cnt[s[i]-'A']++; | ^~~ | int a.cc:9:7: error: 'cnt' was not declared in this scope; did you mean 'int'? 9 | if((cn...
s161965702
p04019
C++
#include <cstdio> char a[1005];bool N=0,S=0,W=0,E=0; int main (){ scanf ("%s",a+1);int n=strlen(a+1); for (int i=1;i<=n;i++) if (a[i]=='N') N=1; else if (a[i]=='S') S=1; else if (a[i]=='W') W=1; else E=1; if ((N^S)||(W^E)) puts("Yes"); else puts("No"); return 0; }
a.cc: In function 'int main()': a.cc:4:32: error: 'strlen' was not declared in this scope 4 | scanf ("%s",a+1);int n=strlen(a+1); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include ...
s179268373
p04019
C++
#include <cstdio> char a[1005];bool N=0,S=0,W=0,E=0; int main (){ scanf ("%s",a+1); for (int i=1;i<=n;i++) if (a[i]=='N') N=1; else if (a[i]=='S') S=1; else if (a[i]=='W') W=1; else E=1; if ((N^S)||(W^E)) puts("Yes"); else puts("No"); return 0; }
a.cc: In function 'int main()': a.cc:5:21: error: 'n' was not declared in this scope 5 | for (int i=1;i<=n;i++) | ^
s741863001
p04019
C++
#include <cstdio> const int N=1005; char a[N];bool N=0,S=0,W=0,E=0; int main (){ scanf ("%s",a+1); for (int i=1;i<=n;i++) if (a[i]=='N') N=1; else if (a[i]=='S') S=1; else if (a[i]=='W') W=1; else E=1; if ((N^S)||(W^E)) puts("Yes"); else puts("No"); return 0; }
a.cc:3:16: error: conflicting declaration 'bool N' 3 | char a[N];bool N=0,S=0,W=0,E=0; | ^ a.cc:2:11: note: previous declaration as 'const int N' 2 | const int N=1005; | ^ a.cc: In function 'int main()': a.cc:6:21: error: 'n' was not declared in this scope 6 | for (i...
s531836427
p04019
C++
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #include <cassert> #...
a.cc: In function 'int main()': a.cc:26:12: error: conflicting declaration 'int s' 26 | int n=0, s=0, w=0, e=0; | ^ a.cc:25:12: note: previous declaration as 'std::string s' 25 | string s; cin>>s; | ^ a.cc:29:22: error: no 'operator++(int)' declared for postfix '++' [-fperm...
s367229314
p04019
C++
#include <bits/stdc++.h> 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=1; if(s[i]=='W')W=10; if(s[i]=='S')S=-1; if(s[i]=='E')E=-10; } if(N+W+S+E==0)cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:35: error: expected ';' before ')' token 8 | for(int i=0;i<s.size(),i++){ | ^ | ;
s561282901
p04019
C++
#include <bits/stdc++.h> 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=1; if(S[i]=='W')W=10; if(S[i]=='S')S=-1; if(S[i]=='E')E=-10; } if(N+W+S+E==0)cout << "Yes" << endl; else cout << "No" << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:21: error: conflicting declaration 'int S' 7 | int N=0,W=0,S=0,E=0; | ^ a.cc:5:16: note: previous declaration as 'std::string S' 5 | string S; | ^ a.cc:8:35: error: expected ';' before ')' token 8 | ...
s310202274
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 ...
s118228048
p04019
C++
#include<iostream> #include<vector> using namespace std; #define P pair<int, int>; pair<int, int> temp; int N; int main(){ cin >> N; vector<pair<int, int>> A; int a, b; for (int i = 0; i < N; i ++) { cin >> a; temp.first = i; temp.second = a; A.push_back(temp); } sort(A.begin(), ...
a.cc: In function 'int main()': a.cc:6:25: error: expected ')' before ';' token 6 | #define P pair<int, int>; | ^ a.cc:23:38: note: in expansion of macro 'P' 23 | sort(A.begin(), A.end(), [](const P& x, const P& y) { return x.second > y.second;}) | ...
s203275119
p04019
C++
#include<iostream> #include<vector> using namespace std; pair<int, int> temp; int N; int main(){ cin >> N; vector<pair<int, int>> A[N]; int a, b; for (int i = 0; i < N; i ++) { cin >> a; temp.first = i; temp.second = a; A.push_back(temp); }
a.cc: In function 'int main()': a.cc:19:7: error: request for member 'push_back' in 'A', which is of non-class type 'std::vector<std::pair<int, int> > [N]' 19 | A.push_back(temp); | ^~~~~~~~~ a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:9:11: note: to match this '{' 9 ...
s989895044
p04019
C++
#include<iostream> #include<vector> using namespace std; pair<int, int> temp; int main(){ cin >> N; vector<pair<int, int>> A[N]; int a, b; for (int i = 0; i < N; i ++) { cin >> a; temp.first = i; temp.second = a; A.push_back(temp); }
a.cc: In function 'int main()': a.cc:9:10: error: 'N' was not declared in this scope 9 | cin >> N; | ^ a.cc:18:5: error: 'A' was not declared in this scope 18 | A.push_back(temp); | ^ a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:8:11: note: to match this...
s548107338
p04019
C++
#include <bits/stdc++.h> #define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++) #define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--) #define sz(v) (int)(v).size() #define pb push_back #define sc second #define fr first #define sor(v) sort(v.begin(),v.end()) #define rev(s) reverse(s.begin(),s.end()) #define lb(ve...
a.cc:34:2: error: stray '#' in program 34 | }#include <bits/stdc++.h> | ^ a.cc:34:3: error: 'include' does not name a type 34 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:50:10: error: redefinition of 'const ll MOD' 50 | const ll MOD=1000000007; | ^~~ a.cc:17:10: note: 'const ll MOD...
s586255241
p04019
Java
import java.util.*; public class Wanna_go_back_home{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); String S_s[] = s.split(""); String N = "N"; String W = "W"; String S = "S"; String E = "E"; int x = 0; int y = 0; for(int i =...
Main.java:3: error: class Wanna_go_back_home is public, should be declared in a file named Wanna_go_back_home.java public class Wanna_go_back_home{ ^ 1 error
s265183293
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 ...
s142815304
p04019
C++
#include <bits/stdc++.h> using namespace std; int main() { vector<int> vec(4); string S; cin >> S; int n = S.size(); for (int i = 0; i < N; i++) { if (S.at(i) == 'N') vec.at(0) += 1; else if (S.at(i) == 'E') vec.at(1) += 1; else if (S.at(i) == 'W') vec.at(2) += 1; else if (S.at(i) == 'S') ...
a.cc: In function 'int main()': a.cc:10:23: error: 'N' was not declared in this scope 10 | for (int i = 0; i < N; i++) { | ^
s668322026
p04019
C++
#include<stdio.h> #include<stdlib.h> int main() { int n=0, w=0, s=0, e=0; char* c = malloc(1000 * sizeof(char)); scanf("%s", c); int N = 0; int i=0; while (*(c+i)) { N++; i++; } for (int i=0; i<N; i++) { if (*(c+i) == 'N') {n++;} if (*(c+i) == 'W') {w++;} if (*(c+i) == 'S') {s...
a.cc: In function 'int main()': a.cc:6:19: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 6 | char* c = malloc(1000 * sizeof(char)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | void*
s499991497
p04019
C++
#include<iostream> #include<cstring> using namespace std; int main(){ string a; int sumn=0,sume=0; cin>>a; for(int i=0;i<strlen(a);i++){ if(a[i]=='N') sumn++; if(a[i]=='S') sumn--; if(a[i]=='E') sume++; if(a[i]=='W') sume--; } if(sumn==0&&sume==0) cout<<"Yes"...
a.cc: In function 'int main()': a.cc:8:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 8 | for(int i=0;i<strlen(a);i++){ | ^ | | | std::string {aka std::__cxx11::basic_s...
s200510205
p04019
C++
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10; char c[N]; int main() { scanf("%s", c + 1); int n = strlen(c + 1), a, b, c, d; a = b = c = d = 0; for (int i = 1; i <= n; i++) { if (c[i] == 'N') a = 1; if (c[i] == 'S') b = 1; if (c[i] == 'W') c = 1; if (c[i] == 'E') d = 1...
a.cc: In function 'int main()': a.cc:14:10: error: invalid types 'int[int]' for array subscript 14 | if (c[i] == 'N') a = 1; | ^ a.cc:15:10: error: invalid types 'int[int]' for array subscript 15 | if (c[i] == 'S') b = 1; | ^ a.cc:16:10: error: invalid types 'int[int]' for ar...