submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s038973671
p03965
C++
use std::io::stdin; fn main() { let mut st = String::new(); stdin().read_line(&mut st).unwrap(); let s:Vec<char> = st.trim().chars().collect(); let p:usize = s.iter().filter(|x| x==&&'p').count(); let n = s.len(); println!("{}", n/2 - p); }
a.cc:1:1: error: 'use' does not name a type 1 | use std::io::stdin; | ^~~ a.cc:2:1: error: 'fn' does not name a type 2 | fn main() { | ^~
s796420679
p03965
C++
#include<cstdio> #include<cstring> using namespace std; char c[100007]; int main(){ scanf("%s",c);int l=strlen(c),g=0; for(int i=0;i<l;++i)if(c[i]=='g')g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); return 0; }
a.cc: In function 'int main()': a.cc:8:19: error: 'min' was not declared in this scope; did you mean 'main'? 8 | printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); | ^~~ | main
s188906370
p03965
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const long long INF= 1e+18+1; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000...
a.cc: In function 'int main()': a.cc:18:9: error: 'n' was not declared in this scope 18 | rep(i,n){ | ^ a.cc:5:43: note: in definition of macro 'rep' 5 | #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) | ^
s947339138
p03965
C++
#include <iostream> #include <string> using namespace std; int main(){ string a; cin>>a; int len=a.size(); int i; int x=0,y=0,ans=0; for(i=0;i<len;i++) if(x==y)x++;if (a[i]=='p') ans--;} else{y++;if (a[i]=='g') ans++;} cout<<ans<<endl; return 0; }
a.cc:12:9: error: expected unqualified-id before 'else' 12 | else{y++;if (a[i]=='g') ans++;} | ^~~~ a.cc:13:5: error: 'cout' does not name a type 13 | cout<<ans<<endl; | ^~~~ a.cc:14:5: error: expected unqualified-id before 'return' 14 | return 0; | ^~~~~~ a.cc...
s050644161
p03965
C++
#include<cstdio> #include<cstring> using namespace std; char c[100007]; int main(){ scanf("%s",c);int l=strlen(c),g=0;for(int i=0;i<l;++i)if(c[i]=='g')g++;printf("%d\n",min(l/2,g)-min(l-l/2,l-g));return 0; }
a.cc: In function 'int main()': a.cc:6:90: error: 'min' was not declared in this scope; did you mean 'main'? 6 | scanf("%s",c);int l=strlen(c),g=0;for(int i=0;i<l;++i)if(c[i]=='g')g++;printf("%d\n",min(l/2,g)-min(l-l/2,l-g));return 0; | ...
s029320103
p03965
Java
import java.util.Scanner; import jdk.management.cmm.SystemResourcePressureMXBean; public class Main { public static void main(String[] args) { Scanner input=new Scanner( System.in); String string=input.next(); int len=string.length(); int ans=0; for(int i=0;i<len...
Main.java:4: error: package jdk.management.cmm does not exist import jdk.management.cmm.SystemResourcePressureMXBean; ^ 1 error
s583204622
p03965
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<vector> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define sc(x) scanf("%d",&x); int main(){ string s; cin >> s; int ans = 0; int cnt = 0; for (int ...
a.cc: In function 'int main()': a.cc:19:13: error: 'g' was not declared in this scope 19 | g += 1; | ^
s668150362
p03965
C++
#include<bits/stdc++.h> using namespace std; int main(){ string a; cin >> a; int len = strlen(a); int i; int x = 0,y = 0,ans = 0; for(i = 0;i < len;i++){ if (x == y){ x++; if(a[i] == 'p') ans--; } else{ y++; ...
a.cc: In function 'int main()': a.cc:6:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 6 | int len = strlen(a); | ^ | | | std::string {aka std::__cxx11::basic_string<char>} In file ...
s951525476
p03965
C++
#include <iostream> #include <string> #include <algorithm> #include <functional> #include <vector> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <cstdio> #include <cmath> #include <tuple> #include <iomanip> #include <numeric> #include <unordered_map> #include <sstream> #in...
a.cc: In function 'void solve()': a.cc:55:14: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int') 55 | cout<<(G-P)>>1<<endl; | ~~~~~~~~~~~^~~ | | | | | int | std::basic_o...
s465913092
p03965
C++
V#include <bits/stdc++.h> #define MOD 1000000007 using namespace std; int main() { string s; cin >> s; int count = 0; for(int i = 0;i < s.size();i++) { if(s[i] == 'g') { count++; } } if(s.size() % 2 == 1) { cout << count - s.size() / 2 - 1; } else ...
a.cc:1:2: error: stray '#' in program 1 | V#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'V' does not name a type 1 | V#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:6:5: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:7:5: error: 'cin...
s539868045
p03965
C++
#include <bits/stdc++.h> #define MOD 1000000007 using namespace std; int main() { string s; cin >> s; int count = 0; for(int i = 0;i < s.size();i++) { if(s[i] == 'g') { count++; } } if(s.size() % 2 == 1) { cout << count - s.size() / 2 - 1; } else ...
a.cc:22:19: error: stray '\' in program 22 | cout << count \ s.size() / 2; | ^ a.cc: In function 'int main()': a.cc:22:18: error: expected ';' before 's' 22 | cout << count \ s.size() / 2; | ^ ~ | ;
s638769528
p03965
Java
import java.util.*; import java.lang.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String S = sc.next(); int G = 0,P = 0; for( int i=0; i<S.length(); i++ ){ S.charAt(i)=='g' ? G++ : P++; } System.out.println((G-P)/2); } }
Main.java:10: error: not a statement S.charAt(i)=='g' ? G++ : P++; ^ 1 error
s008035050
p03965
C++
#include<cstdio> #include<cstring> using namespace std;char c[100007];int main(){scanf("%s",c);int l=strlen(c),g=0; for(int i=0;i<l;++i)if(c[i]=='g')g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g));return 0;}
a.cc: In function 'int main()': a.cc:3:138: error: 'min' was not declared in this scope; did you mean 'main'? 3 | using namespace std;char c[100007];int main(){scanf("%s",c);int l=strlen(c),g=0; for(int i=0;i<l;++i)if(c[i]=='g')g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g));return 0;} | ...
s929496532
p03965
C++
#include<cstdio> #include<cstring> using namespace std;char c[100007];int main(){scanf("%s",c);int l=strlen(c),g=0; for(int i=0;i<l;++i)if(c[i]=='g')g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g));return 0;}
a.cc: In function 'int main()': a.cc:3:138: error: 'min' was not declared in this scope; did you mean 'main'? 3 | using namespace std;char c[100007];int main(){scanf("%s",c);int l=strlen(c),g=0; for(int i=0;i<l;++i)if(c[i]=='g')g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g));return 0;} | ...
s365869823
p03965
C++
s = input() g = 0 p = 0 ans = 0 for i in s: if i == "g": if p < g: ans += 1 p += 1 else: g += 1 else: if p < g: p += 1 else: g += 1 ans -= 1 print (ans)
a.cc:2:1: error: 's' does not name a type 2 | s = input() | ^
s348412969
p03965
C++
#include <bits/sstdc++.h> using namespace std; int main(){ string s; cin >> s; int ans = 0; for(int i=0;i<s.size();++i){ if(i%2 == 0 && s[i] == 'p') --ans; if(i%2 == 1 && s[i] == 'g') ++ans; } cout << ans << endl; return 0; }
a.cc:1:10: fatal error: bits/sstdc++.h: No such file or directory 1 | #include <bits/sstdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s651769785
p03965
C++
S = input().strip() p, g = "pg" score = sum(1 if c==g else 0 for c in S) G, P = 0, 0 hands = [] lastp = None for c in S: if P == G: if c == g: hand = g score -= 1 else: hand = p hands[lastp] = g # c == p # 過去のP vs G を G vs G :...
a.cc:17:15: error: invalid preprocessing directive #c 17 | # c == p | ^ a.cc:18:15: error: invalid preprocessing directive #\U0000904e\U000053bb\U0000306eP 18 | # 過去のP vs G を G vs G : +1 -> 0 = -1 | ^~~~~~~ a.cc:19:15: error: invalid preprocessing di...
s608617275
p03965
C++
#include <iostream> #include <cstring> using namespace std; char s[1000101]; int n,x,y,ans; int main(){ cin>>s; n=strlen(s); for(int i=0;i<n;i++){ if(s[i]=='p'){ if(x>y){ y++; }else{ x++; ans-—; } }else{ ...
a.cc:15:21: error: extended character — is not valid in an identifier 15 | ans-—; | ^ a.cc: In function 'int main()': a.cc:15:21: error: '\U00002014' was not declared in this scope 15 | ans-—; | ^
s390248978
p03965
C++
#include<bits/stdc++.h> using namespace std; string s;int x,y,ans; int main(){ cin>>s; for(register int i=0;i<s.size();i++){ if(x==y){x++;if(a[i]=='p') ans--;} else{y++;if(a[i]=='g') ans++;} } printf("%d",ans); return 0; }
a.cc: In function 'int main()': a.cc:6:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 6 | for(register int i=0;i<s.size();i++){ | ^ a.cc:7:25: error: 'a' was not declared in this scope 7 | if(x==y){x++;if(a[i]=='p') ans--;} | ...
s319723958
p03965
C++
// luogu-judger-enable-o2 #include<bits/stdc++.h> using namespace std; string s;int x,y,ans; int main(){ cin>>s; for(register int i=0;i<s.size();i++){ if(x==y){x++;if(a[i]=='p') ans--;} else{y++;if(a[i]=='g') ans++;} } printf("%d",ans); return 0; }
a.cc: In function 'int main()': a.cc:7:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | for(register int i=0;i<s.size();i++){ | ^ a.cc:8:25: error: 'a' was not declared in this scope 8 | if(x==y){x++;if(a[i]=='p') ans--;} | ...
s863612163
p03965
C++
#include<cstdio> #include<cstring> using namespace std; char c[100007]; int main(){ scanf("%s",c);int l=strlen(c),g=0; for(int i=0;i<l;++i)if(c[i]=='g')g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); return 0; }
a.cc: In function 'int main()': a.cc:8:19: error: 'min' was not declared in this scope; did you mean 'main'? 8 | printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); | ^~~ | main
s975757510
p03965
C++
a#include <bits/stdc++.h> using namespace std; #define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i) #define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i) #define per(i,N) for(int i=(N)-1;i>=0;--i) #define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i) #define all(arr) (arr).begin(), (arr).end() #define ...
a.cc:1:2: error: stray '#' in program 1 | a#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'a' does not name a type 1 | a#include <bits/stdc++.h> | ^ a.cc:18:11: error: 'pair' does not name a type 18 | typedef pair<int,int> PII; | ^~~~ a.cc:19:11: error: 'pair' does not name a ty...
s075887648
p03965
C++
#include<cstdio> #include<cstring> using namespace std; char c[100007]; int main(){ scanf("%s",c);int l=strlen(c),g=0; for(int i=0;i<l;++i)if(c[i]=='g')g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); return 0; }
a.cc: In function 'int main()': a.cc:8:19: error: 'min' was not declared in this scope; did you mean 'main'? 8 | printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); | ^~~ | main
s032022250
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[100007]; int main() { scanf("%s",a); int l=strlen(a),x=0,i; for(i=0;i<l;i++) if(a[i]=='g') x++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); return 0; }
a.cc: In function 'int main()': a.cc:11:25: error: 'g' was not declared in this scope 11 | printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); | ^
s984401613
p03965
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; int ans=0,x=0,y=0; cin>>s; for(int i=0; i<s.size(); i++) { x==y?x++,s[i]=='p'?ans--:ans=ans:y++,s[i]=='g'?ans++:ans=ans; } cout<<asn<<endl; }
a.cc: In function 'int main()': a.cc:10:15: error: 'asn' was not declared in this scope; did you mean 'ans'? 10 | cout<<asn<<endl; | ^~~ | ans
s116227847
p03965
C++
//恶意评分++ #include<cstdio> #include<cstring> #define mian int main() char c[100007]; mian{ scanf("%s",c); int l=strlen(c),g=0; for(int i=0;i<l;++i) if(c[i]=='g') g++; printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); return 0; }
a.cc: In function 'int main()': a.cc:14:19: error: 'min' was not declared in this scope; did you mean 'main'? 14 | printf("%d\n",min(l/2,g)-min(l-l/2,l-g)); | ^~~ | main
s024491519
p03965
C++
#include<iostream> #include<string> using namespace std; int a1,a; int main(){ string s1,s2; cin>>s1; for(int i=0;i<s1.size();i++) { if(s[i]=='p') a1++; } a=s1.size()/2; cout<<a-a1; }
a.cc: In function 'int main()': a.cc:10:22: error: 's' was not declared in this scope 10 | if(s[i]=='p') a1++; | ^
s064507410
p03965
C++
#include <bits/stdc++.h> using namespace std; #define N 10001 char a[N]; int main() { gets(a); int l=strlen(a); int t1=0,t2=0,score=0; for(int i=0;i<l;i++) if(t1==t2) { t1++; if(a[i]=='p') score--; }else { t2++; if(a[i]=='g') score++; } printf("%d\n",score); 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
s635854117
p03965
C++
#include<bits/stdc++.h> using namespace std; bool b[26]={1,0,0,0,1,1,0,1,1,0,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1}; int main() { bool o=0,ok=0; string s; cin>>s; for(int i=0;i<s.size();i++) if(b[s[i]-'A']==1)ok1=1; else ok=1; if(o+ok==1)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0...
a.cc: In function 'int main()': a.cc:10:24: error: 'ok1' was not declared in this scope; did you mean 'ok'? 10 | if(b[s[i]-'A']==1)ok1=1; | ^~~ | ok
s572540320
p03965
C++
#include<bits/stdc++.h> string s; int main(){ cin>>s; cout<<s.size()/2-count(s.begin(),s.end(),'p')<<endl; }
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:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin>>s; | ^~~ | std::cin In file included from /usr/include/x86_6...
s450935125
p03965
C++
#include <algorithm> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <utility> #include <vector> using std::cerr; using std::cin; using std::cout; using std::endl; void OutputError(std::string s) { cerr << "\033[93m" << s << "\033[m" << endl; ret...
a.cc: In function 'int main()': a.cc:29:25: 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...
s438271921
p03965
C++
#include<bits/stdc++.h> using namespace std; string s; int x,y,ans; int main(){ cin>>s; for(int i=0;i<s.size();i++) if (x==y){ x++; if(a[i]=='p') ans--;} else{ y++; if(a[i]=='g') ans++;} cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:28: error: 'a' was not declared in this scope 8 | if (x==y){ x++; if(a[i]=='p') ans--;} | ^ a.cc:9:23: error: 'a' was not declared in this scope 9 | else{ y++; if(a[i]=='g') ans++;} | ^
s906769717
p03965
C++
string s; cin >> s; lnt ans = 0; FOR(i, 0, (s.size() + 1) / 2) { if (s.at(i) == 'p') { ans--; } } FOR(i, (s.size() + 1) / 2, s.size()) { if (s.at(i) == 'g') { ans++; } } printf("%lld\n", ans);
a.cc:2:3: error: 'string' does not name a type 2 | string s; | ^~~~~~ a.cc:3:3: error: 'cin' does not name a type 3 | cin >> s; | ^~~ a.cc:5:3: error: 'lnt' does not name a type; did you mean 'int'? 5 | lnt ans = 0; | ^~~ | int a.cc:6:6: error: expected constructor, des...
s945482605
p03965
Java
/* * Author. Silviase(@silviasetitech) * For AtCoder */ import java.util.*; import java.lang.*; import java.math.*; public class Main { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s = sc.nextInt(); int ans = 0; ...
Main.java:18: error: incompatible types: int cannot be converted to String String s = sc.nextInt(); ^ 1 error
s076822917
p03965
C++
#include <bits/stdc++.h> #define ll long long int main() { string s; cin>>s; int ans=0; int k=0;// for(int i=0;i<s.length();i++){ if(s[i]=='g'){ if(k>0){ ans++; k--; }else{ k++; } } else{ ...
a.cc: In function 'int main()': a.cc:5:5: error: 'string' was not declared in this scope 5 | string s; | ^~~~~~ a.cc:5:5: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-li...
s459010595
p03965
C++
clude <iostream> #include <string> using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) #define SZ(x) ((int)(x).size()) int main() { string s; cin >> s; int n = SZ(s), p = 0; REP(i, n)if (s[i] == 'p')p++; cout << n / 2 - p << endl; }
a.cc:1:1: error: 'clude' does not name a type 1 | clude <iostream> | ^~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 6...
s010319481
p03965
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s;cin>>s; int sumg=0,sump=0; for(int i=0;i<n;i++){ if(s[i]=='g')sumg++; else sump++; } cout<<sumg-sump<<endl; }
a.cc: In function 'int main()': a.cc:6:17: error: 'n' was not declared in this scope 6 | for(int i=0;i<n;i++){ | ^
s714583102
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[100005]; int x=0,y=0,ans=0; int main() { scanf("%s",a); int mm=srelen(a); for (int i=0;i<=mm;i++) if (x==y) { x++; if(a[i]=='p') ans--; } else { y++; if(a[i]=='g')...
a.cc: In function 'int main()': a.cc:10:12: error: 'srelen' was not declared in this scope; did you mean 'strnlen'? 10 | int mm=srelen(a); | ^~~~~~ | strnlen
s741973560
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[100005]; int x=0,y=0,ans=0; int main() { scanf("%s",a+1) int mm=srelen(a); for (int i=1;i<mm;i++) if (x==y) { x++; if(a[i]=='p') ans--; } else { y++; if(a[i]=='g')...
a.cc: In function 'int main()': a.cc:9:20: error: expected ';' before 'int' 9 | scanf("%s",a+1) | ^ | ; 10 | int mm=srelen(a); | ~~~ a.cc:11:20: error: 'mm' was not declared in this scope; did you mean 'tm'? 11 | for (int i=1...
s965831845
p03965
C++
#include<iostream> #include<cstring> #include<cstdio> using namespace std; char s[1000000]; int a[1000000]={1,0},n,b[1000000]; int main() { gets(s); int lens=strlen(s); for(int i=0;i<=lens-1;i++) { if(s[i]=='g') b[i]=0; else b[i]=1; } for(int i=2;i<=lens;i++) { if(i%2==0) a[i]=0; else a[i]=1; } for(int...
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(s); | ^~~~ | getw
s783981429
p03965
C++
include <iostream> #include <vector> #include <string> #include <cmath> #include <set> #include <algorithm> #include <array> #include <complex> #include <string> #include <utility> #include <map> #include <queue> #include <list> int dx[4] = { -1,0,1,0 }; int dy[4] = { 0,1,0,-1 }; const int INF = 1 << 21; using pii = st...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s517936262
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[100005]; int x=0,y=0,ans=0; int main() { cin>>a; for (int i=0;i<sizeof(a);i++) if (x==y) { x++; if(a[i]=='p') ans--; } else { y++; if(a[i]=='g') ans++; } ...
a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s376669818
p03965
C++
#include<bits/stdc++.h> using namespace std; char s[10005]; int len,i,j,score=0,rock=0,paper=0,a[10005]; int main() {gets(s); len=strlen(s); for(i=0;i<len;i++) if(s[i]=='g') a[i+1]=0;//0->rock else if(s[i]=='p') a[i+1]=1;//1->paper /*for(i=1;i<=len;i++) cout<<a[i]<<' '; cout<<endl;*/ rock++; if(a[1]==1)...
a.cc: In function 'int main()': a.cc:6:2: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | {gets(s); | ^~~~ | getw
s312712965
p03965
C++
#include<stdio.h> char s[10001]; int main() { scanf("%s",s); int ans=0,x=0,y=0; for(int i=0;i<strlen(s);i++) { if(x==y) { x++; if(s[i]=='p') ans--; } else { y++; if(s[i]=='g') ans++; }...
a.cc: In function 'int main()': a.cc:7:19: error: 'strlen' was not declared in this scope 7 | for(int i=0;i<strlen(s);i++) | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<stdio.h> +++ |+#includ...
s624698506
p03965
C++
#include<bits/stdc++.h> long long int q[24][24],j[24][24]; long long int n,m,x,y; bool jc(int a,int b) { if((a==x-1&&(b==y-2||b==y+2))||(a==x+1&&(b==y-2||b==y+2))) return 1; else return 0; } void dt(int a,int b) { if(jc(a,b)) { int h=(a+1)/n; a=(a+1)%n
a.cc: In function 'void dt(int, int)': a.cc:16:22: error: expected ';' at end of input 16 | a=(a+1)%n | ^ | ; a.cc:16:22: error: expected '}' at end of input a.cc:14:11: note: to match this '{' 14 | { | ^ a.cc:16:22: error...
s545711163
p03965
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; char a[100001]; int main(){ int s=0,sn=0,x; //for(int i=1;i<=strlen(a);i++) gets(a); for(int i=0;i<strlen(a);i++) {if(a[i]=='p') s++; if(a[i]=='g') sn++; } x=(sn-s)/2; cout<<x; return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(a); | ^~~~ | getw
s540655491
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[100001]; int main(){ int s=0,sn=0,x; //for(int i=1;i<=strlen(a);i++) gets(a); for(int i=0;i<strlen(a);i++) {if(a[i]=='p') s++; if(a[i]=='g') sn++; } x=(sn-s)/2; cout<<x; 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
s807214256
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[106]; int main(){ int s=0,sn=0,x; //for(int i=1;i<=strlen(a);i++) gets(a); for(int i=0;i<strlen(a);i++) {if(a[i]=='p') s++; if(a[i]=='g') sn++; } x=(sn-s)/2; cout<<x; 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
s747051361
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[106]; int main(){ int s=0,sn=0,x; //for(int i=1;i<=strlen(a);i++) gets(a); for(int i=0;i<strlen(a);i++) {if(a[i]=='p') s++; if(a[i]=='g') sn++; } x=(sn-s)/2; cout<<x; 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
s265105135
p03965
C++
#include<bits/stdc++.h> using namespace std; char a[106]; int main(){ int s=0,sn=0,x; gets(a); for(int i=0;i<strlen(a);i++) {if(a[i]=='p') s++; if(a[i]=='g') sn++; } x=(sn-s)/2; cout<<x; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(a); | ^~~~ | getw
s852249300
p03965
C++
#include<bits/stdc++.h> using namespace std; string s; int x=0,y=0,ans=0; int main() { cin>>s; for (int i=0;i<s.size();i++) if (x==y){x++; if(a[i]=='p') ans--;} else{y++; if(a[i]=='g') ans++;} printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: 'a' was not declared in this scope 9 | if (x==y){x++; if(a[i]=='p') ans--;} | ^ a.cc:10:19: error: 'a' was not declared in this scope 10 | else{y++; if(a[i]=='g') ans++;} | ^
s139559759
p03965
C++
#include<bits/stdc++.h> using namespace std; char s[100005]; int len,i,score=0,p=0; //g->rock p->paper p=rock-paper>=0 int main() {gets(s); len=strlen(s); for(i=0;i<len;i++) if(s[i]=='g') {if(p<1) p++; else {p--; score++;} } else{ if(p<1) {p++; score--;} else p--; } cout<<score; return 0; }
a.cc: In function 'int main()': a.cc:7:2: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | {gets(s); | ^~~~ | getw
s889258413
p03965
C
#include<iostream> #include<cstdio> #include<string> #include<cstring> using namespace std; char s[100010]; int main() { int len=0; int p=0,g=0; while(cin>>s[++len]) { if(s[len]=='p') p++; if(s[len]=='g') g++; } int num=len/2; if(p<g) cout<<num-p; if(p==g) cout<<0; if(p>g) cout<<num-p; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s620492661
p03965
C++
#include<iostream> #include<cstring> using namespace std; char s[100001]; int main() { gets(s); int sum=0,len=strlen(s),ans=0; int k=len/2;//布最多能出的次数 for(int i=0;i<=len-1;i++) if(s[i]=='p'||s[i]=='P') ans++; cout<<k-ans; 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(s); | ^~~~ | getw
s664336420
p03965
C++
#include<iostream> #include<cstring> using namespace std; char s[1000000]; int a[1000000]={1,0},n,b[1000000]; int main() { gets(s); int lens=strlen(s); for(int i=0;i<=lens-1;i++) { if(s[i]=='g') b[i]=0; else b[i]=1; } for(int i=2;i<=lens;i++) { if(i%2==0) a[i]=0; else a[i]=1; } for(int i=0;i<=lens-1;i+...
a.cc: In function 'int main()': a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s946615139
p03965
C++
#include<bits/stdc++.h> using namespace std; char s[1000000]; int a[1000000]={1,0},n,b[1000000]; int main() { gets(s); int lens=strlen(s); for(int i=0;i<=lens-1;i++) { if(s[i]=='g') b[i]=0; else b[i]=1; } for(int i=2;i<=lens;i++) { if(i%2==0) a[i]=0; else a[i]=1; } for(int i=0;i<=lens-1;i++) { if(a[...
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
s822325315
p03965
C++
#include<iostream> #include<cstring> using namespace std; char s[1000000]; int a[1000000]={0,1,0},n,b[1000000]; int main() { gets(s); int lens=strlen(s); for(int i=1;i<=lens;i++) { if(s[i]=='g') b[i]=0; else b[i]=1; } for(int i=3;i<=lens;i++) { if(i%2==0) a[i]=1; else a[i]=0; } for(int i=1;i<=lens;i++)...
a.cc: In function 'int main()': a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s138682855
p03965
C++
#include<bits/stdc++.h> using namespace std; int main() { char s[100005]; gets(s); int sum=0, lens=strlen(s), p=0, g=0; for(int i=0;i<lens;i++){ if(s[i]=='g'){ if(g>p){ sum++; p++; } else g++;...
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s681685670
p03965
C++
#include<bits/stdc++.h> using namespace std; char s[100006]; int i,len; int main(){ scanf("%s",s); len=strlen(s); int g=0,p=0,sum=0; for(i=1;i<=len;i++) { if(s[i]=='g') { if(g>p) { sum++; p++; } else g++; } else(s[i]=='p') { if(g>p) p++; else { sum--; g++; ...
a.cc: In function 'int main()': a.cc:21:32: error: expected ';' before '{' token 21 | else(s[i]=='p') | ^ | ; 22 | { | ~
s999524680
p03965
C++
#include<bits/stdc++.h> using namespace std; char s[100006]; int g,p,i,sum,len; int main(){ scanf("%s",s); len=strlen(s); for(i=1;i<=len;i++) { if(s[i]=='g') { if(g>p) { sum++; p++; } else g++; } if(s[i]=='p') { if(g>p) p++; else { sum--; g++; } } } prin...
a.cc: In function 'int main()': a.cc:31:9: error: 'prinf' was not declared in this scope; did you mean 'printf'? 31 | prinf("%d\n",sum); | ^~~~~ | printf
s107659557
p03965
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<map> #include<stack> #include<set> #include<deque> #include<vector> #include<queue> #include<string> #include<fstream> #include<algorithm> using namespace std; char s[100006]; int g,p,i,sum,len; int main(){ scanf("%s",s); len=strle...
a.cc: In function 'int main()': a.cc:43:9: error: 'prinf' was not declared in this scope; did you mean 'printf'? 43 | prinf("%d\n",sum); | ^~~~~ | printf
s164230812
p03965
C++
#include<bits/stdc++.h> using namespace std; char s[10005]; int n,delta=0,ans=0; bool a[10005]; int main() { scanf("%s",s+1),n=strlen(s+1); for(int i=1;i<=n;++i)a[i]=(s[i]=='p'); for(int i=1;i<=n;++i){ if(delta<=0)++delta,ans-=col[i]; else --delta,ans+=(!col[i]); } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:11:42: error: 'col' was not declared in this scope; did you mean 'cosl'? 11 | if(delta<=0)++delta,ans-=col[i]; | ^~~ | cosl a.cc:12:37: error: 'col' was not declared in t...
s279308315
p03965
C++
#include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; char str[maxn]; int main() { while(scanf("%s",str)!=EOF) { int gg=0,pp=0,ans=0; int len=strlen(str); for(int i=0; i<len; i++) { if(str[i]=='g') { if(pp<gg)ans++,pp++; ...
a.cc:28:1: error: expected unqualified-id before '--' token 28 | --------------------- | ^~
s437187512
p03965
C++
#include<bits/stdc++.h> using namespace std; char topco[10010]; //short topco_paper[10010],topco_rock[10010]; //int t_p_head,t_p_tail,t_r_tail,t_r_head; int t_p_top,t_r_top;//topco的指针; int t_lenp,t_lenr;//,a_lenp,a_lenr; int main() { gets(topco); int lent=strlen(topco); for(int i=1;i<=lent;i++) { if(topco[i]=='...
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(topco); | ^~~~ | getw
s114717154
p03965
C++
#include<iostream> #include<cstring> using namespace std; char topco[10010]; //short topco_paper[10010],topco_rock[10010]; //int t_p_head,t_p_tail,t_r_tail,t_r_head; int t_p_top,t_r_top;//topco的指针; int t_lenp,t_lenr;//,a_lenp,a_lenr; int main() { gets(topco); int lent=strlen(topco); for(int i=1;i<=lent;i++) { i...
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(topco); | ^~~~ | getw
s483310367
p03965
C++
#include<bits/stdc++.h> char s[100002]; using namespace std; int main() { gets(s); int len=strlen(s),z=0; for(int i=0;i<len;i++) { if(s[i]=='p') z++; } cout<<len/2-z; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s702872863
p03965
C++
#include<bits/stdc++.h> using namespace std; int f; char c[100010]; int main(){ gets(c); for(int i=0;i<strlen(c);i++) { if(c[i]=='p') if(i%2==0) f--; if(c[i]=='g') if(i%2==1) f++; } cout<<f; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(c); | ^~~~ | getw
s088814567
p03965
C++
#include<bits/stdc++.h> using namespace std; int f; char c[100010]; int main(){ gets(c); for(int i=0;i<strlen(c);i++) { if(c[i]=='p') if(i%2==0) f--; if(c[i]=='g') if(i%2==1) f++; } cout<<f; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(c); | ^~~~ | getw
s104068894
p03965
C++
#include<bits/stdc++.h> using namespace std; char s[100001]; int main() { scanf("%s",s+1); register int sum=0,l=strlen(s+1),p=0,g=0; for(register int i=1;i<=len;++i) if(s[i]=='g') if(g>p) ++sum,++p; else ++g; else if(g>p) ++p; else --sum,g++; return printf("%d",sum),0; }
a.cc: In function 'int main()': a.cc:7:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | register int sum=0,l=strlen(s+1),p=0,g=0; | ^~~ a.cc:7:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | ...
s626851211
p03965
C++
#include<bits/stdc++.h> char a; int b[2]; int main(){ while((a=getchar())!=EOF) b[a=='g']++; cout << (b[1]-b[0])>>1; }
a.cc: In function 'int main()': a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout << (b[1]-b[0])>>1; | ^~~~ | std::cout In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:...
s317787246
p03965
C++
//贪心出招,尽可能出布。 #include<bits/stdc++.h> using namespace std; int main(){ int s=0,b=0,an=0; string s; getling(cin,s); for(int i=0;i<s.size();i++){ if(s[i]=='g'){ if(b<s) b++,an++; else s++; }else{ if(b<s) b++; else s++,an--; } } cout<<an<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: conflicting declaration 'std::string s' 6 | string s; | ^ a.cc:5:13: note: previous declaration as 'int s' 5 | int s=0,b=0,an=0; | ^ a.cc:7:9: error: 'getling' was not declared in this scope; did you mean 'g...
s823240183
p03965
C++
//贪心出招,尽可能出布。 #include<bits/stdc++.h> using namespace std; int main(){ int s=0,b=0,an=0; string s; getling(cin,s); for(int i=0;i<s.size();i++){ if(s[i]=='g'){ if(b<s) b++,an++; else s++; }else{ if(b<s) b++; else s++,ans--; } } cout<<an<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: conflicting declaration 'std::string s' 6 | string s; | ^ a.cc:5:13: note: previous declaration as 'int s' 5 | int s=0,b=0,an=0; | ^ a.cc:7:9: error: 'getling' was not declared in this scope; did you mean 'g...
s267999292
p03965
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int g=0,p=0; int ans=0; for(int i=0;i<s.size();i++) { if(s[i]=='g') { if(p<g)p++,ans++; else p++; } else { if(p<g)p++; else g++,ans--; } } cout<<ans<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:18: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 22 | cout<<ans<endl; | ~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/regex:68, from /usr/include/x86...
s721965423
p03965
C++
#include<bits/stdc++.h> using namespace std; int a[100000]; int main() { char t; while((t=getchar())!=EOF) { a[t]++; } cout<<(a['p']-a['g'])>>1; }
a.cc: In function 'int main()': a.cc:11:30: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and 'int') 11 | cout<<(a['p']-a['g'])>>1; | ~~~~~~~~~~~~~~~~~~~~~^~~ | | | | | int | ...
s534036847
p03965
C++
#include <iostream> #include <cmath> #include <vector> #include <bitset> #include <algorithm> #include <stack> #include <queue> #include <map> #include <climits> #include <set> #include <map> #include <iomanip> #include <cassert> #include <functional> #include <cstring> using namespace std; typedef pair<int, int> P; ...
a.cc:91:2: error: stray '#' in program 91 | }#include <iostream> | ^ a.cc:91:3: error: 'include' does not name a type 91 | }#include <iostream> | ^~~~~~~ a.cc:140:11: error: redefinition of 'const int maxn' 140 | const int maxn = 2e5 + 10; | ^~~~ a.cc:50:11: note: 'const int maxn'...
s185391229
p03965
C++
#include<stdio.h> int main(void){ scanf("%s",str); }
a.cc: In function 'int main()': a.cc:6:16: error: 'str' was not declared in this scope; did you mean 'std'? 6 | scanf("%s",str); | ^~~ | std
s552410981
p03965
C++
#define SORT(v) sort(v.begin(), v.end()) #include <iostream> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <cstdlib> #include <cstdarg> #include <cstdio> #include <cmath> #include <numeric> #include <utility> // #include "ane.cpp" #define INF (int)1e9 #define INFLL (...
/tmp/cc0IKoJy.o: in function `answer()': a.cc:(.text+0x293): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc0IKoJy.o /tmp/cc0IKoJy.o: in function `main': a.cc:(.text+0x2e0): relocation truncated to fit: R_X86_64_PC32 against symbol `Str[abi:cxx11]' defined in .bss sect...
s678409268
p03965
C++
#define SORT(v) sort(v.begin(), v.end()) #include <iostream> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <cstdlib> #include <cstdarg> #include <cstdio> #include <cmath> #include <numeric> #include <utility> // #include "ane.cpp" #define INF (int)1e9 #define INFLL (...
/tmp/ccoh2VwO.o: in function `answer()': a.cc:(.text+0x293): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccoh2VwO.o /tmp/ccoh2VwO.o: in function `main': a.cc:(.text+0x2e0): relocation truncated to fit: R_X86_64_PC32 against symbol `Str[abi:cxx11]' defined in .bss sect...
s709663727
p03965
C++
#define SORT(v) sort(v.begin(), v.end()) #include <iostream> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <cstdlib> #include <cstdarg> #include <cstdio> #include <cmath> #include <numeric> #include <utility> // #include "ane.cpp" #define INF (int)1e9 #define INFLL (...
/tmp/ccnHXVvz.o: in function `answer()': a.cc:(.text+0x293): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccnHXVvz.o /tmp/ccnHXVvz.o: in function `main': a.cc:(.text+0x2e0): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss sectio...
s785681280
p03965
C++
#include <iostream> #include <string> #include <vector> #define ll long long using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string S; cin >> S; cout << S.length() / 2 - count(S.begin(), S.end(), 'p') << endl; }
a.cc: In function 'int main()': a.cc:9:34: error: 'count' was not declared in this scope 9 | cout << S.length() / 2 - count(S.begin(), S.end(), 'p') << endl; | ^~~~~
s101958989
p03965
C++
#include <iostream> #include <string> using namespace std; int main() { int p = 0; int n = 0; string s; cin >> s; for(int i = 0; i < s.size(); i++){ if(s[i] == "p") p++; } n = s.size() / 2; cout << (int) n - p << endl; }
a.cc: In function 'int main()': a.cc:11:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | if(s[i] == "p") p++;
s118755081
p03965
C++
// // main.cpp // BC20161109 // // Created by TA on 2016/11/09. // Copyright © 2016年 TA. All rights reserved. // #include <iostream> #include <list> #include <String> using namespace std; int main(int argc, const char * argv[]) { string str; int p = 0,g = 0,count = 0 ,point = 0; while (cin >> str) { ...
a.cc:11:10: fatal error: String: No such file or directory 11 | #include <String> | ^~~~~~~~ compilation terminated.
s031930782
p03965
C++
include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <math.h> using namespace std; int main(void){ int i,j,k,t,tmp; string s; int N; int a,b,c; a=b=c=0; cin>>s; N=s.length(); for(i=0;i<N;i++){ if(s[i]=='g'){ if(a<b){ a++; c++; } else...
a.cc:1:1: error: 'include' does not name a type 1 | include <cstdio> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gn...
s564139959
p03965
C++
#include<bits/stdc++.h> using namespace std; string S; int main(){ cin>>S;int pos=(S.size()+1)/2; for(int i=0;i<pos;i++){if(S[i]=='p')cnt--;} for(int i=pos;i<S.size();i++){if(S[i]=='g')cnt++;} cout<<cnt<<endl; }
a.cc: In function 'int main()': a.cc:6:45: error: 'cnt' was not declared in this scope; did you mean 'int'? 6 | for(int i=0;i<pos;i++){if(S[i]=='p')cnt--;} | ^~~ | int a.cc:7:52: error: 'cnt' was not declared...
s109673377
p03965
C++
#include<iostream> #include<string> using namespace std; string s; int p; int main() { cin>>s; for(int i=0;i<s.length;i++){ if(s[i]=='p') p++; } cout <<s.length/2-p<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:17: 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...
s913449365
p03965
C++
#include<iostream> #include<string> string s; int p; int main() { cin>>s; for(int i=0;i<s.length;i++){ if(s[i]=='p') p++; } cout <<s.length/2-p<<endl; return 0; }
a.cc:3:1: error: 'string' does not name a type; did you mean 'stdin'? 3 | string s; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>s; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++...
s383119577
p03965
C++
#include<iostream> string s; int p; int main() { cin>>s; for(int i=0;i<s.length;i++){ if(s[i]=='p') p++; } cout <<s.length/2-p<<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:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>s; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++...
s909891954
p03965
Java
Scanner sc = new Scanner(System.in); String s = sc.nextLine(); char[] rp = s.toCharArray(); int paper = 0; int rock = 0; int win = 0; int lose = 0; int turn = 0; while(turn<rp.length){ if (rp[turn]=='g'){ if (paper<rock){ paper++; win++; } else{ rock++; } } else...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. Scanner sc = new Scanner(System.in); ^ (use --enable-preview to enable unnamed classes) Main.java:9: error: class, interface, enum, or record expected while(turn<rp.length){ ^ Main.java:13: error: class, interface, enum, or...
s500878054
p03965
C++
#include<stdio.h> char a[100010]; int main(){ int s=0,i; scanf("%s",a); for(i=0;i!='\0';i++){ if(a[i]=='g')s++; } prinf("%d",s-(i+1)/2); }
a.cc: In function 'int main()': a.cc:9:9: error: 'prinf' was not declared in this scope; did you mean 'printf'? 9 | prinf("%d",s-(i+1)/2); | ^~~~~ | printf
s647263956
p03965
C++
#include<stdio.h> char a[100010]; int main(){ int s=0 scanf("%s",a); for(i=0;a[i]!='\0';i++){ if(a[i]=='g')s++; } printf("%d",s-(i+1)/2); }
a.cc: In function 'int main()': a.cc:5:9: error: expected ',' or ';' before 'scanf' 5 | scanf("%s",a); | ^~~~~ a.cc:6:13: error: 'i' was not declared in this scope 6 | for(i=0;a[i]!='\0';i++){ | ^ a.cc:9:24: error: 'i' was not declared in this scope 9 | ...
s926366986
p03965
C++
#include<stdio.h> char a[100100]; int main() { int z,i,p=0; scanf("%s",a); z=strlen(a); for(i=0;i<z;i++) { if(a[i]=='p')p++; } printf("%d",(z/2)-p); }
a.cc: In function 'int main()': a.cc:7:3: error: 'strlen' was not declared in this scope 7 | z=strlen(a); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<stdio.h> +++ |+#include <cstring> 2 | char a[100100];
s000730168
p03965
C++
#include <stdio.h> char a[100010] int main(){ int s=0 scanf("%s",a); for(i=0;a[i]!='\0';i++){ if(a[i]=='g') s++; } printf("%d",s-i/2); }
a.cc:3:1: error: expected initializer before 'int' 3 | int main(){ | ^~~
s476731549
p03965
C++
#include<stdio.h> #include<string.h> char a[100100]; int main() { int z,i,p=0; gets(a); z=strlen(a); for(i=0;i<z;i++) { if(a[i]=='p')p++; } printf("%d",(z/2)-p); }
a.cc: In function 'int main()': a.cc:7:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s964057974
p03965
C++
#include<stdio.h> #include<cstring> char a[100100]; int main() { int z,i,p=0; gets(a); z=strlen(a); for(i=0;i<z;i++) { if(a[i]=='p')p++; } printf("%d",(z/2)-p); }
a.cc: In function 'int main()': a.cc:7:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s279756839
p03965
C++
#include<bits/stdc++.h> #define MP make_pair #define PB push_back #define PP pop_back() #define set(x,y) memset(x,y,sizeof(x)) #define MIN3(x,y,z) min(min(x,y),z) #define MAX3(x,y,z) max(max(x,y),z) #define ALL(x) x.begin(),x.end() #define sz(x) (int) x.size() #define sag(x) 2*x+1 #define sol(x) 2*x #define FOR(i,j,k) ...
a.cc: In function 'int dfs(int, int)': a.cc:30:10: error: 'len' was not declared in this scope 30 | if(n>len) return 0; | ^~~ a.cc: In function 'int main()': a.cc:42:5: error: 'len' was not declared in this scope 42 | len=strlen(s+1); | ^~~
s673916872
p03965
C++
#include <iostream> #include <cstdio> #include <cmath> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; long long g, p = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'g') g++;...
a.cc: In function 'int main()': a.cc:32:13: error: 'ans' was not declared in this scope; did you mean 'abs'? 32 | cout << ans << endl; | ^~~ | abs
s953274595
p03965
C++
#include <stdio.h> #define MAX 10000 int main() { int n = 0; char c[MAX]; c[0] = getchar(); int i=0,ans = 0; for(n = 1;c[n-1] != '\n';n++){ c[n]=getchar(); if(c[n] == 'g'){ if(i <= 0){ ans += 1 i -= 1; }else i +=1; } if(c[n] == 'p'){ if(i <= 0){ i -= 1; }else i +=1; } } p...
a.cc: In function 'int main()': a.cc:14:41: error: expected ';' before 'i' 14 | ans += 1 | ^ | ; 15 | i -= 1; | ~ ...
s216649733
p03965
C++
#include <bits/stdc++.h> #define REP(i, a, b) for (int i = a; i < (int)(b); i++) #define rep(i, n) REP(i, 0, n) using namespace std; const int INF = 1 << 7; const int M = 100000; string s; int n; int a[M][M]; int dp(int i, int j) { if (i == n) { return 0; } if (a[i][j] != INF) { return a[i][j]; } if...
a.cc: In function 'int dp(int, int)': a.cc:23:5: error: 'll' was not declared in this scope 23 | ll x = dp(i + 1, j + 1) + ((s[i] == 'g') ? 0 : -1); // gを出す | ^~ a.cc:24:7: error: expected ';' before 'y' 24 | ll y = dp(i + 1, j - 1) + ((s[i] == 'g') ? 1 : 0); // pを出す | ^~ | ...
s931956093
p03965
C++
// C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map...
/tmp/ccE4NREg.o: in function `dp(long long, long long)': a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccE4NREg.o a.cc:(.text+0x1c0): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccE4NREg.o a.cc:(.text+0...
s636033519
p03965
C++
// C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map...
/tmp/cc89DrEL.o: in function `dp(long long, long long)': a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc89DrEL.o a.cc:(.text+0x1c0): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/cc89DrEL.o a.cc:(.text+0...