submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s377075147 | p04018 | C++ | 、#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
#define endl '\n'
#define next next_
#define fst first
#define sed second
#define pb push_back
#define mp make_pair
#define rint register int
#define newline... | a.cc:1:1: error: extended character 、 is not valid in an identifier
1 | 、#include <bits/stdc++.h>
| ^
a.cc:1:3: error: stray '#' in program
1 | 、#include <bits/stdc++.h>
| ^
a.cc:1:1: error: '\U00003001' does not name a type
1 | 、#include <bits/stdc++.h>
| ^~
a.cc:5:9: error: 'pair' does... |
s437054623 | p04018 | C++ | #include<iostream>
#include<fstream>
#include<sstream>
#include<algorithm>
#include<cstdio>
#include<cassert>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<deque>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<iomanip... | a.cc: In function 'int main()':
a.cc:59:26: error: 'endel' was not declared in this scope
59 | cout<<n<<endel<<1;
| ^~~~~
|
s649609689 | p04018 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define N 500050
char w[N];
int nxt[N],n,txn[N];
bool check1(int x) {
if(x<2) return 1;
int t=x-nxt[x];
return t==x||x%t>0;
}
bool check2(int x) {
if(x>n-1) return 1;
int t=(n-x+1)-(n-txn[x]+1);
return t==(n-x+1)||(n... | In file included from /usr/include/c++/14/cstdio:42,
from a.cc:1:
a.cc: In function 'int main()':
a.cc:20:26: error: invalid conversion from 'FILE*' to 'size_t' {aka 'long unsigned int'} [-fpermissive]
20 | fread(w+1,500005,stdin);
| ^~~~~
| ... |
s282869252 | p04018 | C++ | #include <bits/stdc++.h>
#define PB push_back
#define LL long long
const int mod = 924844033;
using namespace std;
LL p = 235743;
LL pwr[500005];
LL pref[500005];
LL hsh(int l , int r)
{
return pref[r] - (l ? pref[l - 1] : 0);
}
bool check(string s , int div)
{
for(int i = div; i < s.size(); i += div)
{
if(s.subst... | a.cc: In function 'int main()':
a.cc:71:48: error: no match for 'operator*' (operand types are 'std::__cxx11::basic_string<char>' and 'long long int')
71 | if(s.substr(0 , i - 1) * pwr[i] == s.substr(i , i + len - 1))
| ~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~
| ... |
s894660675 | p04018 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <ctime>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
#define rep(i, l, r) for (int i = l; i <= r; i ++)
#define dwn(i, r, l) for (int i = r; i >= l; i --... | a.cc: In function 'int main()':
a.cc:67:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
67 | strrev(str1+1);
| ^~~~~~
| strsep
|
s289182293 | p04018 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
#define rep(i, l, r) for (int i = l; i <= r; i ++)
#define dwn(i, r, l) for (int i = r; i >= l; i --)
#define repG(u, ... | a.cc: In function 'int main()':
a.cc:66:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
66 | strrev(str1+1);
| ^~~~~~
| strsep
|
s030594056 | p04018 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
#define rep(i, l, r) for (int i = l; i <= r; i ++)
#define dwn(i, r, l) for (int i = r; i >= l; i --)
#define repG(u, ... | a.cc: In function 'int main()':
a.cc:66:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
66 | strrev(str1+1);
| ^~~~~~
| strsep
|
s866415994 | p04018 | C++ | #include<bits/stdc++.h>
#define N 500005
#define mod 1000000007
#define base 37
using namespace std;
inline int read(){
int ans=0;
char ch=getchar();
while(!isdigit(ch))ch=getchar();
while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch^48),ch=getchar();
return ans;
}
char s[N];
int n,a[N];
unsigned int mul[N],hash[N];
inli... | a.cc: In function 'bool check(int, int)':
a.cc:19:46: error: reference to 'hash' is ambiguous
19 | for(;l<=dis&&r<=dis;l+=len,r+=len)if(hash[r]-hash[l-1]!=hash[len]*mul[l-1])return false;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
... |
s399000042 | p04018 | C++ | #include<cstdio>
#include<vector>
#include<cstring>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
const long long MAXN=500005,MOD=1e9+7,p=131;
long long hash[MAXN];
long long bitp[MAXN];
char s[MAXN];
long long l[MAXN],r[MAXN],len;
long long Hash(long long x,long long y)
{
return ((hash[y]-h... | a.cc: In function 'long long int Hash(long long int, long long int)':
a.cc:15:18: error: reference to 'hash' is ambiguous
15 | return ((hash[y]-hash[x-1]*bitp[y-x+1])%MOD+MOD)%MOD;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_bvector.h:65,
from /usr/includ... |
s913775717 | p04018 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
const ll base=1123;
const int MAXN=5e5+5;
string s;
int n;
ll pow[MAXN],hash[MAXN];
bool l[MAXN],r[MAXN];
void Init(){
s=' '+s;
n=s.length();
pow[0]=1;... | a.cc:15:4: warning: built-in function 'pow' declared as non-function [-Wbuiltin-declaration-mismatch]
15 | ll pow[MAXN],hash[MAXN];
| ^~~
a.cc: In function 'void Init()':
a.cc:23:27: error: reference to 'hash' is ambiguous
23 | for(int i=1;i<=n;i++) hash[i]=(1ll*hash[i-1]*base+s[i]-'a')%MOD;
| ... |
s137710234 | p04018 | C++ | #include <bits/stdc++.h>
#define f(a, n) for (int a = 0; a<n; a++)
using namespace std;
string s;
bool isrep(string s, int t){
f(i, s.size()) if (i + s/t < s.size()) if (s[i] != s[i+s/t]) return 0;
return 1;
}
int main(){
cin>>s;
if (s.size == 1) {
cout<<"2"<<endl; return 0;
}
f(i, s.size()-1) if (i>1) ... | a.cc: In function 'bool isrep(std::string, int)':
a.cc:6:27: error: no match for 'operator/' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
6 | f(i, s.size()) if (i + s/t < s.size()) if (s[i] != s[i+s/t]) return 0;
| ~^~
| ... |
s077747997 | p04018 | C++ | #include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5... | a.cc:27:39: warning: use of 'auto' in template argument only available with '-fconcepts-ts'
27 | ostream& operator<<(ostream& o,vector<auto> &a){Int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
| ^~~~
a.cc:28:39: warning: use of 'auto' in template argument only available... |
s655776772 | p04018 | C++ | #include<bits/stdc++.h>
using namespace std;
using Int = long long;
struct FastIO{
FastIO(){
cin.tie(0);
ios::sync_with_stdio(0);
}
}fastio_beet;
struct RollingHash{
typedef unsigned long long ull;
string S;
ull B;
Int len;
vector<ull> hash,p;
RollingHash(){}
RollingHash(string S_,ull B_=10... | a.cc: In function 'int main()':
a.cc:53:3: error: 'RollingHash2' was not declared in this scope; did you mean 'RollingHash'?
53 | RollingHash2 rh2(s);
| ^~~~~~~~~~~~
| RollingHash
|
s486290999 | p04018 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#defi... | a.cc: In function 'int main()':
a.cc:85:25: error: 'res' was not declared in this scope; did you mean 'rep'?
85 | repl(i,1,n+1)if(!g[i])res++;
| ^~~
| rep
a.cc:86:9: error: 'res' was not declared in this scope; did you mean 'rep'?
86 | cout<<res<<end... |
s270831382 | p04018 | C++ | #include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
string str;
int dp[4001];
ll pat[4001];
ll tx[4001];
ll hash[4001];
bool C(int f,int t){
int len=t-f;
vector<int> ve;
for(int g=2;g*g<=len;g++){
if(len%g==0){
ve.push_back(g);
ve.push_back(... | a.cc: In function 'bool C(int, int)':
a.cc:24:26: error: reference to 'hash' is ambiguous
24 | ll base=(hash[f+v]-hash[f]+MOD)%MOD;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
... |
s682109631 | p04018 | C++ | import java.io.*;
import java.util.*;
import java.math.*;
// import java.awt.Point;
public class Main {
InputStream is;
PrintWriter out;
String INPUT = "";
long mod = 1_000_000_007;
long inf = Long.MAX_VALUE;
void solve(){
String s = ns();
int[] z = zalgo(s);
int f =... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: ... |
s813142705 | p04018 | C++ | import java.io.*;
import java.util.*;
import java.math.*;
// import java.awt.Point;
public class Main {
InputStream is;
PrintWriter out;
String INPUT = "";
long mod = 1_000_000_007;
long inf = Long.MAX_VALUE;
void solve(){
String s = ns();
int[] z = zalgo(s);
int f =... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: ... |
s198341671 | p04018 | C++ | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <li... | a.cc: In function 'void ZAlgo(std::string&, std::vector<int>&)':
a.cc:59:36: error: 'a' was not declared in this scope
59 | while(i+k < n && k+a[k]<j) z[i+k] = z[k], k++;
| ^
a.cc: In function 'int main()':
a.cc:92:56: error: 'c2' was not declared in this scop... |
s134426204 | p04018 | C++ | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <li... | a.cc: In function 'void ZAlgo(std::string&, std::vector<int>&)':
a.cc:53:17: error: 'a' was not declared in this scope
53 | a[i] = j;
| ^
a.cc: In function 'int main()':
a.cc:92:56: error: 'c2' was not declared in this scope; did you mean 'c'?
92 | for(int i =... |
s288700394 | p04018 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int MAXN = 5e5 + 10;
char s[MAXN];
int next[MAXN] , l;
bool f[MAXN] , e[MAXN];
int main(){
memset(f , 0 , sizeof f);
cin >> s + 1;
l = strlen(s + 1);
bool same = 1;
for(int i = 2 ; i <= l ; ++ i)
if(s[i] != s[1]){
same = 0;
... | a.cc: In function 'int main()':
a.cc:25:9: error: reference to 'next' is ambiguous
25 | next[1] = 0;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
... |
s508065744 | p04018 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int MAXN = 1e5 + 10;
char s[MAXN];
int next[MAXN];
int main(){
cin >> s + 1;
int l = strlen(s + 1);
bool ok = 1;
for(int i = 1 ; i <= l ; ++ i)
if(s[i] != s[1]){
ok = 0;
break;
}
if(ok){
cout << l << endl << 1 << endl... | a.cc: In function 'int main()':
a.cc:23:9: error: reference to 'next' is ambiguous
23 | next[1] = 0;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
... |
s664069377 | p04018 | C++ | #include <bits/stdc++.h>
#define ll long long
#define uint unsignextd long long
#define db double
#define ls x << 1
#define rs x << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#defin... | a.cc: In function 'int main()':
a.cc:41:42: error: reference to 'next' is ambiguous
41 | while(j && s[j + 1] != s[i]) j = next[j];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
... |
s195556715 | p04018 | C++ | for(int i=1;i<=sz/2;i++){
if(!bad1[i]){
string tmp=str.substr(0,i);
int j=i;
while( j+i<=sz ){
if(tmp==str.substr(j,i)){
bad1[j+i]=true;
j+=i;
... | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for(int i=1;i<=sz/2;i++){
| ^~~
a.cc:1:13: error: 'i' does not name a type
1 | for(int i=1;i<=sz/2;i++){
| ^
a.cc:1:21: error: 'i' does not name a type
1 | for(int i=1;i<=sz/2;i++){
| ^
|
s749669925 | p04018 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
string str;
cin>>str;
char aho=str[0];
bool flag=true;
for(int i=0;i<str.size();i++){
if(str[i]!=aho){
flag=false;
break;
}
}
if(flag){//みんな同じ文字
cout<<str.si... | a.cc: In function 'int main()':
a.cc:66:13: error: 'reverse' was not declared in this scope
66 | reverse(nex.begin(),nex.end());
| ^~~~~~~
|
s406945895 | p04018 | Java | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
public class Main {
static InputStream is;
static PrintWriter out;
static String INPUT = "";
public static void main(String[] args) throws E... | Main.java:66: error: incompatible types: ArrayList<Integer>[] cannot be converted to ArrayList<Integer>
if (isGood(0, n, hash[i], mod[i], pow[i], div)) {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some m... |
s772005099 | p04018 | Java | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
public class Main {
static InputStream is;
static PrintWriter out;
static String INPUT = "";
public static void main(String[] args) throws E... | Main.java:66: error: incompatible types: ArrayList<Integer>[] cannot be converted to ArrayList<Integer>
if (isGood(0, n, hash[i], mod[i], pow[i], div)) {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some m... |
s616511638 | p04018 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
//#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
#define... | a.cc: In function 'int askRMQ(int, int)':
a.cc:88:19: error: no matching function for call to 'swap(int&)'
88 | if(a > b) swap(b);
| ~~~~^~~
In file included from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/i... |
s819668883 | p04018 | C++ | #include <map>
#include <vector>
#include <functional>
#include <iterator>
#include <utility>
#include <array>
#include <cstdio>
namespace XX
{
template<template<typename> class Compare, typename T>
inline T& UP(T& x, const T& y){if(Compare<T>()(y, x)) x = y; return x;}
template<typename Compare, typenam... | a.cc: In function 'int main()':
a.cc:204:5: error: 'strcpy' was not declared in this scope
204 | strcpy(text, buf);
| ^~~~~~
a.cc:194:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
193 | #include <algorithm>
+++ |+#include <cstring>
194 ... |
s721409131 | p04018 | C++ | #include <algorithm>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <num... | a.cc: In function 'void init_hash()':
a.cc:56:17: error: reference to 'hash' is ambiguous
56 | hash[t][0] = 0;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c+... |
s999205179 | p04018 | C++ | #include <algorithm>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <num... | a.cc: In function 'void init_hash()':
a.cc:56:17: error: reference to 'hash' is ambiguous
56 | hash[t][0] = 0;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c+... |
s588233867 | p04018 | C++ | #include <algorithm>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <num... | a.cc:45:18: error: narrowing conversion of '1.000000007e+9' from 'double' to 'll' {aka 'long long int'} [-Wnarrowing]
45 | ll hmod[M] = {1e9+7};
| ~~~^~
a.cc:47:4: warning: built-in function 'pow' declared as non-function [-Wbuiltin-declaration-mismatch]
47 | ll pow[M][N];
| ^~~
a.cc:... |
s401774514 | p04018 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef std::vecto... | a.cc: In function 'int main()':
a.cc:60:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
60 | gets(incaa);
| ^~~~
| getw
|
s858796696 | p04019 | C++ | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");} | a.cc:1:1: error: 's' does not name a type
1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t);i++){q=t[i];if(q==78)n=1;if(q==83)s=1;if(q==69)e=1;if(q==87)w=1;}puts(abs(n-s)+abs(w-e)?"No":"Yes");}
| ^
a.cc:1:3: error: 'n' does not name a type
1 | s;n;e;w;i;main(q){char t[1000];for(gets(t);i<strlen(t... |
s106190538 | p04019 | C | #include<iostream>
using namespace std;
typedef long long li;
#define yn(i) print((i)?"Yes":"No")
#define binom2(n) ((n)*(n-1)/2)
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { c... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s002333479 | p04019 | Java | import java.util.*; import java.io.*; import java.math.*;
public class Main{
//Don't have to see. start------------------------------------------
static class InputIterator{
ArrayList<String> inputLine = new ArrayList<String>(1024);
int index = 0; int max; String read;
InputIterator(){
BufferedReader br = ne... | Main.java:74: error: cannot find symbol
if((input.contains("N") && !input.contains("S")) ||
^
symbol: variable input
location: class Main
Main.java:74: error: cannot find symbol
if((input.contains("N") && !input.contains("S")) ||
^
symbol: variable input
location: c... |
s195441356 | p04019 | C++ | #include <bits/stdc++.h>
#define f(i,j,k) for(int i=j;i<k;i++)
using namespace std;
int main(){
string s;
cin>>s;
long long n=0,ss=0,w=0,e=0;
f(i,0,s.size()){
if(s[i]=='N'){
n++;
}
else if(s[i]=='S'){
ss++;
}
else if(s[i]=='W'){
... | a.cc: In function 'int main()':
a.cc:22:22: error: lvalue required as left operand of assignment
22 | if(n>0&&ss>0&&w=0&&e=0){
| ~^~~
a.cc:25:16: error: lvalue required as left operand of assignment
25 | else if(n=0&&ss=0&&w>0&&e>0){
| ~^~~~
|
s373326919 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int ... | a.cc: In function 'int main()':
a.cc:74:29: error: expected ')' before '{' token
74 | if( s.at(i) == a.at(j){
| ~ ^
| )
a.cc:77:5: error: expected primary-expression before '}' token
77 | }
| ^
|
s090686083 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int ... | a.cc: In function 'int main()':
a.cc:74:29: error: expected ')' before '{' token
74 | if( s.at(i) == a.at(j){
| ~ ^
| )
a.cc:77:5: error: expected primary-expression before '}' token
77 | }
| ^
|
s757149727 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
int main(){
string s;
cin >> s;
int n=0,w=0,s=0,e=0;
rep(i,s.size()){
if(s[i]=='n') n++;
else if(s[i]=='w') w++;
else if(s[i]=='s') s++;
else e++;
}
strin... | a.cc: In function 'int main()':
a.cc:10:17: error: conflicting declaration 'int s'
10 | int n=0,w=0,s=0,e=0;
| ^
a.cc:8:12: note: previous declaration as 'std::string s'
8 | string s;
| ^
a.cc:14:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissiv... |
s244455185 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
int main(){
string s;
cin >> s;
int n=0,w=0,s=0,e=0;
rep(i,s.size()){
if(s[i]=='n') n++;
else if(s[i]=='w') w++;
else if(s[o]=='s') s++;
else e++;
}
strin... | a.cc: In function 'int main()':
a.cc:10:17: error: conflicting declaration 'int s'
10 | int n=0,w=0,s=0,e=0;
| ^
a.cc:8:12: note: previous declaration as 'std::string s'
8 | string s;
| ^
a.cc:14:19: error: 'o' was not declared in this scope
14 | else if(... |
s978053917 | p04019 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
string q;
... | a.cc: In function 'int main()':
a.cc:14:10: error: conflicting declaration 'bool n'
14 | bool n=false,e=false,w=false,s=false;
| ^
a.cc:13:9: note: previous declaration as 'int n'
13 | int n=q.size();
| ^
|
s149364793 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const st... | a.cc: In function 'int main()':
a.cc:126:16: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
126 | ++cnt[c];
| ^
|
s454848884 | p04019 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;
int main() {
string s;
cin >> s;
bool n, w, s, e;
n = false, w = false, s = false, e = false;
int n = s.size();
rep(i, n){
if(s[i] == 'N')n=true;
if(s[i] == ... | a.cc: In function 'int main()':
a.cc:10:14: error: conflicting declaration 'bool s'
10 | bool n, w, s, e;
| ^
a.cc:8:10: note: previous declaration as 'std::string s'
8 | string s;
| ^
a.cc:12:7: error: conflicting declaration 'int n'
12 | int n = s.size();
| ... |
s126876991 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
k=s.size();
int cnt_x=0;
int cnt_y=0;
for(int i=0;i<k;i++){
if(s[i]=='W'){cnt_x--;}
if(s[i]=='E'){cnt_x++;} if(s[i]=='N'){cnt_y++;} if(s[i]=='S'){cnt_y--;}
}
if(cnt_x==0 && cnt_y==0)cout << "Yes"<<endl;
else cout <<"No"<<... | a.cc: In function 'int main()':
a.cc:6:3: error: 'k' was not declared in this scope
6 | k=s.size();
| ^
|
s107303953 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
/*
Chào cô gái, có ph?i em tên t? t? không, mà sao lúc sub bài này anh toàn nghi d?n em th?
Miku is waving, start shaking >:(
*/
typedef long long ll ;
const ll mk = 100055;
const ll logn = 29;
const ll mod = 1e9 + 7;
#define endl "\n"
#define IOS ios::sync_with_s... | a.cc:126:1: error: '::main' must return 'int'
126 | ll main()
| ^~
|
s310060194 | p04019 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
strng s;
cin >> s;
bool flag1=true;
bool flag2=true;
rep(i,s.size()){
if(s.at(i)=='N')flag1=false;
if(s.at(i)=='W')flag2=false;
}... | a.cc: In function 'int main()':
a.cc:9:5: error: 'strng' was not declared in this scope
9 | strng s;
| ^~~~~
a.cc:10:12: error: 's' was not declared in this scope
10 | cin >> s;
| ^
|
s386963646 | p04019 | C++ | #include <iostream>
using namespace std;
string S;
int N;
int So;
int E;
int W;
int main(){
cin >> S;
for(int i = 0; i < sizeof(S); i++){
if(S[i] == "N") N++;
if(S[i] == "S") So++;
if(S[i] == "E") E++;
if(S[i] == "W") W++;
}
if(N == So && W == E){
cout << "Yes";
}
else{
cout << "No... | a.cc: In function 'int main()':
a.cc:13:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if(S[i] == "N") N++;
a.cc:14:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(S[i] == "S") So++;
a.cc:15:13: error: ISO C++ forbids comparis... |
s106372421 | 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 cnt_N =0;
int cnt_S =0;
int cnt_E =0;
int cnt_W =0;
for(int i=0; i<S.length(); i++){
if(S.charAt(i)=='N')cnt_N++;
else if(S.char... | Main.java:18: error: bad operand types for binary operator '&&'
if(cnt_N = cnt_S && cnt_E = cnt_W){
^
first type: int
second type: int
Main.java:18: error: incompatible types: int cannot be converted to boolean
if(cnt_N = cnt_S && cnt_E = cnt_W){
^
2 errors
|
s674759081 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
int A=0,B=0,C=0,D=0;
for(int i=0;i<N;i++){
if(S.at(i)=='N'){
A++;
}
else if(S.at(i)=='W'){
B++;
}
else if(S.at(i)=='S'){
C++;
}
else{
D++;
}
}
if(A==B && B==C){
cout << ... | a.cc: In function 'int main()':
a.cc:8:17: error: 'N' was not declared in this scope
8 | for(int i=0;i<N;i++){
| ^
|
s897856520 | p04019 | C++ | #include <iostream>
using namespace std;
int main(void){
string S;
cin >> S;
int n = 0,s = 0,w = 0;e = 0;
for(int i = 0;i < t.size();i++){
swich(S[i]){
case 'N':
n++;
break;
case 'S':
s++;
break;
case 'W':
... | a.cc: In function 'int main()':
a.cc:6:26: error: 'e' was not declared in this scope
6 | int n = 0,s = 0,w = 0;e = 0;
| ^
a.cc:7:22: error: 't' was not declared in this scope
7 | for(int i = 0;i < t.size();i++){
| ^
a.cc:8:8: error: 'swich' was not... |
s407836160 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;cin>>S;
int n[]={0,0,0,0};
map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
for(auto c:S) n[mp[c]]=1;
if(n[0]^n[1] || n[2]^n[3]) cout<<"No"<<endl;
else cout<<"Yes"<<endl;
} | a.cc: In function 'int main()':
a.cc:6:22: error: expected identifier before 'N'
6 | map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
| ^~~
a.cc:6:25: error: expected ']' before ',' token
6 | map<char,int> mp={['N',0],['S',1],['E',2],['W',3]};
| ^
... |
s653376948 | p04019 | C++ | #include <bits/stdc++.h>
#define rep(X,N) for(ll X = 0LL; X < (N); X++)
#define PI (acos(-1.0))
#define MODN 1000000007
#define MODN2 998244353
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)
using namespace std;
typedef long long ll;
int main(){
string s;
cin >> ... | a.cc: In function 'int main()':
a.cc:21:9: error: conflicting declaration 'int s'
21 | int s = 0;
| ^
a.cc:16:12: note: previous declaration as 'std::string s'
16 | string s;
| ^
a.cc:32:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
32 | ... |
s283670352 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
map<char,bool>Map;
for (char c : a) {
Map[c] = true;
}
if ((Map['N'] == Map['S']) && (Map['E'] == Map['W'])) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:23: error: 'a' was not declared in this scope
7 | for (char c : a) {
| ^
|
s552010582 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cout<<setprecision(32);
string s;
cin>>s;
map<char, int> mp;
for(auto ch : s){
mp[ch]++;
}
if(mp['N'] > 0 && ... | a.cc: In function 'int main()':
a.cc:24:31: error: expected ';' before 'return'
24 | else cout<<"Yes"<<'\n'
| ^
| ;
25 |
26 | return 0;
| ~~~~~~
|
s753400588 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
string S;
cin >> S;
bool N = false;
bool W = false;
bool S = false;
bool E = false;
for (int i = 0; i < S.size(); i++) {
if (S[i] == 'N') {
N = true;
}
if (S[i]... | a.cc: In function 'int main()':
a.cc:11:8: error: conflicting declaration 'bool S'
11 | bool S = false;
| ^
a.cc:7:10: note: previous declaration as 'std::string S'
7 | string S;
| ^
a.cc:28:11: error: no match for 'operator&&' (operand types are 'bool' and 'std::string' {aka 'std... |
s904009382 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int ,int > pii;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll maxn = 3e6;
const ll mod =1e9+7;
const ld PI = acos((ld)-1);
#define pb push_back
#define endl '\n'
#define dokme(... | a.cc: In function 'int main()':
a.cc:30:23: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
30 | for(int i = 0 ; i < t ; i ++){
| ~ ^ ~
| | |
| int std::string {aka... |
s450574730 | p04019 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char[] ch=sc.next().toCharArray();
int[] nums=new int[4];
for(int i=0;i<ch.length;i++){
switch(ch[i]){
case 'N':
nums[0]++;
break;
case 'W':
... | Main.java:23: error: ')' expected
if(((nums[0]>0&&nums[2]>0)||(nums[0]==0&&nums[2]==0))&&((nums[1]>0&&nums[3]>0)||(nums[1]==0&&nums[3]==0)){
^
1 error
|
s021304953 | p04019 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char[] ch=sc.next().toCharArray();
int[] nums=new int[4];
for(int i=0;i<ch.length;i++){
switch(ch[i]){
case 'N':
nums[0]++;
break;
case 'W':
... | Main.java:24: error: not a statement
System.out,println("Yes");
^
Main.java:24: error: ';' expected
System.out,println("Yes");
^
2 errors
|
s469019330 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
vector<bool>vec(4);
int s=S.size();
for(int i=0; i<s; i++){
if(S.at(i)=="N"){
vec.at(0)=true;
}
else if(S.at(i)=="W"){
vec.at(1)=true;
}
else if(S.at(i)=="S"){
vec.at(2)=true;
}
else if(S.at(i)=="E"){
vec.at(3)=true;
}
}
if(vec.at(0)==true... | a.cc: In function 'int main()':
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(S.at(i)=="N"){
| ~~~~~~~^~~~~
a.cc:12:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | else if(S.at(i)=="W"){
| ~~~~~~~^~~~~
a... |
s096111558 | p04019 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
int N , W , S , E;
int main() {
string S;
cin >> S;
int T = S.size();
for(int i = 0; i < T; i++){
if(S.at(i) == 'N'){
N++;
}
if(S.at(i) == 'W'){
... | a.cc: In function 'int main()':
a.cc:18:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
18 | S++;
| ~^~
a.cc:24:19: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
24 | if(N > 0 && S > 0... |
s847384291 | p04019 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define ll ... | a.cc: In function 'int main()':
a.cc:52:10: error: request for member 'at' in 'S', which is of non-class type 'int'
52 | if(S.at(i)=='N') N++;
| ^~
a.cc:53:10: error: request for member 'at' in 'S', which is of non-class type 'int'
53 | if(S.at(i)=='W') W++;
| ^~
a.cc:54:10: ... |
s024111098 | p04019 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define ll ... | a.cc: In function 'int main()':
a.cc:49:15: error: conflicting declaration 'int S'
49 | int N=0,W=0,S=0,E=0;
| ^
a.cc:47:10: note: previous declaration as 'std::string S'
47 | string S;
| ^
a.cc:54:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
5... |
s445914047 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int a=s.size();
int n=0;
int s=0;
int w=0;
int e=0;
for(int i=0;i<a;i++){
if(s.at(i)=='N'){
n++;
}else if(s.at(i)=='S'){
s++;
}else if(s.at(i)=='E'){
e++;
}else if(s.at(i)=='W'){
w++;
}
}
if((n==0&&s!=0)||(n!... | a.cc: In function 'int main()':
a.cc:10:13: error: conflicting declaration 'int s'
10 | int s=0;
| ^
a.cc:6:16: note: previous declaration as 'std::string s'
6 | string s;
| ^
a.cc:17:26: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
... |
s723847429 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>>s;
bool n,w,s,e;
n=false;
w=false;
s=false;
e=false;
for(int i=0;i<s.size();i++){
if(s[i]=='N') n=true;
else if(s[i]=='W') w=true;
else if(s[i]=='S') s=true;
else e=true;
}
if((s && n) && (w && e)) cout<<"Yes"... | a.cc: In function 'int main()':
a.cc:7:12: error: conflicting declaration 'bool s'
7 | bool n,w,s,e;
| ^
a.cc:5:10: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:18:9: error: no match for 'operator&&' (operand types are 'std::string' {aka 'std::__cxx11:... |
s533481060 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int ctoi(const char c) {
if ('0' <= c && c <= '9') return (c - '0');
return -1;
}
vector<int> input(int n) {
vector<int> vec(n);
for (int i = 0; i < n; i++) {
cin >> vec.at(i);
}
return vec... | a.cc: In function 'int main()':
a.cc:89:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
89 | if(x[i]=="E"){
a.cc:92:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
92 | if(x[i]=="N"){
a.cc:95:12: error: ISO C++ forbids comparison between po... |
s770417866 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
int N=0, S=0, E=0, W=0;
for(int i=0; i<S.size(); i++){
if(S.at(i)=='N'){
N=1;
}
if(S.at(i)=='S'){
S=1;
}
if(S.at(i)=='E'){
E=1;
}
if(S.at(i)=='W'){
W=1;
}
}
if(N!=S || E!=W){... | a.cc: In function 'int main()':
a.cc:7:12: error: conflicting declaration 'int S'
7 | int N=0, S=0, E=0, W=0;
| ^
a.cc:5:10: note: previous declaration as 'std::string S'
5 | string S;
| ^
a.cc:22:7: error: no match for 'operator!=' (operand types are 'int' and 'std::string' ... |
s308096800 | p04019 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
int main(){
string a;
cin >> a;
int n = 0,w = 0;s = 0;e = 0;
rep(i,a.size()){
if(a[i] == 'N')n++;
else if(a[i] == 'W')w++;
else if(a[i] == '... | a.cc: In function 'int main()':
a.cc:10:21: error: 's' was not declared in this scope
10 | int n = 0,w = 0;s = 0;e = 0;
| ^
a.cc:10:27: error: 'e' was not declared in this scope
10 | int n = 0,w = 0;s = 0;e = 0;
| ^
|
s012463077 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
int main()
{
str... | a.cc: In function 'int main()':
a.cc:20:19: error: expected primary-expression before '^' token
20 | if (mp['N']==0 ^^ mp['S']==0) ans = "No";
| ^
a.cc:21:19: error: expected primary-expression before '^' token
21 | if (mp['E']==0 ^^ mp['W']==0) ans = "No";
| ^
|
s138264354 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<llll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqr... | a.cc:8:16: error: 'llll' was not declared in this scope
8 | typedef vector<llll> vl;
| ^~~~
a.cc:8:20: error: template argument 1 is invalid
8 | typedef vector<llll> vl;
| ^
a.cc:8:20: error: template argument 2 is invalid
|
s557562838 | p04019 | C++ | /*
Author : N_o_o_B
Created : April 22 2020 22:57:50
*/
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef... | a.cc: In function 'int main()':
a.cc:99:10: error: redeclaration of 'bool ok'
99 | bool ok = !(cnt[0]^cnt[1]);
| ^~
a.cc:89:10: note: 'bool ok' previously declared here
89 | bool ok = 1;
| ^~
|
s028141260 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> t = {"NS", "WE", "NEWS"};
for (int i = 0; i < 3; i++) {
sort(all(t[i]));
}
string s;
cin >> s;
sort(all(s));
s.erase(unique(s.begin(), s.end()), s.end());
if (find(all(t), s) == t.end()) {
cout <<... | a.cc: In function 'int main()':
a.cc:8:14: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
8 | sort(all(t[i]));
| ^~~
| std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
from /u... |
s253907597 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool S= false;
bool W= false;
bool N= false;
bool E= false;
int l = s.size();
for(int i = 0;i < l;i++){
switch (s[i]) {
case 'S' :
S = true;
break;
case 'W' :
W = true;
break;
case 'N' :
N = true;
break;
default :
E... | a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s516302327 | p04019 | C++ | #include <string>
#include <iostream>
using namespace std;
int main(){
string s; cin >> s;
int x=0,y=0;
for(int i=0;i<s.length();i++){
if(s[i]=='N') y++;
if(s[i]=='S') y--;
if(s[i]=='W') s--;
if(s[i]=='E') s++;
}
string ans;
if(x==0 and y==0) ans="Yes";
else ans="No";
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:19: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
10 | if(s[i]=='W') s--;
| ~^~
a.cc:11:19: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
11 | if(s[i]=='E') s++;
| ~^~
|
s448117932 | p04019 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void){
char s[1005];
scanf("%s",s);
int n=0,w=0,e=0,s=0;
for(int i=0;s[i]!='\0';i++){
if(s[i]=='s'){s++;}
if(s[i]=='n'){n++;}
if(s[i]=='w'){w++;}
if(s[i]=='e'){e++;}
}
if(s==0&&n!=0||s!=0&&n==0){printf("No");}
else if(w==0&&e!=0||w!=0... | main.c: In function 'main':
main.c:8:17: error: conflicting types for 's'; have 'int'
8 | int n=0,w=0,e=0,s=0;
| ^
main.c:6:6: note: previous declaration of 's' with type 'char[1005]'
6 | char s[1005];
| ^
|
s387601287 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a,b,c,d;
a = 0;
b = 0;
c = 0;
d = 0;
vector<char> a(S.size());
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'N') {
a++;
}
else if (S.at(i) == 'W') {
b++;
}
else if (S.at(i) == 'S'... | a.cc: In function 'int main()':
a.cc:12:16: error: conflicting declaration 'std::vector<char> a'
12 | vector<char> a(S.size());
| ^
a.cc:7:7: note: previous declaration as 'int a'
7 | int a,b,c,d;
| ^
|
s359695976 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin S;
int a,b,c,d;
a = 0;
b = 0;
c = 0;
d = 0;
vector<char> a(S.size());
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'N') {
a++;
}
else if (S.at(i) == 'W') {
b++;
}
else if (S.at(i) == 'S') ... | a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'S'
6 | cin S;
| ^ ~
| ;
a.cc:12:16: error: conflicting declaration 'std::vector<char> a'
12 | vector<char> a(S.size());
| ^
a.cc:7:7: note: previous declaration as 'int a'
7 | int a,b,c,d;
... |
s192036510 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a,b,c,d;
int a = b - c = d =0;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'N') {
a++;
}
else if (S.at(i) == 'W') {
b++;
}
else if (S.at(i) == 'S') {
c++;
}
else {
d+... | a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int a'
8 | int a = b - c = d =0;
| ^
a.cc:7:7: note: 'int a' previously declared here
7 | int a,b,c,d;
| ^
a.cc:8:13: error: lvalue required as left operand of assignment
8 | int a = b - c = d =0;
| ... |
s955258522 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a = b = c = d = 0;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == 'N') {
a++;
}
else if (S.at(i) == 'W') {
b++;
}
else if (S.at(i) == 'S') {
c++;
}
else {
d++;
}
}
... | a.cc: In function 'int main()':
a.cc:7:11: error: 'b' was not declared in this scope
7 | int a = b = c = d = 0;
| ^
a.cc:7:15: error: 'c' was not declared in this scope
7 | int a = b = c = d = 0;
| ^
a.cc:7:19: error: 'd' was not declared in this scope
7 | int a = b... |
s344636961 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
string T;
cin >> T;
int n, s, e, w = 0;
for (int i = 0; i < S.size(); i++) {
if (T.at(i) == 'N') {
n++;
}
if (T.at(i) == 'S') {
s++;
}
if (T.at(i) == 'E') {
e++;
}
if (T.at(i) == 'W') {
w++;
}
... | a.cc: In function 'int main()':
a.cc:9:23: error: 'S' was not declared in this scope
9 | for (int i = 0; i < S.size(); i++) {
| ^
|
s329136047 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
string T;
cin >> T;
int n, s, e, w = 0;
for (int i = 0; i < S.size(); i++) {
if (T.at(i) == "N") {
n++;
}
if (T.at(i) == "S") {
s++;
}
if (T.at(i) == "E") {
e++;
}
if (T.at(i) == "W") {
w++;
}
... | a.cc: In function 'int main()':
a.cc:9:23: error: 'S' was not declared in this scope
9 | for (int i = 0; i < S.size(); i++) {
| ^
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (T.at(i) == "N") {
| ~~~~~~~~^~~~~~
a.... |
s160137574 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int n, s, e, w = 0;
for (int i = 0; i < S.size(); i++) {
if (S.at(i) == "N") {
n++;
}
if (S.at(i) == "S") {
s++;
}
if (S.at(i) == "E") {
e++;
}
if (S.at(i) == "W") {
w++;
}
... | a.cc: In function 'int main()':
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if (S.at(i) == "N") {
| ~~~~~~~~^~~~~~
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if (S.at(i) == "S") {
| ... |
s818234276 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a = S.size();
int TZ = 0;
int NB = 0;
int a, b, c, d;
for(int i = 0; i < a; i++){
char H = S[i];
if(S[i] == 'N') a++;
else if(S[i] == 'S') b--;
else if (S[i] == 'W') c++;
else d--;
}
if(a > 0 && b > ... | a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int a'
10 | int a, b, c, d;
| ^
a.cc:7:7: note: 'int a' previously declared here
7 | int a = S.size();
| ^
|
s527143775 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a = S.size();
int TZ = 0;
int NB = 0;
int a, b, c, d;
for(int i = 0; i < a; i++){
char H = S[i];
if(S[i] == 'N') a++;
else if(S[i] == 'S') b--;
else if (S[i] == 'W') c++;
else d--;
}
if(a > 0 && b > ... | a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int a'
10 | int a, b, c, d;
| ^
a.cc:7:7: note: 'int a' previously declared here
7 | int a = S.size();
| ^
a.cc:19:39: error: expected primary-expression before ')' token
19 | if(a > 0 && b > 0 && c > 0 && d > 0;... |
s092452633 | p04019 | C++ |
int main() {
string S;
cin >> S;
int a = S.size();
int TZ = 0;
int NB = 0;
for(int i = 0; i < a; i++){
char H = S[i];
if(S[i] == 'N') NB++;
else if(S[i] == 'S') NB--;
else if (S[i] == 'W') TZ++;
else TZ--;
}
if(TZ == 0 && NB == 0){
cout << "Yes" << endl;
}
else cout << "No" <... | a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
3 | string S;
| ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin >> S;
| ^~~
a.cc:4:10: error: 'S' was not declared in this scope
4 | cin >> S;
| ^
a.cc:17:5: err... |
s133250597 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int a = S.size();
int TZ = 0;
int NB = 0;
for(int i = 0; i < a; i++){
if(S[i] == N) NB++;
else if(S[i] == S) NB--;
else if (S[i] == W) TZ++;
else TZ--;
}
if(TZ == 0 && NB == 0){
cout << "Yes" << endl;
... | a.cc: In function 'int main()':
a.cc:11:15: error: 'N' was not declared in this scope
11 | if(S[i] == N) NB++;
| ^
a.cc:12:18: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::string' {aka 'std::__cxx... |
s820112527 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:382:6: error: expected unqualified-id before numeric constant
382 | fo(1,s.size()){
| ^
a.cc:5:25: note: in definition of macro 'fo'
5 | #define fo(a,b) for(int a=0;a<b;a++)
| ^
a.cc:382:6: error: expected ';' before numeric constant
... |
s829430013 | p04019 | C++ | #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
using P=pair<int,int>;
typedef unsigned long long ull;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if ... | a.cc: In function 'int main()':
a.cc:21:11: error: conflicting declaration 'int s'
21 | int n=0,s=0,e=0,w=0;
| ^
a.cc:19:10: note: previous declaration as 'std::string s'
19 | string s;
| ^
a.cc:24:19: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
24 | ... |
s978453388 | p04019 | C++ | #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
using P=pair<int,int>;
typedef unsigned long long ull;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if ... | a.cc: In function 'int main()':
a.cc:21:11: error: conflicting declaration 'int s'
21 | int n=0,s=0,e=0,w=0
| ^
a.cc:19:10: note: previous declaration as 'std::string s'
19 | string s;
| ^
a.cc:2:17: error: expected ',' or ';' before 'for'
2 | #define rep(i,n)for(long long i... |
s462206414 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define For(i, a, b) for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n) For(i, 0, n)
#define debug(x) cerr << #x << " = " << (x) << endl;
#define leftunique(a) {sort((a).begin(),(a).end());(a).erase(unique((a).begin(),(a).end()),(a).end());}
... | a.cc:13:9: warning: "leftunique" redefined
13 | #define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
| ^~~~~~~~~~
a.cc:8:9: note: this is the location of the previous definition
8 | #define leftunique(a) {sort((a).begin(),(a).end());(a).erase(unique((a).begin(),(a).en... |
s572507480 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
char s[1010];
int n,v1,v2,v3,v4;
int main()
{
gets(s);
n=strlen(s);
for(int i=0;i<n;i++)
{
if(s[i]=='N')v1=1;
if(s[i]=='W')v2=1;
if(s[i]=='S')v3=1;
if(s[i]=='E')v4=1;
}
if((v1^v3)||(v2^v3))
printf("No");
else printf("Yes");
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s193597978 | p04019 | C++ | s = gets.chomp
news = s.split('').uniq()
ans = 'No'
if news.length() == 4 && (news.include?('S') && news.include?('N') && news.include?('W') && news.include?('E'))
ans = 'Yes'
elsif news.length() == 2 && ((news.include?('S') && news.include?('N')) || (news.include?('W') && news.include?('E')))
ans = "Yes"
end
puts... | a.cc:2:16: error: empty character constant
2 | news = s.split('').uniq()
| ^~
a.cc:3:7: warning: multi-character character constant [-Wmultichar]
3 | ans = 'No'
| ^~~~
a.cc:5:9: warning: multi-character character constant [-Wmultichar]
5 | ans = 'Yes'
| ^~~~~... |
s068602755 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
bool N=0,S=0,E=0,W=0;
string S;
cin >> S;
for(int i=0;i<S.size();i++)
{
char b=S.at(i);
if(b=='N')N=1;
else if(b=='S')S=1;
else if(b=='E')E=1;
else if(b=='W')W=1;
}
if(N==S&&E==W)cout << "Yes" << endl;
else{
cout << "No" <... | a.cc: In function 'int main()':
a.cc:6:10: error: conflicting declaration 'std::string S'
6 | string S;
| ^
a.cc:5:12: note: previous declaration as 'bool S'
5 | bool N=0,S=0,E=0,W=0;
| ^
a.cc:8:19: error: request for member 'size' in 'S', which is of non-class type 'bool'
... |
s639417464 | p04019 | C++ | #include <iostream>
//#include <iomanip>
#include <string>
//#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <bitset>
//#include <math.h>
using namespace std ;
//using ll = long long ;
//using ld = long double ;
//using vll = vector<ll> ;
//u... | a.cc: In function 'int main()':
a.cc:37:16: error: conflicting declaration 'std::string s'
37 | string s ; cin >> s ;
| ^
a.cc:35:16: note: previous declaration as 'bool s'
35 | bool n,s,e,w ;
| ^
a.cc:38:25: error: request for member 'size' in 's', which ... |
s030748043 | p04019 | Java | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
// 入力
Scanner sc = new Scanner(System.in);
String s = sc.next();
// 主処理
boolean ns = true;
if (0 <= s.indexOf("N") || 0 <= s.indexOf("S")) {
ns = (0 <= s.indexOf("N"... | Main.java:26: error: class, interface, enum, or record expected
}import java.util.Scanner;
^
1 error
|
s514089900 | p04019 | C++ | #include <bits/stdc++.h>
using namespace std;
using lint = long;
using ll = long long;
#define rep(i,n) for(lint (i) = 0;(i) < (lint)(n);(i)++)
#define repInRange(i,start,end) for(lint (i) = (start);(i) < (end);++(i))
using pl = pair<lint,lint>;
using Vecint = vector<lint>;
using Llist = list<lint>;
ll pow(ll k,ll l) ... | a.cc: In function 'void Main()':
a.cc:33:24: error: expected '(' before 's'
33 | switch s[i] {
| ^
| (
a.cc:48:23: error: expression cannot be used as a function
48 | if (!((c.first())&(c.second()))) {
| ~~~~~~~... |
s916526163 | p04019 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int n,e,s,w;
char ch;
scanf("%c",&ch");
for(int i=1;i<=ch.size;i++)
{
if(ch[i]='W')
{
w++;
}
if(ch[i]='N')
{
n++;
}
if(ch[i]='E')
... | a.cc:9:19: warning: missing terminating " character
9 | scanf("%c",&ch");
| ^
a.cc:9:19: error: missing terminating " character
9 | scanf("%c",&ch");
| ^~~
a.cc: In function 'int main()':
a.cc:9:19: error: expected ')' before 'for'
9 | scanf("%c",&... |
s772886161 | p04019 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int n,e,s,w;
char ch;
scanf("%c,&ch");
for(int i=1;i<=ch.size;i++)
{
if(ch[i]='W')
{
w++;
}
if(ch[i]='N')
{
n++;
}
if(ch[i]='E')
... | a.cc: In function 'int main()':
a.cc:10:23: error: request for member 'size' in 'ch', which is of non-class type 'char'
10 | for(int i=1;i<=ch.size;i++)
| ^~~~
a.cc:12:14: error: invalid types 'char[int]' for array subscript
12 | if(ch[i]='W')
| ^
a.cc:16... |
s406200411 | p04019 | C++ | var w,n,e,s:longint;
x:char;
begin
while not eoln do
begin
read(x);
case x of
'W':w:=1;
'N':n:=1;
'E':e:=1;
'S':s:=1;
end;
end;
if (w=e) and (n=s) then
writeln('Yes')
else
writeln('No');
end. | a.cc:15:13: warning: multi-character character constant [-Wmultichar]
15 | writeln('Yes')
| ^~~~~
a.cc:17:13: warning: multi-character character constant [-Wmultichar]
17 | writeln('No');
| ^~~~
a.cc:1:1: error: 'var' does not name a type
1 | var w,n,e,s:longint;
... |
s608452029 | p04019 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
int w,e,s,n;
cin>>s;
for(int i=0;i<s.size();i++)
{
if(s[i]=='W')w=1;
else if(s[i]=='E')e=1;
else if(s[i]=='S')s=1;
else n=1;
}
if(w==e&&n==s)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:17: error: conflicting declaration 'int s'
6 | int w,e,s,n;
| ^
a.cc:5:16: note: previous declaration as 'std::string s'
5 | string s;
| ^
a.cc:15:19: error: no match for 'operator==' (operand types are 'int' and '... |
s328483780 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.