submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s344714895
p03944
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int w = sc.nextInt(); // スペース区切りの整数の入力 int h = sc.nextInt(); int n = sc.nextInt(); // 文字列の入力 int x[] = new int[n]; int y[] = new int[n]; int a[] = new int[n]; int maxx = w...
Main.java:18: error: ';' expected for(int i=0; i++ i<n){ ^ Main.java:18: error: not a statement for(int i=0; i++ i<n){ ^ 2 errors
s650740599
p03944
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int W, H, N; cin >> W >> H >> N; vector<vector<int>> b(H, vector<int>(W, 0)); for (int i = 0; i < N; ++i) { int x, y, a; cin >> x >> y >> a; int x1 = 0; int y1 = 0; int x2 = W; int y2 = H; if (a == 1) { ...
a.cc: In function 'int main()': a.cc:33:53: error: no matching function for call to 'std::exception::exception(const char [6])' 33 | throw std::exception("oops!"); | ^ In file included from /usr/include/c++/14/exception:36, ...
s895003832
p03945
C++
#incldue<bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans=0; for(int i=0;i<s.size()-1;++i) { if(s.at(i)!=s.at(i+1)) ans++; } cout << ans; return 0;}
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include? 1 | #incldue<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:5:1: error: 'string' was not declared in this scope 5 | string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header...
s374094560
p03945
Java
mport java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner in = new Scanner(System.in)) { String S = in.next(); StringBuilder WB = new StringBuilder(); WB.append(S.charAt(0)); for (int i = 1; i < S.length(); i++) { ...
Main.java:1: error: class, interface, enum, or record expected mport java.util.Scanner; ^ 1 error
s890233353
p03945
C++
using namespace std; typedef long long ll; #define rep(k,i,n) for(ll i=k;i<n;++i) int main(void){ string s; cin>>s; ll n=s.length(); ll ans=0; rep(1,i,n)if(s[i]!=s[i-1])++ans; cout<<ans; }
a.cc: In function 'int main()': a.cc:5:5: error: 'string' was not declared in this scope 5 | string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:6:5: error: ...
s184089778
p03945
C++
#include <bits/stdc++.h> #include <algorithm> #include <vector> #include <iostream> using namespace std; int main() { //input string s; cin >> s; int n; n = s.size(); int counter = 0; //compute for(int i = 0;i < n; i++) { if(s.at[i] == s.at[i+1]){ counter += 1; } } /...
a.cc: In function 'int main()': a.cc:16:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 16 | if(s.at[i] == s.at[i+1]){ | ^ a.cc:16:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 16 | if(s.a...
s432485508
p03945
C++
#include <bits/stdc++.h> #include <algorithm> #include <vector> #include <iostream> using namespace std; int main() { //input string s; cin >> s; int n; n = s.size(); int counter = 0; //compute for(int i = 0;i < n; i++) { if(s.at[i] <= s.at[i+1]){ counter += 1; } } /...
a.cc: In function 'int main()': a.cc:16:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 16 | if(s.at[i] <= s.at[i+1]){ | ^ a.cc:16:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 16 | if(s.a...
s027421404
p03945
C++
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); srting s; cin>>s; int ans=0; for(int i=1;i<s.size();i++) { if(s[i]!-s[i-1]) { ans++; } } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'srting' was not declared in this scope 8 | srting s; | ^~~~~~ a.cc:9:10: error: 's' was not declared in this scope 9 | cin>>s; | ^ a.cc:13:16: error: expected ')' before '!' token 13 | if(s[i]!-s[i-1]) | ...
s669545572
p03945
C++
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int n = s.size(); int cnt = 0; for(int i = 1; i < s; ++i) { if(s[i-1] != s[i]) cnt++; } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:20: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 11 | for(int i = 1; i < s; ++i) | ~ ^ ~ | | | | int std::string {aka std::__cxx11::...
s147960454
p03945
C++
#include <iosream> #include <string> using namespace std; int main() { string s; cin >> s; int n = s.size(); int cnt = 0; for(int i = 1; i < s; ++i) { if(s[i-1] != s[i]) cnt++; } cout << cnt << endl; return 0; }
a.cc:1:10: fatal error: iosream: No such file or directory 1 | #include <iosream> | ^~~~~~~~~ compilation terminated.
s767289157
p03945
C++
#include <iostream> using namespace std; int main() { string color=""; cin>>color; int x=0; for(int i=1;i<=color.length();i++){ if(color[i]==color[i-1]){ x=x+0 } else{ x=x+1; } } cout<<x; }
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before '}' token 10 | x=x+0 | ^ | ; 11 | } | ~
s862576871
p03945
C++
#include <iostream> using namespace std; int main() { string color=""; cin>>color; int x=0; for(int i=1;i<=color.length();i++){ if(color[i]==color[i-1]){ x=x+0 } else{ x=x+1 } } cout<<x; }
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before '}' token 10 | x=x+0 | ^ | ; 11 | } | ~ a.cc:13:30: error: expected ';' before '}' token 13 | ...
s343170638
p03945
Java
S = input() pre = "X" B, W = 0, 0 for s in S: if s != pre: if s == "B": B += 1 else: W += 1 pre = s if B == 0 or W == 0: print(0) elif B == W: print(B * 2 - 1) else: x, y = min(B, W), max(B, W) print(x * 2)
Main.java:1: error: class, interface, enum, or record expected S = input() ^ 1 error
s553619366
p03945
C++
#include <bits/stdd++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; int N = S.size(); for (int i = 0; i < N-1; i++) { if (S[i] != S[i+1]) ans++; } cout << ans << endl; }
a.cc:1:10: fatal error: bits/stdd++.h: No such file or directory 1 | #include <bits/stdd++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s032435651
p03945
Java
import java.util.Scanner; public class Saburo{ public static void main(String[]args){ Scanner sc=new Scanner(System.in); String v=sc.nextLine(); String s; int g=0; for(int index=0;index<v.length();index++){ if(v.charAt(index)!='W'&&v.charAt(index)!='B'){ g++; } } if(g!=...
Main.java:2: error: class Saburo is public, should be declared in a file named Saburo.java public class Saburo{ ^ 1 error
s745903244
p03945
C++
import numpy as np import sys def sinput(): return sys.stdin.readline() def iinput(): return int(sinput()) def imap(): return map(int, sinput().split()) def fmap(): return map(float, sinput().split()) def iarr(): return list(imap()) def farr(): return list(fmap()) def sarr(): return sinput().split() s = input() ans = ...
a.cc:1:1: error: 'import' does not name a type 1 | import numpy as np | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s690563789
p03945
C++
#include<iostream> #include<cmath> #include<numeric> #include<functional> #include<string> #include<algorithm> #include<vector> #include<map> #include<iomanip> #include<queue> #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<n;i++) #define ll long long #define INF 2147483647 using namespace std; us...
a.cc: In function 'int main()': a.cc:22:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lengh'; did you mean 'length'? 22 | for(int i=0;i<s.lengh()-1,i++){ | ^~~~~ | length a.cc:22:32: error: expected ';' before ')' token ...
s674769897
p03945
C++
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typedef pair<ll...
a.cc:18:24: error: 'a' does not name a type 18 | typedef long double ld;a | ^
s534669337
p03945
Java
import java.util.*; public class Stp { public static void main(String args[]) { Scanner sc=new Scanner(System.in); String s=""; if(sc.hasNext()) s=sc.next(); char []ch=s.toCharArray(); int c=0; for(int i=0; i<ch.length-1;i++) { if(ch[i] != ch[i+1]) c++; } System.out.println(...
Main.java:2: error: class Stp is public, should be declared in a file named Stp.java public class Stp ^ 1 error
s898309259
p03945
Java
import java.util.*; public class S { Scanner sc=new Scanner(System.in); String s=sc.next(); char []ch=s.toCharArray(); int c=0; for(int i=0; i<ch.length()-1;i++) { if(ch[i] != ch[i+1]) c++; } System.out.println(c); }
Main.java:8: error: illegal start of type for(int i=0; i<ch.length()-1;i++) ^ Main.java:8: error: > or ',' expected for(int i=0; i<ch.length()-1;i++) ^ Main.java:8: error: ';' expected for(int i=0; i<ch.length()-1;i++) ^ Main.java:8: error: <identifier...
s364896632
p03945
C
#include <stdio.h> #include <string.h> int main(void) { char s[100001]; scanf("%s", s); int count = 0; for (int i = 1; i < strlen(s); i++) { if (s[i] != s[i-1]) { count++; } } printf("%d\n", count);
main.c: In function 'main': main.c:14:3: error: expected declaration or statement at end of input 14 | printf("%d\n", count); | ^~~~~~
s723658204
p03945
C++
#include <bits/stdc++.h> #include <cstdlib> #include <cmath> #define rep(i,n) for (long long i=0; i < (n); ++i) #define rep2(i,n,m) for(long long i=n;i<=m;i++) using namespace std; using ll = long long; using P = pair<int,int>; const ll INF=1e18 ; inline void chmax(ll& a,ll b){a=max(a,b);} inline void chmin(ll& a,ll b)...
a.cc: In function 'int main()': a.cc:17:8: error: '\U0000ff4b' was not declared in this scope 17 | rep(i,k-1) { | ^~ a.cc:4:43: note: in definition of macro 'rep' 4 | #define rep(i,n) for (long long i=0; i < (n); ++i) | ^
s192192008
p03945
C++
#include <bits/stdc++.h> #include <cstdlib> #include <cmath> #define rep(i,n) for (long long i=0; i < (n); ++i) #define rep2(i,n,m) for(long long i=n;i<=m;i++) using namespace std; using ll = long long; using P = pair<int,int>; const ll INF=1e18 ; inline void chmax(ll& a,ll b){a=max(a,b);} inline void chmin(ll& a,ll b)...
a.cc: In function 'int main()': a.cc:17:8: error: 'n' was not declared in this scope 17 | rep(i,n-1) { | ^ a.cc:4:43: note: in definition of macro 'rep' 4 | #define rep(i,n) for (long long i=0; i < (n); ++i) | ^
s645303286
p03945
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<ll> 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="abcdefghijklmnopqrst...
a.cc: In function 'int main()': a.cc:21:8: error: 'a' was not declared in this scope 21 | if(a[i]!=a[i+1]){ | ^
s435213985
p03945
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<ll> 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="abcdefghijklmnopqrst...
a.cc: In function 'int main()': a.cc:21:8: error: 'a' was not declared in this scope 21 | if(a[i]!=a[i+1]){ | ^
s066871066
p03945
C++
S = input() before_stone = S[0] count = 0 for i in S[1:]: if i != before_stone: count += 1 before_stone = i print(count)
a.cc:1:1: error: 'S' does not name a type 1 | S = input() | ^
s404009421
p03945
C++
#include<iostream> #include<string> #include<vector> #include<iomanip> #include<algorithm> #include<queue> #include<stack> #include<list> #include<map> #include<deque> #include<math.h> using namespace std; #define ll long long int main(){ string S; cin >> string; N=S.size() ll i; ll cnt=0; for(i...
a.cc: In function 'int main()': a.cc:16:18: error: expected primary-expression before ';' token 16 | cin >> string; | ^ a.cc:17:5: error: 'N' was not declared in this scope 17 | N=S.size() | ^ a.cc:20:9: error: 'i' was not declared in this scope 20 | for(i=0;i<N-1;i...
s884115095
p03945
C++
#include <bits/stdc++.h> using namespace std; int main(){ int ans=0; string board; cin >> board; char piece=board[0]; for(int i=1;i<board.size();i++){ if(piece!=board[i]) { piece=board[i] ans++;} } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before 'ans' 12 | piece=board[i] | ^ | ; 13 | ans++;} | ~~~
s422040671
p03945
C++
#include <bits/stdc++.h> using namespace std; int main(){ int ans=0; string board; cin >> board; char piece=board[0]; for(int i=1;i<board.size();i++){ if(piece!=board[i]) { piece=board[i] ans++;} } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before 'ans' 12 | piece=board[i] | ^ | ; 13 | ans++;} | ~~~
s760014982
p03945
C++
#include <bits/stdc++.h> using namespace std; int main(){ int ans=0; string board; cin >> board; char piece=board[0]; for(int i=1;i<board.size();i++){ if(piece!=board[i]) { piece=board[i] ans++;} cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before 'ans' 12 | piece=board[i] | ^ | ; 13 | ans++;} | ~~~ a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:4:11: note: to match this '{'...
s936798599
p03945
C++
#include <bits/stdc++.h> using namespace std; int main(){ int ans=0; string board; cin >> board; char piece=board[0]; for(int i=1;i<board.size();i++){ if(piece!=board[i]) { piece=board[i] ans++;} cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before 'ans' 12 | piece=board[i] | ^ | ; 13 | ans++;} | ~~~ a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:4:11: note: to match this '{'...
s100703079
p03945
C++
#include<bits/stdc++.h> using namespace std; char hhj[100005],y; int count,wb; int main() { while(hhj[wb]=getchar(),hhj[wb]!='\n') { if(wb==0) y=hhj[wb]; if(hhj[wb]!=y) count++,y=hhj[wb]; wb++; } printf("%d\n",count); return 0; }
a.cc: In function 'int main()': a.cc:15:11: error: reference to 'count' is ambiguous 15 | count++,y=hhj[wb]; | ^~~~~ In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/includ...
s187048109
p03945
C++
#include<bits/stdc++.h> using namespace std; char hhj[100005],y; int count,wb; int main() { while(hhj[wb]=getchar(),hhj[wb]!='\n') { if(z==0) y=hhj[wb]; if(hhj[wb]!=y) count++,y=hhj[wb]; wb++; } printf("%d\n",count); return 0; }
a.cc: In function 'int main()': a.cc:12:12: error: 'z' was not declared in this scope 12 | if(z==0) | ^ a.cc:15:11: error: reference to 'count' is ambiguous 15 | count++,y=hhj[wb]; | ^~~~~ In file included from /usr/include/c++/14/algorithm:86, f...
s714287319
p03945
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ...
a.cc: In function 'int main()': a.cc:66:25: error: 'taget' was not declared in this scope; did you mean 'target'? 66 | taget = s[i]; | ^~~~~ | target
s790819567
p03945
C++
#include<bits/stdc++.h> string s; int cnt,l; int main(){ cin>>s; l=s.size(); for(int i=1;i<l;++i)cnt+=(s[i]!=s[i-1]); cout<<cnt<<endl; return 0; }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string s; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>s; | ^~~ | std::cin In file included from /usr/include...
s624591317
p03945
C++
#include<bits/stdc++.h> string srx[100001]; int cnt,l; int main(){ cin>>s; l=s.size(); for(int i=1;i<l;++i)cnt+=(s[i]!=s[i-1]); cout<<cnt<<endl; return 0; }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string srx[100001]; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>s; | ^~~ | std::cin In file included from /u...
s454794272
p03945
C++
#include <bits/stdc++.h> using namespace std; int main() { int S; cin >> S; int ans=0; for(int i = 0;i < S.size() - 1; i++){ ans+=(S.at(i) != S.at(i + 1)); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:23: error: request for member 'size' in 'S', which is of non-class type 'int' 7 | for(int i = 0;i < S.size() - 1; i++){ | ^~~~ a.cc:8:13: error: request for member 'at' in 'S', which is of non-class type 'int' 8 | ans+=(S.at(i) != S.at(i +...
s417258662
p03945
C++
#include <bits/stdc++.h> using namespace std; int main() { int S; cin >> S; int ans=0; for(int i = 0;i < S.size() - 1; i++){ ans+=(S[i] != S[i + 1]); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:23: error: request for member 'size' in 'S', which is of non-class type 'int' 7 | for(int i = 0;i < S.size() - 1; i++){ | ^~~~ a.cc:8:12: error: invalid types 'int[int]' for array subscript 8 | ans+=(S[i] != S[i + 1]); | ^...
s097323578
p03945
C++
#include <bits/stdc++.h> using namespace std; int main() { int S; cin >> S; int ans=0; for(int i = 0;i < S.size() - 1; i++){ ans+=(s[i] != s[i + 1]); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:23: error: request for member 'size' in 'S', which is of non-class type 'int' 7 | for(int i = 0;i < S.size() - 1; i++){ | ^~~~ a.cc:8:11: error: 's' was not declared in this scope 8 | ans+=(s[i] != s[i + 1]); | ^
s071588185
p03945
C++
#include <iostream> #include <cstdio> using namespace std; int main() { string a; int s=0; cin>>a; for(int i=1;i<s.size();i++) if(a[i]!=a[i-1]) s++; cout<<s<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:21: error: request for member 'size' in 's', which is of non-class type 'int' 9 | for(int i=1;i<s.size();i++) | ^~~~
s126554278
p03945
C++
#include<bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int l=S.length(), count=0; for(int i=0; i < l-1; i++) { if(s.at(i) != s.at(i+1)) count++; } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: 's' was not declared in this scope 8 | if(s.at(i) != s.at(i+1)) count++; | ^
s242705126
p03945
C++
#include<bits/stdc++.h> using namsespace std; int main() { string S; cin >> S; int l=S.length(), count=0; for(int i=0; i < l-1; i++) { if(s.at(i) != s.at(i+1)) count++; } cout << count << endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namsespace' 2 | using namsespace std; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:4:3: error: 'string' was not declared in this scope 4 | string S; | ^~~~~~ a.cc:4:3: note: suggested alternatives: In file included from /usr/incl...
s341962176
p03945
C++
#include<bits/stdc++.h> using namespace std; string jia(string a,string b) { int aa,bb; int alen=a.length(); int blen=b.length(); if(alen<blen) { swap(a,b); swap(alen,blen); } int bblen=blen; blen--; for(int i=alen-1; i>=1; i--) { if(blen>=0) { if(a[i]+b[blen]<106) { ...
a.cc: In function 'std::string jia(std::string, std::string)': a.cc:58:1: warning: no return statement in function returning non-void [-Wreturn-type] 58 | } | ^ a.cc: In function 'int main()': a.cc:66:19: error: request for member 'length' in 's', which is of non-class type 'int' 66 | for(int i=0;i<s.leng...
s100373692
p03945
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i=0;i<(n);i++) #define adrep(i,s,n) for (int i=(s);i<(n);i++) using namespace std; typedef long long ll; int main(){ int S; cin>>S; int count=0; int N=S.length()-1; rep(i,N){ if(S[i]!=S[i+1])count++; } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:14:11: error: request for member 'length' in 'S', which is of non-class type 'int' 14 | int N=S.length()-1; | ^~~~~~ a.cc:17:9: error: invalid types 'int[int]' for array subscript 17 | if(S[i]!=S[i+1])count++; | ^ a.cc:17:15: error: invalid ...
s023052117
p03945
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i=0;i<(n);i++) #define adrep(i,s,n) for (int i=(s);i<(n);i++) using namespace std; typedef long long ll; int main(){ int S; cin>>S; int count=0; rep(i,S.length()-1){ if(S[i]!=S[i+1])count++; } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:14:11: error: request for member 'length' in 'S', which is of non-class type 'int' 14 | rep(i,S.length()-1){ | ^~~~~~ a.cc:2:34: note: in definition of macro 'rep' 2 | #define rep(i,n) for (int i=0;i<(n);i++) | ^ a.cc:1...
s334253560
p03945
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; for (int i = 0; i < S.size() - 1; i++) { if (S[i] == S[i + 1]) { S = S.substr(0,i) + S.substr(i + 1,S.size() - 1 - i); i-- } } cout << S.size() - 1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: expected ';' before '}' token 9 | i-- | ^ | ; 10 | } | ~
s637039574
p03945
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; for (int i = 0; i < S.size() - 1; i++) { if (S[i] == S[i + 1]) S = S.substr(0,i) + S.substr(i + 1,S - 1 - i); } cout << S.size() - 1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:64: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 7 | if (S[i] == S[i + 1]) S = S.substr(0,i) + S.substr(i + 1,S - 1 - i); | ~ ^ ~ ...
s527395698
p03945
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(),v.end() #define _GLIBCXX_DEBUG #define str(n) to_string(n) #define int(w) stoi(w) #define len(l) l.size() #define append(l,i) l.push_back(i) int main() { string w; cin>>w; int ans=0;...
a.cc: In function 'int main()': a.cc:19:10: error: expected primary-expression before ')' token 19 | }) | ^
s751133347
p03945
C++
#include<bits/stdc++.h> using namespace std; int main() { int ret=0; string s; cin>>s; for(int i=1;i<s.size();++i) if(s[i]!=s[i-1]) ret++; cout<<r<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'r' was not declared in this scope 10 | cout<<r<<"\n"; | ^
s178961374
p03945
Java
let ans s = let n = String.length s in let rec f i c ret = if i = n then ret else if s.[i] = c then f (i+1) c ret else f (i+1) s.[i] (ret+1) in f 1 s.[0] 0;; Scanf.scanf "%s" (fun s -> print_int (ans s))
Main.java:1: error: class, interface, enum, or record expected let ans s = ^ Main.java:9: error: class, interface, enum, or record expected Scanf.scanf "%s" (fun s -> print_int (ans s)) ^ 2 errors
s776483581
p03945
C++
#include<bits/stdc++.h> string s; int ans; int main() { cin>>s; for(int i=1;i<s.size();i++) if(s[i]!=s[i-1]) ans++; printf("%d\n",ans); return 0; }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string s; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>s; | ^~~ | std::cin In file included from /usr/include...
s870766057
p03945
C++
#include<bits/stdc++.h> string s; int ans; int main() { cin>>s; for(i=1;i<s.size();i++) if(s[i]!=s[i-1]) ans++; printf("%d\n",ans); return 0; }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string s; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>s; | ^~~ | std::cin In file included from /usr/include...
s562492000
p03945
C++
#include <bits/stdc++.h> #define rep(i, n) for(ll i = 0; i < n; i++) #define repr(i, n) for(ll i = n; i >= 0; i--) #define inf LLONG_MAX #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; int main() { string s; cin >> s; if (s.size() ...
a.cc: In function 'int main()': a.cc:26:10: error: redeclaration of 'char cur' 26 | char cur = s[0]; | ^~~ a.cc:18:10: note: 'char cur' previously declared here 18 | char cur = s[0]; | ^~~
s124956754
p03945
C++
#include <bits/stdc++.h> using namespace std; int main(){ int ans=0; string s; char te; cin >> s; te=s.at(0); for(int i=1;i<s.size;i++){ if(te!=s.at(i)){ te=s.at(i); ans++; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:21: 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...
s619660814
p03945
C++
#include<bits/stdc++.h> #define watch(x) cout << (#x) << " is " << (x) << endl typedef long long ll; using namespace std; int static fast = [](){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); return 0; }(); // freopen("input.txt", "r", stdin); int main() { string s; cin >> s; char pre = s[i]; int...
a.cc: In function 'int main()': a.cc:14:22: error: 'i' was not declared in this scope 14 | char pre = s[i]; | ^
s505314660
p03945
C++
#include <iostream> #include <map> #include <vector> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <climits> #include <stack> #include <queue> #include <set> #include <cctype> #include <bitset> #include <type_traits> #include <list> using namespace std; #define REP(i, n) for (int...
a.cc: In function 'int main()': a.cc:35:25: error: expected '}' at end of input 35 | cout << ans << endl; | ^ a.cc:26:1: note: to match this '{' 26 | { | ^
s974663622
p03945
C++
S = input() ans = 0 coller = S[0] for s in S[1:]: if s != coller: ans += 1 coller = s print(ans)
a.cc:1:1: error: 'S' does not name a type 1 | S = input() | ^
s026673210
p03945
C++
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define repr(i, n) for (int i = (n); i >= 0; i--) #define ALL(v) v.begin(), v.end() #define MSG(a) cout << #a << " " << a << endl; #define REP(i, x, n) for (int i = x; i < n; i++) #define OP(m) cout << m << endl type...
a.cc: In function 'int main()': a.cc:10:25: error: expected primary-expression before '<<' token 10 | #define OP(m) cout << m << endl | ^~ a.cc:23:5: note: in expansion of macro 'OP' 23 | OP(); | ^~
s354888458
p03945
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S; if(S.size()==0){ cout<<0<<endl; }else{ int sum=0; int n=S.size(); for(int i=0;i<n-1;i++){ if((S.at(i)=='W'&&S.at(i+1)=='B')||(S.at(i)=='B'&&S.at(i+1)=='W')){ sum+; } } cout<<sum<<endl; } }
a.cc: In function 'int main()': a.cc:14:13: error: expected primary-expression before ';' token 14 | sum+; | ^
s475805058
p03945
Java
import java.util.Scanner; public class MainC { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); int ans = 0; for (int i = 1; i < s.length; i++) { if(s[i] != s[i-1]) ans++; } System.out.println(ans); sc.close(); } }
Main.java:3: error: class MainC is public, should be declared in a file named MainC.java public class MainC { ^ 1 error
s022168305
p03945
C++
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<iomanip> using namespace std; string s; int l,ans; int main() { l=strlen(s+1); for(int i=1;i<l;i++) { if(s[i]!=s[i-1]) ans++; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:19: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 12 | l=strlen(s+1); | ~^~ | | | | | int | std::string {a...
s091897908
p03945
C++
/*Function Template*/ #include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll,ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for(ll i = 0; i < (n); i++) #define Rep(i, n) for(ll i = 1; i < (n); i++) #define ALL(a) (a).begin(),(a).end() #define IOS ios::sy...
a.cc: In function 'int main()': a.cc:143:15: error: invalid initialization of reference of type 'std::vector<std::pair<char, long long int> >&' from expression of type 'std::vector<std::pair<long long int, long long int> >' 143 | runlength(s,p); | ^ a.cc:79:48: note: in passing argument 2 of 'vo...
s778544013
p03945
C++
s = gets.chop ans = 0 prev = s[0] 1.upto(s.length-1) do |i| ans += 1 unless s[i] == prev prev = s[i] end p ans
a.cc:1:1: error: 's' does not name a type 1 | s = gets.chop | ^
s315655524
p03945
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; int n=s.size(); int a=0; for(int i=0;i<n-1;i++){ if(s[i]!=s[i+1]){ a++ } } cout<<a<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:10: error: expected ';' before '}' token 13 | a++ | ^ | ; 14 | } | ~
s785956936
p03945
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; int n=s.size(); int a; for(int i=0;i<n-1;i++){ if(s[i]!=s[i+1]){ a++ } } cout<<a<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:10: error: expected ';' before '}' token 13 | a++ | ^ | ; 14 | } | ~
s216807182
p03945
C++
#include<bits/stdc++.h> using namespace std; #define ll long long int main() { string S; cin >> S; ll ans = 0; char c_before = S[0]; for (ll i = 1; i < N; ++i) if (c_before != S[i]) { ans++; c_before = S[i]; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:21: error: 'N' was not declared in this scope 10 | for (ll i = 1; i < N; ++i) | ^
s043625572
p03945
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { string t[a]; int s=0; gets(t); for(int i=1;t[i]!='\0';i++) if(t[i]!=t[i--])s++; cout<<s<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: 'a' was not declared in this scope 7 | string t[a]; | ^ a.cc:9:10: error: 't' was not declared in this scope 9 | gets(t); | ^ a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(...
s165708366
p03945
C++
#include<iostream> #include<cstdio> using namespace std; int a=100000; int main() { char t[a]; int s=0; gets(t) for(int i=1;t[i]!='\0';i++) if(t[i]!=t[i--])s++; cout<<s<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(t) | ^~~~ | getw a.cc:10:19: error: 'i' was not declared in this scope 10 | for(int i=1;t[i]!='\0';i++) | ^
s328159902
p03945
C++
#include<iostream> #include<cstdio> using namespace std; int a=100000; int main() { char t[a],s=0; gets(t) for(int i=1;t[i]!='\0';i++) if(t[i]!=t[i--])s++; cout<<s<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(t) | ^~~~ | getw a.cc:9:19: error: 'i' was not declared in this scope 9 | for(int i=1;t[i]!='\0';i++) | ^
s084357081
p03945
C++
#include<cstdio> using namespace std; int main() { char c,s; int ans=0; cin>>c; for(int i=0;i<100000;i++) { cin>>s; if(s!=c){ans++;c=s;} if(s==EOF)break; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin>>c; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<cstdio> +++ |+#include <iostream> 2 | using namespace st...
s083209269
p03945
C++
#include<iostream> #include<cstdio> using namespace std; int main() { char c,s; int ans=0; cin>>c; for(cin>>s) { if(s!=c)ans++; c=s; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: expected ';' before ')' token 9 | for(cin>>s) | ^ | ; a.cc:15:5: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:14:21: error: expected ')' before 'return' 14 | cout<...
s106595211
p03945
C++
#include<iostream> using namespace std; string s,k; int main() { cin>>s; for(int i=1;i<=s.size()-1;i++) { if(s[i]!=s[i-1]) k++; } cout<<k<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:2: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 10 | k++; | ~^~
s032892098
p03945
C++
#include<iostream> using namespace std; string s,k; int main() { cin>>s; for(int i=1;i<=s.size()-1;i++) { if(s[i]!=s[i-1] k++; } cout<<k<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: expected ';' before 'k' 9 | if(s[i]!=s[i-1] | ^ | ; 10 | k++; | ~ a.cc:11:1: error: expected primary-expression before '}' token 11 | } | ^ a.cc:10:5: error: expected ')' before '}' token ...
s990993040
p03945
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow...
a.cc: In function 'int main()': a.cc:84:18: error: no matching function for call to 'std::vector<int>::push_back(std::__cxx11::basic_string<char>)' 84 | v.push_back(s.substr(start,cnt+1)); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/vector:66, fro...
s736515497
p03945
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow...
a.cc: In function 'int main()': a.cc:76:20: error: expected unqualified-id before '=' token 76 | for(long long int=0;i<s.size();i++){ | ^ a.cc:76:20: error: expected ';' before '=' token 76 | for(long long int=0;i<s.size();i++){ | ^ | ...
s784485896
p03945
C++
#include<bits/stdc++.h> using namespace std; char x[100005],y; int g,z; int main() { while(x[z]=getchar(),x[z]!='\n') { if(z==0),y=x[z]; if(x[z]!=y)g++,y=x[z]; z++; } cout<<g; return 0; }
a.cc: In function 'int main()': a.cc:10:25: error: expected primary-expression before ',' token 10 | if(z==0),y=x[z]; | ^
s357920110
p03945
C++
#include <iostream> #include <vector> using namespace std; int main(){ vector <char> S; cin >> S; int change = 0; for(int i = 0; i < S.size()-1; i++){ if(S[i] != S[i+1]) change++; } cout << change; }
a.cc: In function 'int main()': a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char>') 8 | cin >> S; | ~~~ ^~ ~ | | | | | std::vector<char> | std::istream {aka std::basic_istream<char>} In fil...
s060100142
p03945
C++
#include <iostream> #include <vector> using namespace std; int main(){ vector <char> S[]; cin >> S; int change = 0; for(int i = 0; i < S.size()-1; i++){ if(S[i] != S[i+1]) change++; } cout << change; }
a.cc: In function 'int main()': a.cc:7:17: error: array size missing in 'S' 7 | vector <char> S[]; | ^ a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char> [1]') 8 | cin >> S; | ~~~ ^~ ~ | |...
s000192510
p03945
C++
#include <iostream> #include <vector> using namespace std; int main(){ string s; cin >> s; bool f = false; int ans = 0; while(!f){ //先頭から同じ要素がいくつ続いているか int cl = 1; for(int i = 1; i < s.size(); i++){ if(s[0] != s[i]) break; cl++; } if(cl == s.size()){ f = true; ...
a.cc: In function 'int main()': a.cc:24:5: error: 'cr' was not declared in this scope; did you mean 'cl'? 24 | cr = 1; | ^~ | cl
s551258560
p03945
C++
#include <iostream> #include <vector> using namespace std; int main(){ vector<char> s; cin >> s; bool f = false; int ans = 0; while(!f){ //先頭から同じ要素がいくつ続いているか int cl = 1; for(int i = 1; i < s.size(); i++){ if(s[0] != s[i]) break; cl++; } if(cl == s.size()){ f = tru...
a.cc: In function 'int main()': a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char>') 8 | cin >> s; | ~~~ ^~ ~ | | | | | std::vector<char> | std::istream {aka std::basic_istream<char>} In fil...
s804781654
p03945
C++
#include<iostream> #include<cstring> #include<cmath> using namespace std; int main(){ string a; int sum=0; cin>>a; for(int i=1;i<a.length;i++){ if(a[i]!=a[i-1]){ sum++; } } cout<<sum; }
a.cc: In function 'int main()': a.cc:9:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsi...
s111555459
p03945
C++
#include<bits/stdc++.h> #include<cstdio> using namespace std; char asd[100001]; int main() { gets(asd); int zip,ppt=0; for(zip=1;zip<strlen(asd);zip++) if(asd[zip]!=asd[zip-1]) ppt++; printf("%d\n",ppt); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(asd); | ^~~~ | getw
s961083125
p03945
C++
#include<bits/stdc++.h> using namespace std; char asd[100001]; int main() { gets(asd); int zip,ppt=0; for(zip=1;zip<strlen(asd);zip++) if(asd[zip]!=asd[zip-1]) ppt++; printf("%d\n",ppt); return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(asd); | ^~~~ | getw
s101158859
p03945
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin >> s; char tmp = s[0]; int count = 0; for(int i = 1; i < s.size(); i++){ if(s[i] != tmp) { count++; tmp = s[i]; } } cout << cont; return 0; }
a.cc: In function 'int main()': a.cc:16:17: error: 'cont' was not declared in this scope; did you mean 'count'? 16 | cout << cont; | ^~~~ | count
s910987187
p03945
C++
#include <bits/stdc++.h> using namespace std; int main() { int ans; char a[100001]; scanf("%s",a); for(int i=0;i<a-1;i++) { if(a[i]!=a[i+1]) ans++; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | for(int i=0;i<a-1;i++) | ~^~~~
s806806014
p03945
C++
#include<iostream> #include<cstring> using namespace std; int main(){ char a[100010]; int ans=0; gets(a); for(int i=1;i<=strlen(a);i++){ if(a[i]!=a[i-1]) ans++; } cout<<ans-1; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s887202333
p03945
C++
#include<vector> #include<cstring> #include<iostream> using namespace std; string s; int main() { int ans=0; getline(cin,s); for(int i=1;i<s.size();i++) if(s[i]!=s[i-1])ans++; printf("%d\N",ans); return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: '\N' not followed by '{' 12 | printf("%d\N",ans); | ^~~~~~ a.cc:12:16: error: incomplete universal character name \N
s978237560
p03945
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int cnt=0; for(int i=0;i<s.size()-1;i++){ if(a[i]!=a[i+1]){ cnt++; } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:8:8: error: 'a' was not declared in this scope 8 | if(a[i]!=a[i+1]){ | ^
s458810003
p03945
C++
#include<cstdio> #include<cstring> int main(){ char s[]; scanf("%s", s); int n = 0; for(int i=0; i<strlen(s); i++){ if(s[i] != s[i-1]) n++; } printf("%d", n); return 0; }
a.cc: In function 'int main()': a.cc:4:8: error: storage size of 's' isn't known 4 | char s[]; | ^
s614387989
p03945
C++
#include"bits/stdc++.h" #define int long long #define _overload3(_1,_2,_3,name,...) name #define _rep(i,n) repi(i,0,n) #define repi(i,a,b) for(int i=(a);i<(b);++i) #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__) #define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i) #define All(x) (x).begin(),(x).en...
a.cc: In function 'int main()': a.cc:29:11: error: 's' was not declared in this scope 29 | rep(i,s.size()-1) if(s[i]!=s[i+1]) ans++; | ^ a.cc:5:38: note: in definition of macro 'repi' 5 | #define repi(i,a,b) for(int i=(a);i<(b);++i) | ^ a.cc:3:39: no...
s369432183
p03945
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin >> s; int ans = 0; for(int i = 0; i<= s.length()-2;i++){ char a = s[i]; char b = s[i+1] if(a != b){ ans++; } } cout << ans; }
a.cc: In function 'int main()': a.cc:11:5: error: expected ',' or ';' before 'if' 11 | if(a != b){ | ^~
s868162531
p03945
C++
#include<bits/stdc++.h> using nmaespace std; int main(){ string input; long long ans=0; cin>>input; for(int i=1;i<input.length();i++){ if(input[i-1]!=input[i]) ans++; } cout<<ans<<endl; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'nmaespace' 2 | using nmaespace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:4:5: error: 'string' was not declared in this scope 4 | string input; | ^~~~~~ a.cc:4:5: note: suggested alternatives: In file included from /usr...
s443581814
p03945
C++
#include<bits/stdc++.h> using namespace std; char srx[100001]; int main() { gets(srx); int i,zjq=0; for(i=1;i<strlen(srx);i++)//注意从1开始,不然就会多一个 if(srx[i]!=srx[i-1]) zjq++;//判断成功就加1(还是C语言的char好用~,可以当数组用) printf("%d\n",zjq);//回车注意++ return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(srx); | ^~~~ | getw
s829130277
p03945
C++
#include<iostream> using namespace std; int main() { char i[100001]="0",c=0; cin>>i; for(int j=1;i[j]!='\0';i++) if(i[j]!=i[j-1]) c++; return 0; }
a.cc: In function 'int main()': a.cc:7:32: error: lvalue required as increment operand 7 | for(int j=1;i[j]!='\0';i++) if(i[j]!=i[j-1]) c++; | ^
s491032493
p03945
C++
#include<bits/stdc++.h> string st; int ans; int main() { cin>>st; for(int i=1;i<st.size();i++) if(st[i]!=st[i-1]) ans++; printf("%d\n",ans); return 0; }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string st; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>st; | ^~~ | std::cin In file included from /usr/inclu...
s211801416
p03945
C++
#include<bits/stdc++.h> #include<stdio.h> #include<string.h> char ch[100001]; int ans; int main() { gets(ch); for(int i=1;i<strlen(ch);i++) if(ch[i]!=ch[i-1]) ans++; printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(ch); | ^~~~ | getw
s141616930
p03945
C++
#include<bits/stdc++.h> char ch[100001]; int ans; int main() { gets(ch); for(int i=1;i<strlen(ch);i++) if(ch[i]!=ch[i-1]) ans++; printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(ch); | ^~~~ | getw
s439548121
p03945
C++
#include<bits/stdc++.h> char ch[100001]; int ans; int main() { gets(ch): for(int i=1;i<strlen(ch);i++) if(ch[i]!=ch[i-1]) ans++; printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(ch): | ^~~~ | getw a.cc:7:17: error: 'i' was not declared in this scope 7 | for(int i=1;i<strlen(ch);i++) | ^
s887618848
p03945
C++
#include <iostream> #include <string> using namespace std; int main() { char S[100000] = {}; cin >> S; int S_len = 0;; for (S_len = 0; S_len < 100000; S_len++) { if (S[S_len] == NULL) { break; } } int now_index = 0; int count = 0; for (int i = 1; i < S_len; i++) { if (strcmp(&S[now_index], &S...
a.cc: In function 'int main()': a.cc:15:33: warning: NULL used in arithmetic [-Wpointer-arith] 15 | if (S[S_len] == NULL) | ^~~~ a.cc:26:21: error: 'strcmp' was not declared in this scope 26 | if (strcmp(&S[now_index], &S[i]) != 0) | ...
s690054203
p03945
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans=0; for(int i=0; i<s.length()-1; i++) { if(s[i]!=s[i+1]) { ans++; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:2: error: expected '}' at end of input 13 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^