submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s346042996
p03827
C
#include<stdio.h> int main(){ int n=0; scanf("%d", &n); char s[101]; int a,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); ret...
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
s633734046
p03827
C
#include<stdio.h> int main(){ int n=0; scanf("%d", &n); char s[101]; int a,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); 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
s001675135
p03827
C
#include<stdio.h> int main(){ int n=0; scanf("%d", &n); char s[n+1]; int a,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); 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
s821069063
p03827
C
#include<stdio.h> int main(){ int n=0; scanf("%d", &n); char s[n+1]; int a,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); return 0; }
main.c: In function 'main': main.c:9:16: warning: comparison between pointer and integer 9 | if(s[a]=="I") | ^~ 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 ...
s723745366
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin >> a; string c; cin >> c; for(int i = 0; i < a; i++){ if(c.at(i) == 'I'){ b++; }else{ b--; } d = max(d,b) } cout << d << endl; }
a.cc: In function 'int main()': a.cc:17:19: error: expected ';' before '}' token 17 | d = max(d,b) | ^ | ; 18 | 19 | } | ~
s978886242
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin >> a; string c; cin >> c; for(int i = 0; i < a; i++){ if(c.at(i) == 'I'){ b++; }else if{ b--; } if(d < b){ d = d + b; } } cout << d << endl; }
a.cc: In function 'int main()': a.cc:13:13: error: expected '(' before '{' token 13 | }else if{ | ^ | (
s529239747
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin >> a; string c; cin >> c; for(int i = 0; i < a; i++){ if(c.at(i) == 'I'){ b++; }else{ b--; } if(d < b){ d = d + b; } cout << d << endl; }
a.cc: In function 'int main()': a.cc:21:4: error: expected '}' at end of input 21 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s978978774
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin >> a; string c; cin >> c; for(int i = 0; i < a; i++){ if(c.at(i) == "I"){ b++; }else{ b--; }if(d < b){ d = b; } } cout << d << endl; }
a.cc: In function 'int main()': a.cc:11:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | if(c.at(i) == "I"){ | ~~~~~~~~^~~~~~
s974005998
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin >> a; string c; cin >> c; for(int i = 0; i < a; i++){ if(c.at(i) = "I"){ b++; }else{ b--; }if(d < b){ d = b; } } cout << d << endl; }
a.cc: In function 'int main()': a.cc:11:18: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 11 | if(c.at(i) = "I"){ | ^~~ | | | const char*
s547104354
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin >> a; string c; cin >> c; for(int i = 0; i < a; i++){ if(c = 'I'){ b++; }else{ b--; }if(d < b){ d = b; } cout << d << endl; } }
a.cc: In function 'int main()': a.cc:11:10: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(73)' from 'std::__cxx11::basic_string<char>' to 'bool' 11 | if(c = 'I'){ | ~~^~~~~ | | | std::__cxx11::basic_string<char>
s704211364
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin >> a; string c; cin >> c; for(int i = 0; i < a; i++){ if(c = "I"){ b++; }else{ b--; }if(d < b){ d = b; } cout << d << endl; }
a.cc: In function 'int main()': a.cc:11:10: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(((const char*)"I"))' from 'std::__cxx11::basic_string<char>' to 'bool' 11 | if(c = "I"){ | ~~^~~~~ | | | std::__cxx11::basic_string<char> a.cc:20:4: error...
s955438950
p03827
C++
#include<iostream> using namespace std; int main() { int a, b, d = 0; cin > a; string c; cin > c; for(int i = 0; i < a; i++){ if(c = "I"){ b++; }else{ b--; }if(d < b){ d = b; } cout << d << endl; }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin > a; | ~~~ ^ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operator>(i...
s188623026
p03827
C++
#include<iostring> using namespace std; int main() { int a, b, d = 0; cin > a; string c; cin > c; for(int i = 0; i < a; i++){ if(c = "I"){ b++; }else{ b--; }if(d < b){ d = b; } cout << d << endl; }
a.cc:1:9: fatal error: iostring: No such file or directory 1 | #include<iostring> | ^~~~~~~~~~ compilation terminated.
s512570060
p03827
C++
#include <iostream> using namespace std; int main () { int m = -1, cur = 0, n; char c; cin >> n; for (register int i = 0; i < n; i++) { if(cur>m) { m = cur; } cin >> c; if(c=='I') { cur++; } else cur--; } cout ...
a.cc: In function 'int main()': a.cc:9:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 9 | for (register int i = 0; i < n; i++) { | ^ a.cc:20:16: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int') 20 | ...
s720135865
p03827
C++
#include <iostream> using namespace std; int main () { int m = -1, cur = 0, n; char c; cin >> n; for (register int i = 0; i < n; i++) { if(cur>m) { m = cur; } cin >> c; if(c=='I') { cur++; } else cur--; } cout ...
a.cc: In function 'int main()': a.cc:9:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 9 | for (register int i = 0; i < n; i++) { | ^ a.cc:20:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} ...
s656072822
p03827
C++
#include <iostream> using namespace std; int main () { int m = -1, cur = 0, n; char c; cin >> n for (register int i = 0; i < n; i++) { if(cur>m) { m = cur; } cin >> c; if(c=='I') { cur++; } else cur--; } cout <...
a.cc: In function 'int main()': a.cc:8:13: error: expected ';' before 'for' 8 | cin >> n | ^ | ; 9 | for (register int i = 0; i < n; i++) { | ~~~ a.cc:9:30: error: 'i' was not declared in this scope 9 | for (register int i = 0; i < n; i++) { ...
s525427834
p03827
C++
#include <iostream> int main () { int m = -1, cur = 0, n; char c; cin >> n for (register int i = 0; i < n; i++) { if(cur>m) { m = cur; } cin >> c; if(c=='I') { cur++; } else cur--; } cout << max << endl; ret...
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 >> n | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked t...
s205150952
p03827
C++
#include <bits/stdc++.h> #define all(x) begin(x), end(x) #define dbg(x) cerr << #x << " = " << x << endl #define _ << ' ' << using namespace std; using ll = long long; using vi = vector<int>; int main() { ios::sync_with_stdio(false); cin.tie(0); int v = 0, c = 0; int n; cin >> n; string s; ...
a.cc: In function 'int main()': a.cc:25:16: error: no matching function for call to 'max(int&, char&)' 25 | v = max(v, c); | ~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a...
s240980325
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; string s; cin>>s; int c=0; for(int i=0;i+1<a;i++){ if(s.at(i)='I') c++; else c--; cout <<c; }
a.cc: In function 'int main()': a.cc:16:12: error: expected '}' at end of input 16 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s011982141
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; string s; cin>>s; int c=0; for(int i=0;i+1<a;i++){ if(s.at(i)='I') c++; else c--; } cout <<c;
a.cc: In function 'int main()': a.cc:16:18: error: expected '}' at end of input 16 | cout <<c; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s300538903
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; string s; cin>>s; int c=0; for(int i=0;i+1<a;i++){ if(s.at(i)=I) c++; else c--; } cout <<c;
a.cc: In function 'int main()': a.cc:11:20: error: 'I' was not declared in this scope 11 | if(s.at(i)=I) | ^ a.cc:16:18: error: expected '}' at end of input 16 | cout <<c; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ...
s932436787
p03827
Java
import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); String S = sc.next(); int x = 0; int M = 0; for(int i = 0; i < N; i++){ if(S.charAt(i) == 'I'){ ...
Main.java:3: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s320817632
p03827
C++
#include<bits/stdc++.h> using namespace std; int n,cnt,ans; char ck; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>ch; if(ch=='I') { cnt++; } else { cnt--; } ans=max(ans,cnt); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:10:14: error: 'ch' was not declared in this scope; did you mean 'ck'? 10 | cin>>ch; | ^~ | ck
s678481915
p03827
C++
#include <bits/stdc++.h> using ll = long long; using namespace std; int main() { ll S,N,pnt(0),ans(0); cin>>N>>S; for (int i(0);i<S.size();i++){ if (S[i]=='D')pnt-=1; else pnt+=1; ans=max(ans,pnt); } cout<<ans; }
a.cc: In function 'int main()': a.cc:8:23: error: request for member 'size' in 'S', which is of non-class type 'll' {aka 'long long int'} 8 | for (int i(0);i<S.size();i++){ | ^~~~ a.cc:9:12: error: invalid types 'll {aka long long int}[int]' for array subscript 9 | if (S[i]...
s734804371
p03827
C++
#include<bits/srdc++.h> using namespace std; int main(){ int N; cin>>N; string S; cin>>S; int sum=0; int max=0; for(int i=0;i<N;i++){ if(S.at(i)=='I'){ sum++; if(sum>max){ max=sum; } } else{ sum--; } } cout<<max<<endl; }
a.cc:1:9: fatal error: bits/srdc++.h: No such file or directory 1 | #include<bits/srdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s142074067
p03827
C++
#include <iostream> using namespace std; int main(){ int n;cin>>n; string s;cin>> s; int ret=0,ans=0; for(auto&& u:s){ if(u=='I')ret++; else(u=='D')ret--; ans=max(ans,ret); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:18: error: expected ';' before 'ret' 9 | else(u=='D')ret--; | ^~~ | ;
s904864826
p03827
C++
#include <iostream> using namespace std; int main(){ int n;cin>>n; string s;cin s; int ret=0,ans=0; for(auto&& u:s){ if(u=='I')ret++; else (u=='D')ret--; ans=max(ans,ret); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:5:21: error: expected ';' before 's' 5 | string s;cin s; | ^~ | ; a.cc:9:19: error: expected ';' before 'ret' 9 | else (u=='D')ret--; | ^~~ | ;
s427788393
p03827
C++
include <iostream> using namespace std; int main(){ int n;cin>>n; string s;cin s; int ret=0,ans=0; for(auto&& u:s){ if(u=='I')ret++; else (u=='D')ret--; ans=max(ans,ret); } cout<<ans<<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:4:15: error: 'cin' was not declared in this scope 4 | int n;cin>>n; | ^~~ a.cc:5:9: error: 'string' was not declared in this scope 5 | string s;cin ...
s632585430
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<string> S; for (int i=0;i<N;i++){ cin >> S.at(i); } int x=0; int s=0; for (int i=0;i<N;i++){ if (S.at(i)=="I"){ s+=1; } else { s-=1; } x=max{x,s}; } cout << x << endl; } } ...
a.cc: In function 'int main()': a.cc:19:7: error: cannot resolve overloaded function 'max' based on conversion to type 'int' 19 | x=max{x,s}; | ^~~ a.cc: At global scope: a.cc:24:5: error: expected declaration before '}' token 24 | } | ^
s779612149
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<string> S(N); for (int i=0;i<N;i++){ cin >> S.at(i); } int x=0; for (int i=0;i<N;i++){ int y=0; int z=0; if (S.at(i)=="I"){ int y +=1; } else{ int z +=1; } int s=y-z; if (x>s){...
a.cc: In function 'int main()': a.cc:15:13: error: expected initializer before '+=' token 15 | int y +=1; | ^~ a.cc:18:13: error: expected initializer before '+=' token 18 | int z +=1; | ^~
s634421371
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<string> S(N); for (int i=0;i<N;i++){ cin >> S.at(i); } int x=0; for (int i=0;i<N;i++){ int y=0; int z=0; if (S.at(i)=="I"){ int y+=1; } else{ int z+=1; } int s=y-z; if (x>s){ ...
a.cc: In function 'int main()': a.cc:15:12: error: expected initializer before '+=' token 15 | int y+=1; | ^~ a.cc:18:12: error: expected initializer before '+=' token 18 | int z+=1; | ^~
s778349013
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> S(N); for (int i=0;i<N;i++){ cin >> S.at(i); } int x=0; for (int i=0;i<N;i++){ int y=0; int z=0; if (S.at(i)=="I"){ int y+=1; } else{ int z+=1; } int s=y-z; if (x>s){ ...
a.cc: In function 'int main()': a.cc:14:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if (S.at(i)=="I"){ | ~~~~~~~^~~~~ a.cc:15:12: error: expected initializer before '+=' token 15 | int y+=1; | ^~ a.cc:18:12: error: expected initial...
s509916946
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> S(N); for (int i=0;i<N;i++){ cin >> S.at(i); } int x=0; for (int i=0;i<N;i++){ int I=0; int D=0; if (S.at(i)=="I"){ int I+=1; } else{ int D+=1; } int s=I-D; if (x>s){ ...
a.cc: In function 'int main()': a.cc:14:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if (S.at(i)=="I"){ | ~~~~~~~^~~~~ a.cc:15:12: error: expected initializer before '+=' token 15 | int I+=1; | ^~ a.cc:18:12: error: expected initial...
s446395100
p03827
C++
#include <bits/stdc++.h> #include<algorithm> #include<math.h> using namespace std; template <class T> using V = vector<T>; using ll = long long; using db = double; using st = string; using ch = char; using vll = V<ll>; using vpll =V<pair<ll,ll>>; using vst = V<st>; using vdb = V<db>; using vch = V<ch>; #define ...
a.cc: In function 'int main()': a.cc:82:11: error: 'n' was not declared in this scope 82 | FOR(i,0,n){ | ^ a.cc:19:40: note: in definition of macro 'FOR' 19 | #define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++) | ^
s327523019
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,x=0,maxv=0; cin>>n; string s; cin>>s; for(i=0;i<n;i++){ x+=(s[i]=='I'?1:-1); maxv=max(maxv,x); } cout<<maxv<<endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<n;i++){ | ^
s323499126
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,x=0,maxv=0; cin>>n; string s; cin>>s; for(i=0;i<n;i++){ x+=(s[i]=='I'?1;-1); maxv=max(maxv,x); } cout<<maxv<<endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<n;i++){ | ^ a.cc:9:20: error: expected ':' before ';' token 9 | x+=(s[i]=='I'?1;-1); | ^ | : a.cc:9:20: error: expected primary-expression before ...
s428891100
p03827
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i=0; i<n;i++) #define REPR(i, n) for(int i=n-1 ; i>=0; i--) #define FOR(i, m, n) for(int i=m; i<n; i++) #define INF 2e9 #define ll long long int main(){ int x=0, max = 0, n; string s; cin>>n>>s; while(auto v:s){ if(v=='I'...
a.cc: In function 'int main()': a.cc:15:17: error: found ':' in nested-name-specifier, expected '::' 15 | while(auto v:s){ | ^ | :: a.cc:15:16: error: 'v' has not been declared 15 | while(auto v:s){ | ^ a.cc:15:19: error: qualified-id in dec...
s000733722
p03827
C++
#include<iostream> #include<string > using namespace std; int main() { int n; cin>>n; string s; cin>>s; int i=0; int arr[n+1]; arr[0]=0; for(int x=0; x<n; x++){ if(s.at(x)=='I'){ i++; } else{ i--; } arr[x+1]=i; } in...
a.cc:2:9: fatal error: string : No such file or directory 2 | #include<string > | ^~~~~~~~~ compilation terminated.
s787768353
p03827
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,x=0,c=0; cin >> n; for(int i=0;i<n;i++){ char s; cin >> s; if(s=='I') x++; else x--; c = max(c,x) } cout << c << endl; }
a.cc: In function 'int main()': a.cc:14:17: error: expected ';' before '}' token 14 | c = max(c,x) | ^ | ; 15 | } | ~
s483037156
p03827
C++
#include<bits.stdc++.h> using namespace std; int main() { int n, c = 0, ans = 0; string s; cin >> n >> s; for(int i = 0; i < n; i++) { if(s[i] == 'I')c++; else c--; ans = max(ans, c); } printf("%d", ans); return 0; }
a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory 1 | #include<bits.stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s248219383
p03827
C++
#include <iostream> #include <vector> #include <string> #include <math.h> typedef long long int ll; using namespace std; #define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i]; int main(){ int n; cin >>n; string s; cin >>s; int ans=0; for(int i=0;i<n;i++){ if(s[i]=='I')ans++; else ans--: } cout << a...
a.cc: In function 'int main()': a.cc:16:15: error: expected ';' before ':' token 16 | else ans--: | ^ | ;
s520108833
p03827
C++
#include<bits/stdc++.h> using namespce std; int main(){ int N;cin>>N; string S;cin>>S; int x=0,ans=0; for(int i=0;i<S.size();i++){ if(S.at(i)=='I')x++; else x--; ans=max(x,ans); } cout<<ans<<endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namespce' 2 | using namespce std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | int N;cin>>N; | ^~~ | std::cin In file included from ...
s912795632
p03827
C++
#include<bits/stdc++.h> using namespce std; int main(){ int N;cin>>N; string S;cin>>S; int x=0,ans=0; for(int i=0;i<S.size();i++){ if(s.at(i)=='I')x++; else x--; ans=max(x,ans); } cout<<ans<<endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namespce' 2 | using namespce std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | int N;cin>>N; | ^~~ | std::cin In file included from ...
s789808237
p03827
C++
#include <cmath> #include <cstdio> #include <iostream> #include <algorithm> using namespace std; int a,t,Max = -1,r,u,q,sb,dasf,dsdff,sadga,sasdfdfsdf; char c[110]; int main() { scanf("%d%s",&a,c); for(int i = 0 ; i < a ; ++ i){ if(c[i] == 'I') { t ++; } else t --; Ma...
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:8:12: note: to match this '{' 8 | int main() { | ^
s435760201
p03827
C++
#include <bits/stdc++.h> #define cinf(n,x,y,z) for(int i=0;i<(n);i++) cin >> x[i]>>y[i]>>z[i]; typedef long long int ll; using namespace std; int main(){ int n; string s; cin >>N >>s; int ans=0; int cnt=0; for(int i=0;i<n;i++){ if(s[i]=='I')cnt++; if(s[i]=='D')cnt--; ans=max(ans,cnt); } cout << ans << end...
a.cc: In function 'int main()': a.cc:8:15: error: 'N' was not declared in this scope 8 | cin >>N >>s; | ^
s584797081
p03827
C++
#include <bits/stdc++.h> #define cinf(n,x,y,z) for(int i=0;i<(n);i++) cin >> x[i]>>y[i]>>z[i]; typedef long long int ll; using namespace std; int main(){ int n; string s; cin >>N >>s; int ans=0; int cnt=0; for(int i=0;i<n;i++){ if(s[i]=='I')cnt++; if(s[i]=='D')cnt--; chmax(ans,cnt); } cout << ans << endl;...
a.cc: In function 'int main()': a.cc:8:15: error: 'N' was not declared in this scope 8 | cin >>N >>s; | ^ a.cc:14:17: error: 'chmax' was not declared in this scope 14 | chmax(ans,cnt); | ^~~~~
s619560811
p03827
C++
#include<bits/std++.h> using namespace std; int i,n,num=0,m=0; char a; int main() { cin>>n; for(i=0;i<n;i++){ cin>>a; if(a=='I'){ num++; } else{ num--; } max(num,m); } cout<<num; return 0; }
a.cc:1:9: fatal error: bits/std++.h: No such file or directory 1 | #include<bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s523535791
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int x = 0; int ans = 0; for(int i = 0; i < N; i++) { if(S[i] == 'I') { x++; } else { x--; } ans = max (ans, x) } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:23: error: expected ';' before '}' token 18 | ans = max (ans, x) | ^ | ; 19 | } | ~
s975108050
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int x = 0; vector<int> X(N); X[N] = 0; for(int i = 0; i < N; i++) { if(S[i] == "I") { x++; X[i] = x; } else { x--; X[i] = x; } } sort(X.begin(), X.end()); ...
a.cc: In function 'int main()': a.cc:14:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if(S[i] == "I") {
s828530657
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin S; int x = 0; vector<int> X(N); X[N] = 0; for(int i = 0; i < N; i++) { if(S[i] == "I") { X++; X[i] = x; } else { x--; X[i] = x; } } sort(X.begin(), X.end()); cou...
a.cc: In function 'int main()': a.cc:8:6: error: expected ';' before 'S' 8 | cin S; | ^~ | ; a.cc:14:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if(S[i] == "I") { a.cc:15:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] ...
s957584978
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; char S[N]; cin >> S; int count = 0; for (int i=0; i<N; i++){ if(S[i] == "I"){ count = count +1; } else{ count = count -1; } } cout << count <<endl; }
a.cc: In function 'int main()': a.cc:11:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | if(S[i] == "I"){ | ~~~~~^~~~~~
s392713284
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; char S[N]; cin >> S; int count = 0; for (int i=0; i<N; i++){ if(S[i] = "I"){ count = count +1; } else{ count = count -1; } } cout << count <<endl; }
a.cc: In function 'int main()': a.cc:11:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 11 | if(S[i] = "I"){ | ^~~ | | | const char*
s581331993
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; char S[]; cin >> N; cin >> S; int count = 0; for (int i=0; i<N; i++){ if(S[i] = "I"){ count = count +1; } else{ count = count -1; } } cout << count <<endl; }
a.cc: In function 'int main()': a.cc:6:8: error: storage size of 'S' isn't known 6 | char S[]; | ^
s283716186
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; char S; cin >> N; cin >> S; int count = 0; for (int i=0; i<N; i++){ if(S[i] = "I"){ count = count +1; } else{ count = count -1; } } cout << count <<endl; }
a.cc: In function 'int main()': a.cc:11:9: error: invalid types 'char[int]' for array subscript 11 | if(S[i] = "I"){ | ^
s957142655
p03827
Java
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String S = sc.next(); int cnt = 0; int max = 0; for(int i = 0; i < S; i++){ char c = S.charAt(i); if(c == 'I'){ ...
Main.java:10: error: bad operand types for binary operator '<' for(int i = 0; i < S; i++){ ^ first type: int second type: String 1 error
s717302208
p03827
Java
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String S = sc.next(); int cnt = 0; int max = ; for(int i = 0; i < S; i++){ char c = S.charAt(i); if(c == 'I'){ ...
Main.java:9: error: illegal start of expression int max = ; ^ 1 error
s431905431
p03827
C++
include<bits/stdc++.h> using namespace std; string a; int ans,l,maxx=-1*0x7fffffff; int main(){ cin>>l>>a; for(int i=0;i<l;i++){ ans+=(a[i]=='I')?1:-1; maxx=max(ans,maxx); } if(maxx==-1)maxx=0; cout<<maxx<<endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc:3:1: error: 'string' does not name a type 3 | string a; | ^~~~~~ a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin>>l>>a; | ^~~ a.cc:6:13: error: 'a...
s811648097
p03827
C++
#include<algorithm> #include<bitset> #include<cmath> #include<cstdio> #include<cstring> #include<deque> #include<functional> #include<iomanip> #include<iostream> #include<iterator> #include<list> #include<map> #include<memory> #include<numeric> #include<queue> #include<set> #include<stack> #include<string> #include<uti...
a.cc: In function 'int main()': a.cc:72:25: error: 'c' was not declared in this scope 72 | scanf("%d%s",&a,c); | ^
s525046619
p03827
C++
#include<algorithm> #include<bitset> #include<cmath> #include<cstdio> #include<cstring> #include<deque> #include<functional> #include<iomanip> #include<iostream> #include<iterator> #include<list> #include<map> #include<memory> #include<numeric> #include<queue> #include<set> #include<stack> #include<string> #include<uti...
a.cc: In function 'int main()': a.cc:72:23: error: 'a' was not declared in this scope 72 | scanf("%d%s",&a,c); | ^ a.cc:72:25: error: 'c' was not declared in this scope 72 | scanf("%d%s",&a,c); | ^ a.cc:77:25: error: 't' was not declared in...
s515173681
p03827
C++
#include<iostream> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int count = 0; int answer = 0; for(int i =0;i < N;i++) { if(S.at(i) == 'I') { count+=; if(answer < count){ answer = count; } } if(S.at(i) == 'D') { count = count - 1; ...
a.cc: In function 'int main()': a.cc:13:14: error: expected primary-expression before ';' token 13 | count+=; | ^ a.cc:22:4: error: expected '}' at end of input 22 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s742647292
p03827
C++
#include<iostream> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int count = 0; int answer = 0; for(int i =0;i < N;i++) { if(S.at(i) == 'I') { count++; if(answer < count){ answer = count; } } if(S.at(i) == 'D') { count--; } cout...
a.cc: In function 'int main()': a.cc:22:4: error: expected '}' at end of input 22 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s469960118
p03827
C++
#include<iostream> using namespace std; int main() { int N; string S; int count = 0; int answer = 0; for(int i =0;i < N;i++) { if(S.at(i) == 'I') { count++; if(answer < count){ answer = count; } } if(S.at(i) == 'D') { count--; } }
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s836391387
p03827
C++
#pragma GCC optimize(1) #pragma GCC optimize(2) #pragma GCC optimize(3) // Increment Decrement.cpp // // Created by WinnieJt on 2019/3/21. // // Copyright © 2019 金天. All rights reserved. #include<bits/stdc++.h> #include<algorithm> #include<bitset> #include<cctype> #include<cerrno> #include<clocale> #include<cmath>...
a.cc:51:8: error: size of array 'x' is not an integral constant-expression 51 | char x[maxn]; | ^~~~
s829525826
p03827
C++
#include <cstdio> #include <iostream> using namespace std; char s[110]; int n,pos,maxn;//pos存储当前高度,maxn存储最高高度 int main() { scanf("%d%s",&n,s+1);//读入字符串的长度和字符串 for(int i=1;i<=n;++i) { if(s[i]=='I') ++pos;//判断如果是‘I’,高度++ else --pos;//否则高度-- maxn=max(maxn,pos);//每次选取最大值 } printf...
a.cc: In function 'int main()': a.cc:16:14: error: expected '}' at end of input 16 | return 0;//完美结束 | ^ a.cc:7:1: note: to match this '{' 7 | { | ^
s663317229
p03827
C++
#include <bits/stdc++.h> using namespace std; using llong = long long; using P = pair<llong, llong>; #define BE(x) x.begin(), x.end() const llong inf = llong(1e18)+7; const llong mod = 1e9+7; int main(){ int N; string S; cin >> N >> S; int ans = 0; int sum = 0; for(auto x : S){ if(S == 'I') sum++; el...
a.cc: In function 'int main()': a.cc:21:22: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 21 | if(S == 'I') | ~ ^~ ~~~ | | | | | char | ...
s924113952
p03827
Java
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); String po[]=sc.next().split("",0); int x=0,y=0; for(int i=0;i<n;i++){ y+=(po[i].equals("I"))?1:-1; x=Math.max(x,y) } System.out.println(x); } }
Main.java:10: error: ';' expected x=Math.max(x,y) ^ 1 error
s996975049
p03827
C++
#include<bits/stdc++.h> using namespace std; int n; long long z__,maxx; int main() { cin>>n; for(int i=0;i<n;i++) { char a; cin>>a; if(a=='I') z__++; else z__--; if(z>maxx) { maxx=z; } } cout<<maxx; return 0; }
a.cc: In function 'int main()': a.cc:16:20: error: 'z' was not declared in this scope 16 | if(z>maxx) | ^
s378575708
p03827
C++
#include<cstdio> #include<string> #include<cstring> int main (){ char a[105]; int a,b,i,n; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%c",&a[i]); if(a[i] == 'I'){ a=a+1; } b=n-a; c=a-b; if(c>=0) printf("%d",c); else if(c<0) printf("0"); } }
a.cc: In function 'int main()': a.cc:6:13: error: conflicting declaration 'int a' 6 | int a,b,i,n; | ^ a.cc:5:14: note: previous declaration as 'char a [105]' 5 | char a[105]; | ^ a.cc:11:18: error: incompatible types in assignment of 'char*' to 'char [105]' ...
s372051326
p03827
C
#include <stdio.h> int main(){ int k,i,max=0,a=0; scanf ("%d",&k); char s; scanf ("%s",s); for (i=0;i<k;i++){ if (s[i]=='I'){ a++; } else if (s[i]=='D'){ a--; } if (max>a){ max=a; } } printf ("%d",max); return 0; }
main.c: In function 'main': main.c:8:6: error: subscripted value is neither array nor pointer nor vector 8 | if (s[i]=='I'){ | ^ main.c:11:11: error: subscripted value is neither array nor pointer nor vector 11 | else if (s[i]=='D'){ | ^
s448454448
p03827
C++
#include<iostream> #include<string> #include<vector> #include<iomanip> #include<algorithm> #include<queue> #include<stack> #include<map> using namespace std; #define ll long long int main(){ int x=0,xmax=0; int n,i; cin >> n; string s; cin >> s; for(i=0;i<n;i++){ if(s[i]=="I")x++;else x--;...
a.cc: In function 'int main()': a.cc:18:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 18 | if(s[i]=="I")x++;else x--;
s790011300
p03827
C++
#include<iostream> #include<string> #include<vector> #include<iomanip> #include<algorithm> #include<queue> #include<stack> #include<map> using namespace std; #define ll long long int main(){ int x=0,xmax=0; int n; cin >> n; string s; cin >> s; for(i=0;i<n;i++){ if(s[i]=="I")x++;else x--; ...
a.cc: In function 'int main()': a.cc:17:9: error: 'i' was not declared in this scope 17 | for(i=0;i<n;i++){ | ^
s575905510
p03827
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,i,x=0,ans=0; string s; cin>>n>>s; for(i=0;i<n;i++){ if(s[i]=='I') x++; else(s[i]=='D') x--; if(ans<x) ans=x; } cout<<x; }
a.cc: In function 'int main()': a.cc:12:20: error: expected ';' before 'x' 12 | else(s[i]=='D') | ^ | ; 13 | x--; | ~
s527704930
p03827
C++
#include<algorithm> #include<iostream> #include<functional> #include<cmath> #include<iomanip> using namespace std; int main(){ int n,x=0,ans,bb=-10000; string aa[1000]; cin>>n; for(int i=0;i<n;i++){ cin>>aa[i]; if(aa[i]=='D') x--; else{ x++; } ans=max(x,bb); if(x>bb) bb...
a.cc: In function 'int main()': a.cc:13:13: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 13 | if(aa[i]=='D') | ~~~~~^~~~~ | | | | | char | std::string {aka std::__cxx11::bas...
s705897631
p03827
C++
signed main() { cin.tie(0); ios::sync_with_stdio(false); int x = 0, max = 0; int n; string s; cin >>n>> s; for (int i = 0; i < (int)s.length(); i++) { if (s[i] == 'I') { x++; } else { x--; } if (x > max) { max = x; } } cout << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:2:9: error: 'cin' was not declared in this scope 2 | cin.tie(0); | ^~~ a.cc:3:9: error: 'ios' has not been declared 3 | ios::sync_with_stdio(false); | ^~~ a.cc:7:9: error: 'string' was not declared in this scope 7 | str...
s105574568
p03827
C++
#include <iostream> #include <iomanip> // std::cout << std::setprecision(2) << 3.141; // "3.1" #include <algorithm> #include <vector> #include <string> #include <cmath> #include <map> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> plglg; typedef pair<double, ll> pdlg; type...
a.cc: In function 'int main()': a.cc:29:24: error: expected ',' or ';' before '=' token 29 | vector<int> value(n) = {0}; | ^
s729542165
p03827
C++
#include <bits/stdc++.h> using namespace std; #define max(a,b) ((a)>(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b)) #define abs(a) max((a),-(a)) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define repe(i,n) rep(i,(n)+1) #define per(i,n) for(int i=(int)(n)-1;i>=0;i--) #define pere(i,n) rep(i,(n)+1) #define all(x) (x)....
a.cc: In function 'int main()': a.cc:25:12: error: 'c' was not declared in this scope 25 | cin >> c; | ^ a.cc:27:7: error: 'x' was not declared in this scope 27 | x++; | ^ a.cc:29:7: error: 'x' was not declared in this scope 29 | x--; | ^ a.cc:31:17: err...
s234945835
p03827
C++
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; const ull mod = 1e9 + 7; #define REP(i,n) for(int i=0;i<(int)n;++i) //debug #define dump(x) cerr << #x << " = " << (x) << endl; #...
a.cc: In function 'int main()': a.cc:31:35: error: expected ':' before ';' token 31 | x += (S[i]=='I'?+1;-1); | ^ | : a.cc:31:35: error: expected primary-expression before ';' token a.cc:31:35: error: expected ')' before ...
s572221424
p03827
C++
#include <iostream> using namespace std; int main() { int n, x; string s; cin >> n >> s; x = 0; for (int i = 0; i < n; i ++) { if (s[i] == "I") x ++; if (s[i] == "D") x --; } cout << x << endl; }
a.cc: In function 'int main()': a.cc:11:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | if (s[i] == "I") x ++; a.cc:12:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if (s[i] == "D") x --;
s315932639
p03827
C++
#include<bits/stdc++.h> using namespace std; int n,now,ans; char ch; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>u; if(ch=='I')now++; else now--; ans=max(ans,now); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:14: error: 'u' was not declared in this scope 10 | cin>>u; | ^
s053621359
p03827
C
#include<stdio.h>{ int main(){ int max=0,x=0,i,n; char S[n]; scanf("%d",&n); scanf("%s",S); for(i=0;i<n;i++){ if(S[i]=='I'){ x++; } else{ x--; } if(x>max){ max=x; } printf("%d",max); }
main.c:1:18: warning: extra tokens at end of #include directive 1 | #include<stdio.h>{ | ^ main.c: In function 'main': main.c:19:9: error: expected declaration or statement at end of input 19 | } | ^
s059682208
p03827
C
#include <stdio.h> int main(void){ int N,a,b,i; char S[N]; scanf("%d %s",&N,S); a,b=0; for(i=0;i<N;i++){ if(S[i]==I) a++; else a--; if(a<b) a=b; } printf("%d",b); return 0; }
main.c: In function 'main': main.c:8:13: error: 'I' undeclared (first use in this function) 8 | if(S[i]==I) | ^ main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
s402926447
p03827
C++
#include<iostream> using namespace std; int main(){ int n;cin>>n; string s;cin>>s; int max=0,x=0; for(int i=0;i<n;i++){ if(s[i]=='I')x++; if(s[i]=='D')x--; max=max(max,x); } cout<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:12: error: 'max' cannot be used as a function 11 | max=max(max,x); | ~~~^~~~~~~
s103073810
p03827
C++
#include<iostream> using namespace std; int main() { int t; cin>>t; string x; char 'I','D'; getline(cin , x); int z=0; for(int y=0 ; y<t; y++) { if(x.at(y)=I){z=z+1;} if(x.at(y)=D){z=z-1;} } cout<<z; }
a.cc: In function 'int main()': a.cc:8:6: error: expected unqualified-id before 'I' 8 | char 'I','D'; | ^~~ a.cc:13:20: error: 'I' was not declared in this scope 13 | if(x.at(y)=I){z=z+1;} | ^ a.cc:14:20: error: 'D' was not declared in this scope 14 | if(x.a...
s757539448
p03827
C++
#include<iostream> using namespace std; int main() { int t; cin>>t; string x; getline(cin , x); int z=0; for(int y=0 ; y<t; y++) { if(x.at(y)=I){z=z+1;} if(x.at(y)=D){z=z-1;} } cout<<z; }
a.cc: In function 'int main()': a.cc:12:20: error: 'I' was not declared in this scope 12 | if(x.at(y)=I){z=z+1;} | ^ a.cc:13:20: error: 'D' was not declared in this scope 13 | if(x.at(y)=D){z=z-1;} | ^
s086815384
p03827
C++
#include <iostream> #include <string.h> using namespace std; int main () { int N; int x=0; cin>> N; string str1("I") ; string str2("D") ; string newarr [N]; for (int i=0; i++ ; i<N) { cin>> newarr[i]; } for (int i=0 ; i++ ; i<N) { if (newarr[i]= str1) {x++;} ...
a.cc: In function 'int main()': a.cc:18:22: error: could not convert 'newarr[i].std::__cxx11::basic_string<char>::operator=(str1)' from 'std::__cxx11::basic_string<char>' to 'bool' 18 | if (newarr[i]= str1) {x++;} | ~~~~~~~~~^~~~~~ | | | ...
s003392982
p03827
C++
#include <iostream> #include <string.h> using namespace std; int main() { int N; int x=0; cin>> N; string arr [2] = {I , D} ; string newarr [N]; for (int i=0; i++ ; i<N) { cin>> newarr[i]; } for (int i=0 ; i++ ; i<N) { if (newarr[i]= arr[0]) {x++;} if (new...
a.cc: In function 'int main()': a.cc:9:23: error: 'I' was not declared in this scope 9 | string arr [2] = {I , D} ; | ^ a.cc:9:27: error: 'D' was not declared in this scope 9 | string arr [2] = {I , D} ; | ^ a.cc:17:22: error: could not convert...
s601302486
p03827
C++
#include<bits/stdc++.h> using namespace std; int main() { int x=0; int n; string s; int arr[s.length()]; for(int i=0;i<n;i++) { if (s.at(i)=='I'){ x=x+1; arr[i]=x;} else { x=x-1; arr[i]=x; } for(int i=0;i<s.length()-1;i++) { if(arr[i+1]<=arr[i]) arr[i+1]=arr[i]; } cout<<arr[s.length()]; }
a.cc: In function 'int main()': a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s445701746
p03827
C++
#include<iostream> #include<cstring> using namespace std; int main() { int x=0,a[150],k; char S[150]; cin>>N; cin>>S; a[0]=0; for(int i=0; i<N; i++) { if(S[i]=='I') x++; else if(S[i]=='D') x--; a[i+1]=x; } k=a[0]; for (int i=1; i<N+1;i++) { if(k<a[i]) k=a[i]; } ...
a.cc: In function 'int main()': a.cc:9:8: error: 'N' was not declared in this scope 9 | cin>>N; | ^
s506078560
p03827
C
#include<stdio.h> #include<string.h> int main() { int x=0; char arr[30]; int N; N=strlen(arr); int i,t; for(i=0;i<=N-1;i++) { if(arr(i)==I) x++; else if(arr(i)==D) x--; if(x++>x || x-->x) t=x; } return(t); }
main.c: In function 'main': main.c:12:12: error: called object 'arr' is not a function or function pointer 12 | if(arr(i)==I) | ^~~ main.c:6:10: note: declared here 6 | char arr[30]; | ^~~ main.c:12:20: error: 'I' undeclared (first use in this function) 12 | ...
s435941158
p03827
C++
#include<iostream> using namespace std; int main() { int x=0,a[150],k; char S[150]; cin>>S; a[0]=0; for(int i=0; i<strlen(S); i++) { if(S[i]=='I') x++; else if(S[i]=='D') x--; a[i]=x; } k=a[0]; for (int i=1; i<strlen(S);i++) { if(k<a[i]) k=a[i]; } cout<<k; }
a.cc: In function 'int main()': a.cc:10:18: error: 'strlen' was not declared in this scope 10 | 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<iostream> +++ |+#inclu...
s260118863
p03827
C++
#include <iostream> #include <cmath> #include<algorithm> using namespace std; int main() { int a; string input; cin<<a<<input; int b=0; array maxi[a]; for (int c=0;c<a;c++) { if(s[c]==I) { b=b+1; } else { b=b-...
a.cc: In function 'int main()': a.cc:12:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 12 | cin<<a<<input; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:12:8: note: candida...
s943331523
p03827
C++
#include <iostream> #include <cmath> #include<algorithm> using namespace std; int main() { int a; string input; cin<<a<<input; int b=0; array maxi[a]; for (int c=0;c<a;c++) { if(s[c]==I) { m=m+1; } else { m=m-...
a.cc: In function 'int main()': a.cc:12:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 12 | cin<<a<<input; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:12:8: note: candida...
s376676975
p03827
Java
import java.util.*; public class Main { public static void main(String args[]) { Scanner in=new Scanner(System.in); int N=in.nextInt(); String S=in.nextLine(); int x=max=0; for (int i=0; i<N; i++) { char c=ScharAt(i); if(c=='I') x++; else x--; if(x>max) max=x; } System.out.println(max); } }
Main.java:9: error: cannot find symbol int x=max=0; ^ symbol: variable max location: class Main Main.java:12: error: cannot find symbol char c=ScharAt(i); ^ symbol: method ScharAt(int) location: class Main Main.java:17: error: cannot find symbol if(x>max) ^ symbol: variable max locat...
s791295059
p03827
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; int n; cin>>n; cin>>s; int max=x,x=0; for(int i=0;i<s.length();i++){ if(s[i]=='I') x++; else if(s[i]=='D') x--; if(max<x) max=x; } cout<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'x' was not declared in this scope 10 | int max=x,x=0; | ^
s966820154
p03827
C++
#include<bits/stdc++.h> #include<string> #include<algorithm> #include<vector> using namespace std; int main(){ int n; cin >> n; string s[n]; cin >> s; int ans = 0; for(int i = 0; i < n; i++){ if(s[i] == "I") ans++; else(s[i] == "D") ans--; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:20: 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]'}) 10 | string s[n]; cin >> s; | ~~~ ^~ ~ | | | | ...
s930701745
p03827
C++
n = int(input()) s = input() x = 0 alist = [0] for i in range(n): if s[i]=='I': x += 1 else: x -= 1 alist.append(x) print(max(alist))
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s432540244
p03827
C++
#include<stdio.h> int main() { char s[n]; int i; int n; int x = 0; int max; max = x; scanf("%d%d%d%c",&i,&n,&x,&s[i]); for(i = 0; i <= n; i++) { if(s[i] == 'I') printf("%d = x\n",x++); if(s[i] == 'D') printf("%d = x\n",x--); } printf("%d\n",max); return 0; }
a.cc: In function 'int main()': a.cc:4:16: error: 'n' was not declared in this scope 4 | char s[n]; | ^ a.cc:10:36: error: 's' was not declared in this scope 10 | scanf("%d%d%d%c",&i,&n,&x,&s[i]); | ^
s596475249
p03827
C
#include<cstdio> main(){ int n,a = 0,x = 0; char s[105]; scanf("%d",&n); scanf("%s",s); for(int i = 0;i < n ; i++){ if(s[i] == 'I'){ x = x + 1; } else if (s[i] == 'D'){ x = x - 1; } if(a >= x) continue; else if (a < x){ a = x ; } } printf("%d\n",a); }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s124400296
p03827
C++
#include<cstdio> #include<cmath> #include<iostream> typedef long long ll; using namespace std; char a[100000]; int main() { int x = 0, max = 0; int N,i; scanf("%d",&N); scanf("%s",a); N = strlen(a); for(i = 0; i < N; i++) { if(a[i] == 'I') { x++; max = max > x ? max : x; } if(a[i] == 'D') { x...
a.cc: In function 'int main()': a.cc:14:13: error: 'strlen' was not declared in this scope 14 | N = strlen(a); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<iostream> +++ |+#include <cstring> ...
s562422550
p03827
C++
#include<bits/stdc++.h> using namespace std; int n,x,ans; string s; int main(){ cin>>n>>s; for (int i=0;i<n;i++){ if (s[i]=="I") x++; if (s[i]=="D") x--; if (x>ans) ans=x; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if (s[i]=="I") x++; a.cc:9:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if (s[i]=="D") x--;