submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s574904263
p03827
C++
#include <iostream> #include <string> using namespace std; int main() { int n, x[2]; x[0] = 0; cin >> n; std::string s[n]; cin >> s; for(int i=1; i<=n; i++) { if(s[i] == 'I') { x[1] = x[0] - 1; } else { x[1] = x[0] + 1; } if(x[1] > x[0]) ...
a.cc: In function 'int main()': a.cc:11:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'}) 11 | cin >> s; | ~~~ ^~ ~ | | | | | std::string [n] {aka std::...
s270163392
p03827
C++
#include <bits/stdc++.h> using namespace std; typedef long long unsigned ll; int main(){ int ret,tmp,n; char c; cin>>n; ret=tmp=0; while(n--){ c=getchar() if(c=='I') tmp++; else tmp--; ret = max(ret,tmp); } return ret; return 0; }
a.cc: In function 'int main()': a.cc:15:20: error: expected ';' before 'if' 15 | c=getchar() | ^ | ; 16 | if(c=='I') tmp++; | ~~ a.cc:17:9: error: 'else' without a previous 'if' 17 | else tmp--; | ^~...
s351004018
p03827
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); String s = sc.next(); int ans = 0; int temp = 0; for (int i = 0; i<n; i++) { if(s.charAt(i) == "I") { temp++; } else { temp...
Main.java:13: error: bad operand types for binary operator '==' if(s.charAt(i) == "I") { ^ first type: char second type: String 1 error
s103507941
p03827
C++
#include<bits/stdc++.h> using namespace std; int N; string s; int main() { cin>>N; cin>>s; int pos=0; for(int i=0;i<s.size();i++){ if(s[i]=='I') pos++; else pos--; } cout<<pos return 0; }
a.cc: In function 'int main()': a.cc:15:14: error: expected ';' before 'return' 15 | cout<<pos | ^ | ; 16 | 17 | return 0; | ~~~~~~
s860007638
p03827
C++
#include <bits/stdc++.h> #define maxn 1000000005 using namespace std; char id[maxn]; int sum[maxn]; int main() { int a; cin>>a; cin>>id; int m; sum[0]=0; for(int i=1;i<=a;i++) { if(a[i-1]='I') sum[i]=sum[i-1]+1; else sum[i]=sum[i-1]-1; } for(int i=0;i<...
a.cc: In function 'int main()': a.cc:15:13: error: invalid types 'int[int]' for array subscript 15 | if(a[i-1]='I') | ^
s459314149
p03827
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; int x=0; int max=0; cin>>s; for(int i=0;s[i]!='\0';i++){ if(s[i]=='I') x++; else(s[i]=='D') x--; if(max<x) x=max; } cout<<x<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:18: error: expected ';' before 'x' 11 | else(s[i]=='D') x--; | ^~ | ;
s777636752
p03827
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; int x=0; int max=0; for(int i=0;s[i]!='\0';i++){ if(s[i]=='I') x++; else(s[i]=='D') x--; if(max<x) x=max; } cout<<x<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: expected ';' before 'x' 10 | else(s[i]=='D') x--; | ^~ | ;
s996046309
p03827
C++
#include<iostream> #include<iostream> using namespace std; int main(){ string s; int x=0; int max=0; for(int i=0;s[i]!='\0';i++){ if(s[i]=='I') x++; else(s[i]=='D') x--; if(max<x) x=max; } cout<<x<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: expected ';' before 'x' 10 | else(s[i]=='D') x--; | ^~ | ;
s818060898
p03827
C
#include<stdio.h> int main() { int x=0,N,i,y; char s[105]; scanf("%d\n",N); for(i=0;i<105;i++){ scanf("%c",&s[i]); } for(i=0;i<105;i++) { if(s[i]=='I'){ y=x+1;} else(s[i]=='D'){ y=x-1;} if(x>y) ; else(y>x) x=y;} return 0; }
main.c: In function 'main': main.c:14:40: error: expected ';' before '{' token 14 | else(s[i]=='D'){ | ^ | ; main.c:18:41: error: 'else' without a previous 'if' 18 | ...
s713222126
p03827
C
#include<stdio.h> int main() { int x=0,N,i,y; char s[105]; scanf("%d\n",N); for(i=0;i<105;i++){ scanf("%c",&s[i]); } for(i=0;i<105;i++) { if(s[i]=='I') y=x+1; else(s[i]=='D') y=x-1; if(x>y) ; else(y>x) x=y;} return 0; }
main.c: In function 'main': main.c:14:40: error: expected ';' before 'y' 14 | else(s[i]=='D') | ^ | ; 15 | y=x-1; | ~ main....
s038648803
p03827
C++
#include<stdio.h> int main() { int x=0,N,i,y; char s[105]; scanf("%d\n",N); for(i=0;i<105;i++){ scanf("%c",&s[i]); } for(i=0;i<105;i++) { if(s[i]=='I') y=x+1; else(s[i]=='D') y=x-1; if(x>y) ; else(y>x) x=y;} return 0; }
a.cc: In function 'int main()': a.cc:14:40: error: expected ';' before 'y' 14 | else(s[i]=='D') | ^ | ; 15 | y=x-1; | ~ a.c...
s161977418
p03827
C
#include<stdio.h> int main() { int x=0,N,i,y; char s[105]; scanf("%d\n",N); for(i=0;i<105;i++){ scanf("%c",&s[i]); } for(i=0;i<105;i++) { if(s[i]==I) y=x+1; else(s[i]==D) y=x-1; if(x>y) ; else(y>x) x=y;} return 0; }
main.c: In function 'main': main.c:12:26: error: 'I' undeclared (first use in this function) 12 | if(s[i]==I) | ^ main.c:12:26: note: each undeclared identifier is reported only once for each function it appears in main.c:14:36: error: 'D' undeclared (first use in this ...
s865885576
p03827
C
#include<stdio.h> int main() { int x=0,N,i,y; char s[105],I,D; scanf("%d\n",N); for(i=0;i<105;i++){ scanf("%c",&s[i]); } for(i=0;i<105;i++) { if(s[i]=I) y=x+1; else(s[i]=D) y=x-1; if(x>y) ; else(y>x) x=y;} return 0; }
main.c: In function 'main': main.c:14:37: error: expected ';' before 'y' 14 | else(s[i]=D) | ^ | ; 15 | y=x-1; | ~ main.c:18:50: err...
s857459315
p03827
C
#include<stdio.h> int main() { int x=0,N,i,y; char s[105]; scanf("%d\n",N); for(i=0;i<105;i++){ scanf("%c",&s[i]); } for(i=0;i<105;i++) { if(s[i]=I) y=x+1; else(s[i]=D) y=x-1; if(x>y) ; else(y>x) x=y;} return 0; }
main.c: In function 'main': main.c:12:25: error: 'I' undeclared (first use in this function) 12 | if(s[i]=I) | ^ main.c:12:25: note: each undeclared identifier is reported only once for each function it appears in main.c:14:35: error: 'D' undeclared (first use in this fu...
s264538061
p03827
C
#include<stdio.h> int main() { int x=0,N,i,y; char S[105]; scanf("%d\n",N); for(i=0;i<105;i++){ scanf("%c",&s[i]); } for(i=0;i<105;i++) { if(S[i]=I) y=x+1; else(S[i]=D) y=x-1; if(x>y) ; else(y>x) x=y;} return 0; }
main.c: In function 'main': main.c:8:29: error: 's' undeclared (first use in this function) 8 | scanf("%c",&s[i]); | ^ main.c:8:29: note: each undeclared identifier is reported only once for each function it appears in main.c:12:25: error: 'I' undeclared (first use ...
s547829254
p03827
C
#include<stdio.h> int main() { int x=0,N,i,y; char S[105]; scanf("%d\n%c\n",N,S[105]); for(i=0;i<105;i++){ if(S[i]=I) y=x+1; else(S[i]=D) y=x-1; if(x>y) ; else(y>x) x=y;} return 0; }
main.c: In function 'main': main.c:8:25: error: 'I' undeclared (first use in this function) 8 | if(S[i]=I) | ^ main.c:8:25: note: each undeclared identifier is reported only once for each function it appears in main.c:10:35: error: 'D' undeclared (first use in this func...
s436556644
p03827
C++
#include <cstdio> #include <iostream> #include<algorithm> using namespace std; char s[110]; int n,pos,maxn; int main() { scanf("%d%s",&n,s+1); for(int i=1;i<=n;++i) { if(s[i]=='I') ++ans; else --ans; maxn=max(maxn,ans); } printf("%d\n",maxn); return 0; }
a.cc: In function 'int main()': a.cc:13:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | if(s[i]=='I') ++ans; | ^~~ | abs a.cc:14:16: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | else --an...
s652573329
p03827
C
#include<stdio.h> int main(){ int x,i,max; int S[N]; max=S[0] for(i=1;i<=N;i++){ if(S[i]=i) printf("x-1"); if else(S[i]=D) printf("x+1"); if(S[i]>max) printf("%d",S[i]");} return 0; }
main.c: In function 'main': main.c:4:9: error: 'N' undeclared (first use in this function) 4 | int S[N]; | ^ main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in main.c:5:11: error: expected ';' before 'for' 5 | max=S[0] | ^ |...
s511275526
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() { int s,a[s+1],d=0; cn>>s; for(int j=1;j<=s;j++) { if(a[j]=i) d++; else d--; } cout<<d<<endl return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'cn' was not declared in this scope; did you mean 'yn'? 6 | cn>>s; | ^~ | yn a.cc:9:17: error: 'i' was not declared in this scope 9 | if(a[j]=i) | ^ a.cc:14:22: error: expected ';' before 'return' 14 | ...
s964700972
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,i,j,cnt=0,m=0; string s; cin>>n; cin>>s; for(i=0;i<s.size();i++){ if(s[i]=='I'){ cnt++; m=max(m,cnt) }else{ cnt--; } } cout<<m; }
a.cc: In function 'int main()': a.cc:12:19: error: expected ';' before '}' token 12 | m=max(m,cnt) | ^ | ; 13 | }else{ | ~
s392215312
p03827
C++
#include<bits/stdc++.h> using namespace std; int n,h,ans; int main() { cin>>n; for(int i=1;i<=n;++i) { char s;cin>>s; if(s[i]=='I')h++; if(s[i]=='D')h--; ans=max(ans,h); } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: invalid types 'char[int]' for array subscript 10 | if(s[i]=='I')h++; | ^ a.cc:11:13: error: invalid types 'char[int]' for array subscript 11 | if(s[i]=='D')h--; | ^
s671313972
p03827
C++
int a, ans = 0; cin >> a; char c; while(cin >> c) c == 'I' ? ans++ : ans--; cout << ans; }
a.cc:1:21: error: 'cin' does not name a type 1 | int a, ans = 0; cin >> a; | ^~~ a.cc:3:5: error: expected unqualified-id before 'while' 3 | while(cin >> c) | ^~~~~ a.cc:5:5: error: 'cout' does not name a type 5 | cout << ans; | ^~~~ a.cc:6:1: error:...
s434413216
p03827
C++
#include<bits/stdc++.h> using namespace std; char l[105]; int main() { int a,b=0,i,j; cin>>a; for(i=1;i<=a;i++) { cin>>a[i]; if(a[i]=='I') b++; else b--; } cout<<b; }
a.cc: In function 'int main()': a.cc:10:15: error: invalid types 'int[int]' for array subscript 10 | cin>>a[i]; | ^ a.cc:11:13: error: invalid types 'int[int]' for array subscript 11 | if(a[i]=='I') | ^
s916684388
p03827
C++
x=0 res=0 n=int(input()) s=input() for i in range(n): if s[i]=='I':x+=1 else:x-=1 res=max(res,x) print(x)
a.cc:1:1: error: 'x' does not name a type 1 | x=0 | ^
s816963956
p03827
C++
# include <iostream> using namespace std; int main(void){ int N; int num[110]; int count, ans = 0; string S; cin >> N; cin >> S; for (int i = 0; i <N; i++){ char *c = S[i]; if (c == "I") count+= 1; if (c == "D") count-=1; ans = max(ans, count); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:18: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'char*' [-fpermissive] 13 | char *c = S[i]; | ^ | | | __gnu_cxx::__alloc_traits<std::...
s508308732
p03827
C++
# include <iostream> using namespace std; int main(void){ int N; int num[110]; int count, ans = 0; string S; cin >> N; cin >> S; for (int i = 0; i <N; i++){ char c = S[i]; if (c == "I") count+= 1; if (c == "D") count-=1; ans = max(ans, count); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if (c == "I") count+= 1; | ~~^~~~~~ a.cc:15:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if (c == "D") count-=1; | ...
s059478501
p03827
C++
# include <iostream> using namespace std; int main(void){ int N; int num[110]; int count, ans = 0; string S; cin >> N; cin >> S; for (int i = 0; i <N; i++){ if (S[i] == "I") count+= 1; if (S[i] == "D") count-=1; ans = max(ans, count); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | if (S[i] == "I") count+= 1; a.cc:14:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if (S[i] == "D") count-=1;
s722138298
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int ans,x; ans=0; for(int i=O;i<s.size();i++){ if(s.at(i)=='I'){ x++; if(ans<x){ ans=x; } } if(s.at(i)=='D'){ x--; } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:13: error: 'O' was not declared in this scope 9 | for(int i=O;i<s.size();i++){ | ^
s347303409
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int cnt = 0; vector<int> a(n); if(s.at(0) == 'I'){ a.at(0) = 1; } else { a.at(0) = -1; } for(int i=1;i<n;i++){ if(s.at(i) == 'I'){ a.at(i) = a.at(i-1) +1; } else { ...
a.cc: In function 'int main()': a.cc:26:13: error: expected unqualified-id before '(' token 26 | cout << a.(n-1) << endl; | ^
s536372379
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int cnt = 0; vector<int> a(n); if(s.at(i) == 'I'){ a.at(i) = 1; } else { a.at(i) = -1; } for(int i=1;i<n;i++){ if(s.at(i) == 'I'){ a.at(i) = a.at(i-1) +1; } else { ...
a.cc: In function 'int main()': a.cc:11:11: error: 'i' was not declared in this scope 11 | if(s.at(i) == 'I'){ | ^ a.cc:26:13: error: expected unqualified-id before '(' token 26 | cout << a.(n-1) << endl; | ^
s662415968
p03827
C++
N = int(input()) S = input() x = 0 ans = x for s in S: if s == "I": x += 1 else: x -= 1 ans = max(ans, x) print(ans)
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s906718993
p03827
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main(){ int n; cin>>n; string s; cin <<s; int a=0; int b=0; for(int i=0;i<n;i++){ if(s[i]=='I'){ a++; }else{ a--; } b=max(a,b); } cout<<b; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 8 | cin <<s; | ~~~ ^~~ | | | | | std::string {aka std::__cxx11::basic_st...
s803312750
p03827
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main(){ int n; cin>>n; string s; cin <<s; int a=0; int b=0; for(int i=0;i<n;i++){ if(s[i]=='I'){ a++; }else{ a--; } b=max(a,b) } cout<<b; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 8 | cin <<s; | ~~~ ^~~ | | | | | std::string {aka std::__cxx11::basic_st...
s137602811
p03827
C++
#include <iostream> using namespace std; int main() { int n,height=0,maxHeight=0; char c; cin>>n; for(int i=0;i<n;i++) { cin>>c; if(c == 'I') { height++; if(height>maxHeight) maxHeight=height; } else if(c == 'D') ...
a.cc: In function 'int main()': a.cc:21:12: error: unable to find numeric literal operator 'operator""\U0000ff1b' 21 | return 0; | ^~~ a.cc:21:15: error: expected ';' before '}' token 21 | return 0; | ^ | ; 22 | } | ~
s958466628
p03827
C++
#include <iostream> using namespace std; int main() { int n,height=0,maxHeight=0; char c; cin>>n; for(int i=0;i<n;i++) { cin>>c; if(c == 'I') { height++; if(height>maxHeight) maxHeight=height; } else if(c == 'D') ...
a.cc: In function 'int main()': a.cc:21:5: error: return-statement with no value, in function returning 'int' [-fpermissive] 21 | return ; | ^~~~~~
s951685137
p03827
C++
#include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<iomanip> using namespace std; int main() { int n; int max=-1; int hb=0; char a[101]; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; if(a[i]=='I') hb++; if(a[i]=='D') hb--; if(hb>max) max=hb; } cout<<max<<endl; return 0; }#inclu...
a.cc:23:2: error: stray '#' in program 23 | }#include<iostream> | ^ a.cc:23:3: error: 'include' does not name a type 23 | }#include<iostream> | ^~~~~~~ a.cc:29:5: error: redefinition of 'int main()' 29 | int main() | ^~~~ a.cc:7:5: note: 'int main()' previously defined here 7 | int...
s185812563
p03827
C++
int main(){ int N; cin >> N; string S; cin >> S; int ans = 0; int sum = 0; for(int i = 0;i < N;i++){ if(S.at(i) == 'I'){ sum++; } else{ sum--; } ans = max(ans,sum); } cout << ans; }
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> N; | ^~~ a.cc:5:5: error: 'string' was not declared in this scope 5 | string S; | ^~~~~~ a.cc:6:12: error: 'S' was not declared in this scope 6 | cin >> S; | ^ a....
s032587879
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { string S ; int N ,m ; int x=0; set<int > d; cin >> N>>S; for(int i =0 ; i<N; i++) { if (S[i]=='I') x++; if (S[i]=='D') x--; d.insert(x); } if (x<=0) cout << 0; else cout << (d.size());
a.cc: In function 'int main()': a.cc:25:24: error: expected '}' at end of input 25 | cout << (d.size()); | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s186810637
p03827
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<fstream> #include<cstdlib> #include<iomanip> #include<string> #include<cstring> #include<cmath> #include<cfloat> using namespace std; int main() { int n; cin>>n; int hb=0,maxi=0; for(int i=0;i<n;i++) { char t; cin>>t; ...
a.cc: In function 'int main()': a.cc:26:15: error: expected ';' before 'exit' 26 | cout<<maxi | ^ | ; 27 | exit(0); | ~~~~
s290235822
p03827
C++
#include<bits/stdc++.h> using namespace std; char h[500]; int main() { int s=0,I,D,n; cin>>n; for(int i=0;i<n;i++) cin>>h[i]; for(int i=0;i<=n;i++) {if(h[i]=='I') s+=1; if(h[i]=='D') s-=1;} cout<<s<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: unable to find numeric literal operator 'operator""\U0000ff1b' 12 | return 0; | ^~~ a.cc:12:19: error: expected ';' before '}' token 12 | return 0; | ^ | ; ...... 16 | } ...
s890430038
p03827
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef ...
a.cc: In function 'int main()': a.cc:51:19: error: 'emdl' was not declared in this scope 51 | cout << ma << emdl; | ^~~~
s652778991
p03827
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef ...
a.cc: In function 'int main()': a.cc:46:26: error: 'curret' was not declared in this scope; did you mean 'current'? 46 | ma = max(ma, curret); | ^~~~~~ | current a.cc:48:13: error: 'curret' was not declared in this scope; did you mean 'current...
s474673221
p03827
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef ...
a.cc: In function 'int main()': a.cc:45:13: error: 'curren' was not declared in this scope; did you mean 'curret'? 45 | curren++; | ^~~~~~ | curret a.cc:51:19: error: 'emdl' was not declared in this scope 51 | cout << ma << emdl; | ^~~~
s473920584
p03827
C++
#include<bits/stdc++.h> using namespace std; string s; long long pos=0; long long maxn=0,n; int main() { scanf("%d%s",&n,s+1); for(int i=1;i<=n;++i) { if(s[i]=='I') ++pos; else --pos; maxn=max(maxn,pos); } printf("%d\n",maxn); return 0; }
a.cc: In function 'int main()': a.cc:8:27: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 8 | scanf("%d%s",&n,s+1); | ~^~ | | | | | int | ...
s625029938
p03827
C++
#include<bits/stdc++.h> using namespace std; string s; long long pos=0; long long maxn=0; int main() { scanf("%d%s",&n,s+1); for(int i=1;i<=n;++i) { if(s[i]=='I') ++pos; else --pos; maxn=max(maxn,pos); } printf("%d\n",maxn); return 0; }
a.cc: In function 'int main()': a.cc:8:24: error: 'n' was not declared in this scope; did you mean 'yn'? 8 | scanf("%d%s",&n,s+1); | ^ | yn a.cc:8:27: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<...
s870497313
p03827
C++
#include<bits/stdc++.h> using namespace std; string s; long long pos=0; long long maxn=0; int main() { scanf("%d%s",&n,s+1); for(int i=1;i<=n;++i) { if(s[i]=='I') ++pos; else --pos; maxn=max(maxn,pos); } printf("%d\n",maxn);/ return 0; }
a.cc: In function 'int main()': a.cc:8:24: error: 'n' was not declared in this scope; did you mean 'yn'? 8 | scanf("%d%s",&n,s+1); | ^ | yn a.cc:8:27: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<...
s291302702
p03827
C++
#include<bits/stdc++.h> using namespace std; string s; int main() { long long n,ans=0; cin>>n; for(int i=1;i<=n;i++){ cin>>s[i]; } int maxn=0; for(int i=1;i<=n;i++){ if(s[i]=='I'){ ans++; maxn=max(maxn,ans); } else if(s[i]=='D'){ ans--; } } cout<<maxn<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:15:33: error: no matching function for call to 'max(int&, long long int&)' 15 | maxn=max(maxn,ans); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-g...
s767636790
p03827
C++
#include <iostream> using namespace std; int main() { int n,ans=-INT_MAX,t=0; char c[101]; cin>>n>>c; for(int i=0;i<n;i++) { if(c[i]=='I') t++; else t--; ans=max(ans,t); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:20: error: 'INT_MAX' was not declared in this scope 5 | int n,ans=-INT_MAX,t=0; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#i...
s827349647
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ int q=0,a,b,d; string c; cin>>a>>c; for(int i=0;i<a;i++){ if(a[i]=='D') b++; } d=a-b; if(d-b<=0) cout<<"0"; else cout<<d-b; cout<<"\n"; }
a.cc: In function 'int main()': a.cc:8:13: error: invalid types 'int[int]' for array subscript 8 | if(a[i]=='D') b++; | ^
s857076690
p03827
C++
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <algorithm> // sort #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll MOD = 1000000007; static const ll INF = 1000000000000000000LL; using namespace std; int main(){ // std::ifstream in(...
a.cc: In function 'int main()': a.cc:23:5: error: 'res' was not declared in this scope 23 | res = 0; | ^~~
s348907622
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0,max=0; char s[105]; scanf("%d",&n); scanf("%s",s); for(int i=0;i<n;i++){ if(s[i] == 'I'){ sum++ } else{ sum--; } if(sum > max){ max = sum; } } printf("%d",max); }
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before '}' token 10 | sum++ | ^ | ; 11 | } | ~
s903071494
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0,max=0; char s[105]; scanf("%d",&n); scanf("%s",s); for(int i=0;i<n;i++){ if(s[i] == 'I'){ sum++'' } else{ sum--; } if(sum > max){ max = sum; } } printf("%d",max); }
a.cc:10:30: error: empty character constant 10 | sum++'' | ^~ a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before '\x0' 10 | sum++'' | ^~ | ;
s201557773
p03827
C++
#include <iostream> #include <string> using namespace std; int main(){ int N; cin>>N; cin>>S; int ans=0; int tmp=0; for (int i=0;i<S.size();++i){ if (S[i]=='I'){ tmp+=1; } else tmp-=1; if (ans<tmp){ ans=tmp; } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:7:8: error: 'S' was not declared in this scope 7 | cin>>S; | ^
s630816602
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; string s; cin >> s; int mx = 0; int tmp = 0; for(int i=0;i<s.size();i++){ if(s[i] == I) tmp++; else tmp--; mx = max(mx, tmp); } cout << mx << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: 'I' was not declared in this scope 9 | if(s[i] == I) tmp++; | ^
s529468254
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >>> n; string s; cin >> s; int mx = 0; int tmp = 0; for(int i=0;i<s.size();i++){ if(s[i] == 'I') tmp++; else tmp--; mx = max(mx, tmp); } cout << mx << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: expected primary-expression before '>' token 6 | int n; cin >>> n; string s; cin >> s; | ^
s668867277
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >>> n; string s; cin >> s; int mx = 0; int tmp = 0; for(int i=0;i<s.size();i++){ if(s[i] == I) tmp++; else tmp--; mx = max(mx, tmp); } cout << mx << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: expected primary-expression before '>' token 6 | int n; cin >>> n; string s; cin >> s; | ^ a.cc:9:16: error: 'I' was not declared in this scope 9 | if(s[i] == I) tmp++; | ^
s273013452
p03827
C++
#include<bits/stdc++.h> using namespace std; char s; long long int ans=0,ansn=0,n; int main(){ cin>>n for(int i=1;i<=n;i++) { cin>>s; if(s=='I') ansn++; else if(s=='D') ansn--; ans=max(ans,ansn); } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:6:11: error: expected ';' before 'for' 6 | cin>>n | ^ | ; 7 | for(int i=1;i<=n;i++) | ~~~ a.cc:7:17: error: 'i' was not declared in this scope 7 | for(int i=1;i<=n;i++) | ^
s710549402
p03827
C++
#include<cstdio> #include<cstdlib> #include<algorithm> #include<iostream> #include<queue> #include<vector> #include<bitset> #include<math.h> using namespace std; #define INF 110000000000 #define MOD 1000000007 typedef long long ll; typedef pair<int,int> P; int main(){ int N,x,ans=0; string s; cin>>N>>s; for(...
a.cc: In function 'int main()': a.cc:22:8: error: 'S' was not declared in this scope 22 | if(S[i]=='I') x++; | ^
s919096223
p03827
C++
#incude<bits/stdc++.h> using namespace std; int N; string S; int main () { cin >> N >> S; int count = 0, ans = 0; for (int i = 0; i < N; i++){ if (S[i] == 'I'){ count++; }else{ count--; } if (ans < count){ ans = count; } } cout << ans << endl; }
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include? 1 | #incude<bits/stdc++.h> | ^~~~~~ | include a.cc:5:1: error: 'string' does not name a type 5 | string S; | ^~~~~~ a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope 8 | ...
s061586985
p03827
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); int count = 0; int max = 0; for(int i = 0;i < s.length;i++){ if(s.substring(i,i+1).equals("I")){ count++; max = Math.max(max,...
Main.java:8: error: cannot find symbol for(int i = 0;i < s.length;i++){ ^ symbol: variable length location: variable s of type String 1 error
s553628576
p03827
C++
#include <iostream> #include <string> using namespace std; int main(void){ int x = 0; int N; string S; cin >> N >> S; int i = 1; while (S[N - i] == 'D') i++; for (; i <= N; i++){ if(S[N - i] == 'I') { x++; } else x--; } cout << x>0?x:0; }
a.cc: In function 'int main()': a.cc:17:14: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int') 17 | cout << x>0?x:0; | ~~~~~~~~~^~ | | | | | int | std::basic_ostream<char> a.cc:17:14: note: candidate: 'operator>(in...
s969966708
p03827
C++
#include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <string> #include <cmath> #include <cassert> #include <functional> #include <string> #include <sstream> #include <cctype> using namespace std; int main(){ int N; cin >> N; strng S; cin >> S; int x = 0; int max = x; for(int...
a.cc: In function 'int main()': a.cc:16:3: error: 'strng' was not declared in this scope 16 | strng S; cin >> S; | ^~~~~ a.cc:16:19: error: 'S' was not declared in this scope 16 | strng S; cin >> S; | ^
s878032418
p03827
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) int main(){ int N; string S; cin >> N >> S; int Xa = 0; int MaxX = Xa; rep(i, N){ if(S.at(i) == 'I'){ Xa++; MaxX = max(MaxX, Xa); } else { Xa--; } } cout << maxX << endl; }
a.cc: In function 'int main()': a.cc:19:17: error: 'maxX' was not declared in this scope; did you mean 'MaxX'? 19 | cout << maxX << endl; | ^~~~ | MaxX
s473096632
p03827
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) int main(){ int N; string S; cin >> N >> S; int Xa = 0; int MaxX = Xa; rep(i, N){ if(S.at(i) == 'I'){ X++; MaxX = max(MaxX, Xa); } else { X--; } } cout << maxX << endl; }
a.cc: In function 'int main()': a.cc:13:25: error: 'X' was not declared in this scope 13 | X++; | ^ a.cc:16:25: error: 'X' was not declared in this scope 16 | X--; | ^ a.cc:19:17: error: 'maxX' was not decl...
s165378651
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; vector<string> s; cin >> n; cin >> s; int x = 0; int ans = 0; for(int i=0; i < n; i++){ if(s.at(i) == "I"){ x = x + 1; ans = max(ans,x); } else if(s.at(i) == "D"){ x = x - 1; } } cout << ans << endl; }
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<std::__cxx11::basic_string<char> >') 8 | cin >> s; | ~~~ ^~ ~ | | | | | std::vector<std::__cxx11::basic_string<char> > ...
s053215145
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; string str; cin >> n; cin >> str; int x = 0; int ans = 0; for(int i=0; i < n; i++){ if(str.at(i) == "I"){ x = x + 1; ans = max(ans,x); } else if(str.at(i) == "D"){ x = x - 1; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if(str.at(i) == "I"){ | ~~~~~~~~~~^~~~~~ a.cc:17:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 17 | } else if(str.at(i) == "D"){ ...
s552011447
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin >> s; int x = 0; int ans = 0; vector<str> str; for(int i=0; i<n; i++){ if(str.at(i) == "I"){ x = x + 1; int ans = max(ans,x); } else if(str.at(i) == "D"){ x = x - 1; } } cout << ans << end...
a.cc: In function 'int main()': a.cc:12:10: error: 'str' was not declared in this scope; did you mean 'std'? 12 | vector<str> str; | ^~~ | std a.cc:12:13: error: template argument 1 is invalid 12 | vector<str> str; | ^ a.cc:12:13: error: template argument 2 is i...
s751544292
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin >> s; int x = 0; int ans = 0; vector<str> str; for(int i=0; i<n; i++){ if(str.at(i) == "I"){ x = x + 1; int ans = max(ans,x); } else if(str.at(i) == "D"){ x = x - 1; } cout << ans << endl; }...
a.cc: In function 'int main()': a.cc:12:10: error: 'str' was not declared in this scope; did you mean 'std'? 12 | vector<str> str; | ^~~ | std a.cc:12:13: error: template argument 1 is invalid 12 | vector<str> str; | ^ a.cc:12:13: error: template argument 2 is i...
s795377064
p03827
C++
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <cmath> #include <deque> #include <iterator> #include <map> #include <queue> #include <stack> #include <string> #include <tuple> #include <utility> #include <limits> #include <iomanip> using namespace std; using ll=long long; template<c...
a.cc: In function 'int main()': a.cc:37:23: error: expected ';' before 'x' 37 | else (s[i] == 'D') x--; | ^~ | ;
s206389108
p03827
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int x=0 , max=0; for (int i=0 ; i<n ; i++){ if(s[i]=='I'){ x++; if(x>max) max=x; }else if (s[i]=='D'){ x--; } } ...
a.cc:29:5: error: redefinition of 'int main()' 29 | int main() | ^~~~ a.cc:5:5: note: 'int main()' previously defined here 5 | int main() | ^~~~
s819291146
p03827
C++
#include<iostream> using namespace std; int main() { int n,m,temp,x=0; char a[101]; int b[100]={0}; cin>>n; if((n>=1)&&(n<=100)) for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]=='I'){ ++x; b[i]=x;} else if(a[i]=='D'){ --x; ...
a.cc:28:12: error: expected unqualified-id before 'if' 28 | if(b[n-1>0]) | ^~ a.cc:30:12: error: expected unqualified-id before 'else' 30 | else | ^~~~ a.cc:35:5: error: expected unqualified-id before 'return' 35 | return 0; | ^~~~~~ a.cc:36...
s160202790
p03827
C++
#include<iostream> using namespace std; int main() { int n,m,temp,x=0; char[101]; int b[100]={0}; cin>>n; if((n>=1)&&(n<=100)) for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]=='I'){ ++x; b[i]=x;} else if(a[i]=='D'){ --x; ...
a.cc: In function 'int main()': a.cc:6:10: error: expected identifier before numeric constant 6 | char[101]; | ^~~ a.cc:6:10: error: expected ']' before numeric constant 6 | char[101]; | ^~~ | ] a.cc:6:9: error: structured binding declaration cannot have type...
s530935359
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,x = 0,maxi = 0; string s; cin >> n >> s; for(int i = 0; i < n; i++){ if(s.at(i) == 'I'){ x++; maxi = max(maxi,x); }else{ x--; } cout << maxi << endl; }
a.cc: In function 'int main()': a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s515336652
p03827
C++
#include<iostream> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main() { int ans=0; int sum=0; int N; string S; cin >> N >>S; rep(i,N) { if(S[i]=="I") { sum++; if(sum>ans) { ans=sum; } } else { sum--; } } cout << ans <<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | if(S[i]=="I")
s896372934
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ inr n=0,count=0,max=0; string s; cin>>n>>s; for(int j=0;j<n;j++){ if(s[j]=='I') count++; else count--; if(max>count) max=count; } cout<<max; }
a.cc: In function 'int main()': a.cc:4:9: error: 'inr' was not declared in this scope; did you mean 'int'? 4 | inr n=0,count=0,max=0; | ^~~ | int a.cc:6:14: error: 'n' was not declared in this scope 6 | cin>>n>>s; | ^ a.cc:9:25: error: no post-incre...
s016105538
p03827
Java
public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int N = sc.nextInt(); String S = sc.next(); int res = 0; int count = 0; for(int i = 0; i < N; i++) { if('I' == S.charAt(i)) count++; else count--; res = Math.max(res, count); } Syst...
Main.java:4: error: cannot find symbol try (Scanner sc = new Scanner(System.in)) { ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol try (Scanner sc = new Scanner(System.in)) { ^ symbol: class Scanner location: class Main 2 errors
s925465302
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() { int n, I ,x=0 ,in=0; scanf("%d",&n); string s; cin>>s; for(int i=0 ;i<n;i++) if(s[i]=='I') { x++; I++; } else { x--; I+=0; } for( i=0 ;x<n;x++) int f=max(x,I-1); cout<<f; }**/
a.cc: In function 'int main()': a.cc:22:23: error: 'i' was not declared in this scope 22 | for( i=0 ;x<n;x++) | ^ a.cc:27:15: error: 'f' was not declared in this scope 27 | cout<<f; | ^ a.cc: At global scope: a.cc:29:4: error: expected unqua...
s982592235
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,max; string S; cin>>N>>S; int x=0; vector<int> a(N); for(int i=0;i<N;i++){ if(S.at(i)='I') x++; else x--; a.at(i)=x; } max=0; for(int i=0;i<N;i++){ if(max<a.at(i);) max=a.at(i); } cout<<max<<endl; }
a.cc: In function 'int main()': a.cc:14:20: error: expected primary-expression before ')' token 14 | if(max<a.at(i);) max=a.at(i); | ^
s526006962
p03827
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; string S; cin>>N>>S; int x=0; for(int i=0;i<N;i++){ if(S.at(i)='I') x++; else x--; } cout<<x<<endl;
a.cc: In function 'int main()': a.cc:11:17: error: expected '}' at end of input 11 | cout<<x<<endl; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s898027029
p03827
C++
(let ((n (read)) (s (read-line)) (ans 0) (ans-max 0)) (loop for i across s do (if (eq i #\D) (decf ans) (progn (incf ans) (setf ans-max (max ans ans-max))))) (princ ans-max))
a.cc:6:25: error: stray '#' in program 6 | do (if (eq i #\D) (decf ans) | ^ a.cc:6:26: error: stray '\' in program 6 | do (if (eq i #\D) (decf ans) | ^ a.cc:1:5: error: expected ')' before '(' token 1 | (let ((n (read)) ...
s848531948
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() { int a , b=0 , m=0; cin>>a; char s[a]; for(int i=0; i<=n ;i++){ cin>>s[i]; if(s[i]=='I'){ ++b; ++i; } else if (s[i]=='D'){ --b; ++i; } if (b>m) ...
a.cc: In function 'int main()': a.cc:8:21: error: 'n' was not declared in this scope 8 | for(int i=0; i<=n ;i++){ | ^
s881171867
p03827
C++
#include<iostream> using namespace std; int main() { int N,maxm,x=0; cin>>N; char S[N]; for(int i=0;i<N;i++){ cin>>S[i]; if(S[i]=='I') { x++;} else if(S[i]=='D') {x--;} if(x>=maxm) maxm=x; }
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s725564546
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() { int a , b=0 , m=0; cin>>a; char s[a]; for(int i=0; i<=n ;){ cin>>s[i]; if(s[i]=='I'){ ++b; ++i; } else if (s[i]=='D'){ --b; ++i; } if (b>m) m=...
a.cc: In function 'int main()': a.cc:8:21: error: 'n' was not declared in this scope 8 | for(int i=0; i<=n ;){ | ^
s671588068
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() { int x=0,Y=0,n; cin>>n; char s[n]; for(int i=0;i<n;i++) { scanf("%c",&s[i]); if(s[i]=='I'||s[i]=='D') { if(s[i]=='D') { x--; } if(s[i]=='I') { x++; } } } if(x>=0) { cout<<x; } else { cout<<"x=0" } ; ...
a.cc: In function 'int main()': a.cc:33:28: error: expected ';' before '}' token 33 | cout<<"x=0" | ^ | ; 34 | } | ~
s546363336
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() { int a , w=0 , m=0; cin>>a; char s[a]; for(int i=0; i<=n ;){ cin>>s[i]; if(s[i]=='I'){ ++w; ++i; } else if (s[i]=='D'){ --w; ++i; } if (w>m) m=...
a.cc: In function 'int main()': a.cc:8:21: error: 'n' was not declared in this scope 8 | for(int i=0; i<=n ;){ | ^
s551377959
p03827
C++
#include<bits\stdc++.h> using namespace std; int main(){ int n; int X=0; int MX=0; cin>>n; char s[n]; cin>>s; for(int i=0;i<n;i++){ if(s[i]=='I') X++; MX=max(X,MX); if(s[i]=='D') abs(X--); } cout<<MX; return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s054486535
p03827
C++
#include<iostream> using namespace std; int main(){ int n,x=0; cin>> n; if((n>=1)&&(n<=100)){ char a[n]; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]=='I') x++; else if x--; else break; }} cout<<++x; return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: expected '(' before 'x' 15 | x--; | ^ | ( a.cc:16:17: error: 'else' without a previous 'if' 16 | else | ^~~~
s226072659
p03827
C++
ank (92:21:37) 3 Comments A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Time limit 2000 ms Memory limit 262144 kB H - Increment Decrement All Copyright Reserved © 2010-2019 Xu Han Server Time: 2019-07-16 12:52:00 UTC+2 #20490016 | Nermeenatalla's solution for [Problem H] Status Wrong Answer Length ...
a.cc:36:24: error: extended character © is not valid in an identifier 36 | All Copyright Reserved © 2010-2019 Xu Han | ^ a.cc:39:11: error: "|" is not a valid filename 39 | #20490016 | Nermeenatalla's solution for [Problem H] | ^ a.cc:39:26: warning: missing terminatin...
s834588852
p03827
C++
#include <iostream> using namespace std; int main(){ int s,k; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if((z>=0)&&(z<=k){ count ++; }}}} cout<<count; return 0; }
a.cc:1:21: warning: extra tokens at end of #include directive 1 | #include <iostream> using namespace std; int main(){ int s,k; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if((z>=0)&&(z<=k){ count ++; }}}} cout<<count; return 0; } | ^~~~~ /usr/bin/ld: /usr/lib...
s173269303
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() {int n;cin>>n;string s;cin>>s; int x=0,mx=0; for(int i=0;i<n;i++) {if(s[i]=='I') {x++; } mx=max(x,mx); } if(s[i]=='D') {x--; } cout<<mx; return 0; }
a.cc: In function 'int main()': a.cc:12:6: error: 'i' was not declared in this scope 12 | if(s[i]=='D') | ^
s482742282
p03827
C++
#include<iostream> using namespace std; int main(){ int N,x=0; cin>>N; string S; cin>>S; for(int i=0;i<=N;i++){ if(S =="I") x+=1; else x-=1; } if(x>x+1){ cout<<x; }
a.cc: In function 'int main()': a.cc:16:18: error: expected '}' at end of input 16 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s861966620
p03827
C++
using namespace std; int main() { int n , max , count=0; scanf("%d", &n) ; char c[n]; scanf("%s" , &c) ; for(int i=0; i<n-1 ; i++ ) { if (c[i]== 'I') { max=count; count++; if (max<count) max=count; } else{ count--; } } if(max>=0) printf("%d" , max); return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: 'scanf' was not declared in this scope 4 | scanf("%d", &n) ; | ^~~~~ a.cc:26:1: error: 'printf' was not declared in this scope 26 | printf("%d" , max); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by addin...
s681803426
p03827
C++
using namespace std; int main() { int n , max , count=0; scanf("%d", &n) ; char c[n]; scanf("%s" , &c) ; for(int i=0; i<n-1 ; i++ ) { if (c[i]== 'I') { max=count; count++; if (max<count) max=count; } else{ count--; } } if(max>=0) printf("%d" , max); else printf("0"); return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: 'scanf' was not declared in this scope 4 | scanf("%d", &n) ; | ^~~~~ a.cc:26:1: error: 'printf' was not declared in this scope 26 | printf("%d" , max); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by addin...
s240160522
p03827
C++
#include <iostream> #include "string.h" using namespace std; int main(){ long long n,cnt=1; string s; cin>>n>>s; for(int i=0; i<n; i++){ if((int)s[i]==73){ cnt++; } else if((int)s[i]==68){ cnt--; } } cout<<cnt<<" "<<i<<endl; }
a.cc: In function 'int main()': a.cc:16:17: error: 'i' was not declared in this scope 16 | cout<<cnt<<" "<<i<<endl; | ^
s178115463
p03827
C++
#include <stdio.h> #include<cmath> #include<iostream> using namespace std; int main() { int N; cin>>N; char s[N]; scanf("%s",&s); if(s[N]==1) { s[N]+=1; cout<<max(s[N]); } else if(s[N]==-1) { s[N]-=1; cout<<max(s[N]); } else cout<<0; ...
a.cc: In function 'int main()': a.cc:14:18: error: no matching function for call to 'max(char&)' 14 | cout<<max(s[N]); | ~~~^~~~~~ In file included from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from a.cc:2: /usr/include/...
s216223956
p03827
C
#include<stdio.h> int main(){ int n=0,a=0,b=0,max=0; char s[101]; scanf("%d %s", &n, s); for(a=0; a<n; a++){ if(s[a]=='I') b++; else b--; if(max<x) max=x; } printf("%d\n",max); return 0; }
main.c: In function 'main': main.c:13:16: error: 'x' undeclared (first use in this function) 13 | if(max<x) | ^ main.c:13:16: note: each undeclared identifier is reported only once for each function it appears in
s117953450
p03827
C
#include<stdio.h> int main(){ int n=0,a=0,b=0,max=0; char s[101]; scanf("%d %s", &n, s); for(a=0; a<n; a++){ if(s[a]=='I') b++; else b--; if(max<x){ max=x; } } printf("%d",max); return 0; }
main.c: In function 'main': main.c:13:12: error: 'x' undeclared (first use in this function) 13 | if(max<x){ | ^ main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in
s496618317
p03827
C
#include<stdio.h> int main(){ int n=0,a=0,b=0,max=0; char s[101]; scanf("%d %s", &n, s); for(a=0; a<n; a++){ if(s[a]=='I'){ b++; } else{ b--; } if(max<x){ max=x; } } printf("%d",max); return 0; }
main.c: In function 'main': main.c:13:16: error: 'x' undeclared (first use in this function) 13 | if(max<x){ | ^ main.c:13:16: note: each undeclared identifier is reported only once for each function it appears in
s161346546
p03827
C
#include<stdio.h> int main(){ int n=0,a=0,b=0,max=0; char s[101]; scanf("%d", &n); scanf("%s",s); for(a=0; a<=n; a++){ if(s[a]=='I'){ b++; } else{ b--; } if(max<x){ max=x; } } printf("%d",max); return 0; ...
main.c: In function 'main': main.c:14:16: error: 'x' undeclared (first use in this function) 14 | if(max<x){ | ^ main.c:14:16: note: each undeclared identifier is reported only once for each function it appears in
s093229916
p03827
C
#include<stdio.h> int main(){ int n=0; scanf("%d", &n); char s[101]; int a=0,b,max=0; scanf("%s",s); for(a=0; a<=n; a++){ if(s[a]=='I'){ b++; } else{ b--; } if(max<x){ max=x; } } printf("%d\n",max); r...
main.c: In function 'main': main.c:15:16: error: 'x' undeclared (first use in this function) 15 | if(max<x){ | ^ main.c:15:16: note: each undeclared identifier is reported only once for each function it appears in