submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s417706628 | p03826 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,b,c,d;
cin >> a,b,c,d;
e = a * b;
f = c * d;
if (e => f )
g = e;
else g = f;
cout << g;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'e' was not declared in this scope
8 | e = a * b;
| ^
a.cc:9:5: error: 'f' was not declared in this scope
9 | f = c * d;
| ^
a.cc:10:12: error: expected primary-expression before '>' token
10 | if (e => f )
| ^
... |
s755974875 | p03826 | C++ | #include<stdio.h>
int main() {
int a, b, c, d;
scanf_s("%d %d %d %d",&a, &b, &c, &d);
if (a < 1 || a>10 * 10 * 10 * 10) {
printf("Error");
}
if (b < 1 || b>10 * 10 * 10 * 10) {
printf("Error");
}
if (c < 1 || c>10 * 10 * 10 * 10) {
printf("Error");
}
if (d < 1 || d>10 * 10 * 10 * 10) {
printf("Error");... | a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
4 | scanf_s("%d %d %d %d",&a, &b, &c, &d);
| ^~~~~~~
| scanf
|
s362159340 | p03826 | C++ | data = list(map(int, input().split()))
a, b, c, d = data
print(max(a*b, c*d)) | a.cc:1:1: error: 'data' does not name a type
1 | data = list(map(int, input().split()))
| ^~~~
|
s642512312 | p03826 | C++ | a, b, c, d = map(int, input().split())
if a*b >= c*d:
print(a*b)
else:
print(c*d) | a.cc:1:1: error: 'a' does not name a type
1 | a, b, c, d = map(int, input().split())
| ^
|
s212614592 | p03826 | C++ | #include <iostream>
using namespace std;
int main(void){
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<a*b>c*d?a*b:c*d<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:10: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int')
8 | cout<<a*b>c*d?a*b:c*d<<endl;
| ~~~~~~~~~^~~~
| | |
| | int
| std::basic_ostream<char>
a.cc:8:10: note: candidate: 'operator>(int, int)... |
s496684647 | p03826 | Java |
import java.util.Scanner;
//ABC052
public class TwoRectangles {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong(), b = sc.nextLong();
long c = sc.nextLong(), d = sc.nextLong();
System.out.println(Math.max(a * b, c * d));
}
}
| Main.java:6: error: class TwoRectangles is public, should be declared in a file named TwoRectangles.java
public class TwoRectangles {
^
1 error
|
s048775599 | p03826 | C | #include <stdio.h>
int main(){
int a[len];
char k[len];
int i;
int y;
int temp;
int h;
int a;
int b;
int c;
int d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a*b>=c*d){
printf("%d",a*b);
}
else if(a*b<=c*d){
printf("%d",c*d);
}
return 0;
} | main.c: In function 'main':
main.c:4:7: error: 'len' undeclared (first use in this function)
4 | int a[len];
| ^~~
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
|
s805303984 | p03826 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan=new Scanner();
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.nextInt();
int d=scan.nextInt();
System.out.println(Math.max(a*b,c*d));
}
}
| Main.java:4: error: no suitable constructor found for Scanner(no arguments)
Scanner scan=new Scanner();
^
constructor Scanner.Scanner(Readable,Pattern) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(Readable) is not applicable
(actual a... |
s566044588 | p03826 | C++ | include <iostream>
using namespace std;
int main(){
int a, b, c, d, e, f;
cin << a << b << c << d;
e = a*b;
f = c*d;
if(e >= f){
cout << e << endl;
}
else{
cout << f << endl;
}
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin << a << b << c << d;
| ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
10 | c... |
s761667475 | p03826 | C++ | #include<bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll long long
#define bit __builtin_popcountll
#define sqr(x) (x) * (x)
#define forit(it,S) for(__typeof((S).begin()) it = (S).begin(); it != (S).end(); it++)... | a.cc:30:5: error: conflicting declaration 'int a'
30 | int a,b,c,d;
| ^
a.cc:29:5: note: previous declaration as 'int a [100001]'
29 | int a[N];
| ^
a.cc: In function 'int main()':
a.cc:33:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} a... |
s751983675 | p03826 | C++ | #include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
using namespace std;
#define REP(i,n) for(int i=0;i < n; i++)
#define RREP(i,n) for(int i=n-1;i >=0; i--)
#de... | a.cc:34:2: error: stray '#' in program
34 | }#include<string>
| ^
a.cc:34:3: error: 'include' does not name a type
34 | }#include<string>
| ^~~~~~~
a.cc:54:5: error: redefinition of 'int main()'
54 | int main() {
| ^~~~
a.cc:21:5: note: 'int main()' previously defined here
21 | int ... |
s330379256 | p03826 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cnt = 0;
String str = "";
int N1 = Integer.parseInt(sc.next());
int N2 = Integer.parseInt(sc.next());
int W1 = Integer.parseInt(s... | Main.java:21: error: cannot find symbol
System.out.print(Math.max(N1N2,W1*W2));
^
symbol: variable N1N2
location: class Main
1 error
|
s206688156 | p03826 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cnt = 0;
String str = "";
int N1 = Integer.parseInt(sc.next());
int N2 = Integer.parseInt(sc.next());
int W1 = Integer.parseInt(s... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s800223838 | p03827 | C++ | #include<bits/stdc++.h>
int main(){
int n;
cin >> n;
string s;
cin >> s;
int ans = 0;
int maxans = 0;
for(int i = 0; i < n; i++){
if(s[i] == 'I') ans ++;
else ans--;
maxans = max(ans,maxans);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> n;
| ^~~
| std::cin
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:62:18: note: 'std::ci... |
s003749359 | p03827 | Java |
import java.util.*;
public class Main4 {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
sc.nextLine();
String st=sc.nextLine();
int x=0;
int ans=0;
for(int i=0;i<n;i++)
{
if(st.charAt(i)=='I') x++;
else x--;
ans=Math.max(ans, x);
}
System.... | Main.java:3: error: class Main4 is public, should be declared in a file named Main4.java
public class Main4 {
^
1 error
|
s828556980 | p03827 | C++ | #include <iostream>
#include <String>
using namespace std;
int main()
{
int n,ans,sum;
string s;
cin>>n>>s;
for(int i=0;i<n;i++)
{
if(s[i]=='I')
{
ans++;
}
else if(s[i]=='D')
{
ans++;
}
sum=max(sum,ans);
}
cout<<sum;
return 0;
} | a.cc:2:10: fatal error: String: No such file or directory
2 | #include <String>
| ^~~~~~~~
compilation terminated.
|
s750752618 | p03827 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
int x=0;
string s
cin>>s;
int t[n];
for(int j=0;j<n;j++){
if(s[j]=='I'){
x++;
t[j]=x;
continue;
}
x--;
t[j]=x;
}
int m=t[0];
for(int p=0;p<n;p++){
for(int q=p+1;q<n;q++){
if (t[q]>t[p]){
m=t[q];
}
}
}
c... | a.cc: In function 'int main()':
a.cc:9:9: error: expected initializer before 'cin'
9 | cin>>s;
| ^~~
a.cc:12:20: error: 's' was not declared in this scope
12 | if(s[j]=='I'){
| ^
|
s645418361 | p03827 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
int x=0;
int s[n],t[n];
for(int i=0;i<n;i++){
cin>>s[i];
}
for(int j=0;j<n;j++){
if(s[j]=='I'){
x++;
t[j]=x;
continue;
}
x--;
t[j]=x;
}
int m=t[0];
for(int p=0;p<n;p++){
for(int q=p+1;q<n;q++){
if t[q]>t[p]{
m=t[... | a.cc: In function 'int main()':
a.cc:24:28: error: expected '(' before 't'
24 | if t[q]>t[p]{
| ^
| (
|
s707838618 | p03827 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
int x=0;
int s[n],t[n];
for(int i=0;i<n;i++){
cin>>s[i];
}
for(int j=0;j<n;j++){
if(s[j]=='I'){
x++;
t[j]=x;
continue;
}
x--;
t[j]=x;
}
cout<<t.max();
}
| a.cc: In function 'int main()':
a.cc:21:17: error: request for member 'max' in 't', which is of non-class type 'int [n]'
21 | cout<<t.max();
| ^~~
|
s734362246 | p03827 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
int x=0;
int s[n],t[n];
for(int i=0;i<n;i++){
cin>>s[i];
}
for(int j=0;j<n;j++){
if(s[j]=='I'){
x++;
t[j]==x;
continue;
}
x--;
t[j]==x;
}
cout<<t.max();
}
| a.cc: In function 'int main()':
a.cc:21:17: error: request for member 'max' in 't', which is of non-class type 'int [n]'
21 | cout<<t.max();
| ^~~
|
s720658454 | p03827 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
int x=0;
int s[n],t[n];
for(int i=0;i<n;i++){
cin>>s[i];
}
for(int j=0;j<n;j++){
if(s[j]=="i"){
x++;
t[j]==x;
continue;
}
x--;
t[j]==x;
}
cout<<t.max();
} | a.cc: In function 'int main()':
a.cc:12:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(s[j]=="i"){
| ~~~~^~~~~
a.cc:20:17: error: request for member 'max' in 't', which is of non-class type 'int [n]'
20 | cout<<t.max();
... |
s956943973 | p03827 | C++ | #include <iostream>
using namespace std;
int main(){
int x,n,biggest;
string s[n];
cin >> n;
cin >> s;
for(int i=0;i<=n;i++){
if(s[i]=='I'){
x++;
x=biggest;
}else{
x--;
}
}cout<< biggest;
} | a.cc: In function 'int main()':
a.cc:8:5: 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]'})
8 | cin >> s;
| ~~~ ^~ ~
| | |
| | std::string [n] {aka std::__cxx11::basic_st... |
s819269322 | p03827 | C++ | #include<iostream>
using namespace std;
int main(){
int Q;
cin >> Q;
string str;
int x = 0;
while(cin >> str){
for(int i = 0; i < str.length(); i++){
if(str[i] == 'I'){
x += 1;
}else{
x -= 1;
}
}
cout << x;
}
}
v | a.cc:19:1: error: 'v' does not name a type
19 | v
| ^
|
s643057094 | p03827 | C++ | #include<iostream>
using namespace std;
int main(){
int x=0, maxX=0;
int N;
string S;
cin >> N >> S;
for(int i=0; i<N; i++){
if(S[i] == 'I'){
x++;
}else {
x--;
}
maxX = x > maxX ? x : maxX;
}
cout << maxX << '\n'
}
| a.cc: In function 'int main()':
a.cc:17:25: error: expected ';' before '}' token
17 | cout << maxX << '\n'
| ^
| ;
18 | }
| ~
|
s623910492 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
int main(){
int n,x=0,max=0; cin>>n;
string s; cin>>s;
rep(i, n){
if(s[i]=='I')
x++;
if(max<x)
max=x;
... | a.cc:22:2: error: expected class-name at end of input
22 | ~
| ^
|
s592208220 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
int main() {
ll N;
cin>>N;
string S;
cin>>S;
ll ans=0;
ll max=0;
for(ll i=0;i<N;i++) {
if(S[i]=='I') {
ans++;
}
if(S[i]=='D') {
ans--;
}
max=max(ans,max);
}
cout<<max<<endl;
}
| a.cc: In function 'int main()':
a.cc:20:12: error: 'max' cannot be used as a function
20 | max=max(ans,max);
| ~~~^~~~~~~~~
|
s597100674 | p03827 | C++ |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
string s;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> s;
int ans = 0;
for (int i = 0; i < n; ++i) {
if (s[i] == 'I')
++sum;
else
--sum;
ans = max(ans... | a.cc: In function 'int main()':
a.cc:16:15: error: 'sum' was not declared in this scope
16 | ++sum;
| ^~~
a.cc:18:15: error: 'sum' was not declared in this scope
18 | --sum;
| ^~~
a.cc:19:24: error: 'sum' was not declared in this scope
19 | ... |
s692279484 | p03827 | C++ | #include<iostream>
#include<string>
using namespace std;
bool chmax(int& a, int b){
if (a < b){
a = b; return true;
}
else return false;
}
int main(){
string s;
cin >> s;
int score=0, ans=0;
for (int i=0; i<s.length(); i++){
if (s[i] == 'I') score++;
else if (s[i] =... | a.cc: In function 'int main()':
a.cc:21:20: error: 'ensl' was not declared in this scope
21 | cout << ans << ensl;
| ^~~~
|
s106445455 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,s,n) for(int i = s; i < (int)(n); i++)
int main() {
int n;
string s;
cin >> n >> s;
int x = 0,ans = 0;
rep(i,0,s){
if(s[i] == 'I') x++;
else x--;
ans = max(ans,x);
}
cout << ans << endl;... | a.cc: In function 'int main()':
a.cc:5:39: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
5 | #define rep(i,s,n) for(int i = s; i < (int)(n); i++)
| ^~~~~~~~
a.cc:12:3: note: in expansion of macro 'rep'
12 | rep(i,0... |
s949990430 | p03827 | C++ | /*
author : nishi5451
created : 12.08.2020 22:15:41
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
int main(){
int n;
string s;
cin >> n >> s;
int now = 0;
int mx = 0;
rep(i,n){
if(s[i]=='I') now++;
e... | a.cc: In function 'int main()':
a.cc:23:5: error: 'coiut' was not declared in this scope
23 | coiut << mx << endl;
| ^~~~~
|
s066050955 | p03827 | C++ | #include <stdio.h>
int main(){
int test;
scanf("%d", &test);
char word[test];
int x = 0;
int max = 0;
for(int i = 0; i < n; i++){
scanf("%c", &word[i]);
if(str[i] == 'D'){
x--;
}else{
x++;
}
if(x > max){
max = x;
... | a.cc: In function 'int main()':
a.cc:9:24: error: 'n' was not declared in this scope
9 | for(int i = 0; i < n; i++){
| ^
a.cc:11:12: error: 'str' was not declared in this scope; did you mean 'std'?
11 | if(str[i] == 'D'){
| ^~~
| std
|
s913574749 | p03827 | C | #include <bits/stdc++.h>
int main()
{
int x=0,N;
scanf("%d",&N);
char s[N+1];
scanf("%s",&s);
int max=0;
for(int i=0;i<N;i++){
if(s[i]=='I'){
x++;
}else{
x--;
}
if(max<x){
max=x;
}
}
printf("%d\n",max);
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s353746065 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef vector<int> vi;;
typedef vector<ll> vll;
#define l() length()
#define sz() size()
#define b() begin()
#define e() end()
#define all(x) x.begin(... | a.cc: In function 'int _find(std::string&)':
a.cc:46:6: error: expected '}' at end of input
46 | }
| ^
a.cc:34:23: note: to match this '{'
34 | int _find(string &str){
| ^
a.cc:46:6: warning: no return statement in function returning non-void [-Wreturn-type]
46 | ... |
s185750716 | p03827 | C++ | #include<bits.stdc++.h>
using namespace std;
int main(){
int N; cin>>N;
int A=0;
int Ans=0;
string S; cin>>S;
for(int i=0; i<N; i++){
if(S.at(i)=='I')
A++;
else A--;
Ans=max(Ans,A);
}
cout<<Ans<<endl;
}
| a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s036743777 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;
int main()
{
int n;
cin >> n;
char c;
int x,M;
for (int i = 0; i < n; i++)
{
cin >> c;
if (c=='I')
{
x++;
}
else
{
x--;
}
... | a.cc: In function 'int main()':
a.cc:22:19: error: request for member 'M' in 'x', which is of non-class type 'int'
22 | M = max(x.M);
| ^
|
s027771267 | p03827 | C++ | n=int(input())
s=input()
t=0
m=0
for x in s:
if x=='I': t+=1
else: t-=1
m = max(m, t)
print(max(m, 0)) | a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())
| ^
|
s674631103 | p03827 | C++ | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define leadinz zero str.erase(0, min(str.find_first_not_of('0'), str.size()-1));
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef tree<ll, null_type, less<ll>... | a.cc: In function 'int main()':
a.cc:74:5: error: 'mx' was not declared in this scope
74 | mx=0;
| ^~
|
s724879617 | p03827 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(void){
int n;
string s;
cin >> n;
cin >> s;
int t = 0;
int ans = 0;
for(int i = 0;i < n;i++{
switch(s[i]){
case 'I':
t++;
ans = max(ans,t);
break;
... | a.cc: In function 'int main()':
a.cc:13:28: error: expected ')' before '{' token
13 | for(int i = 0;i < n;i++{
| ~ ^
| )
|
s227465887 | p03827 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(void){
int n;
string s;
cin >> n;
cin >> s;
int t = 0;
int ans = 0;
for(int i = 0;i < n;i++{
switch(s[i]){
case 'I':
t++;
ans = max(ans,t);
break;
... | a.cc: In function 'int main()':
a.cc:13:28: error: expected ')' before '{' token
13 | for(int i = 0;i < n;i++{
| ~ ^
| )
|
s634689058 | p03827 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int n,x=0,ans=0;
string s;
cin>>n>>s;
for(auto i:s){
if(i=='I'){
x++;
}else{
x--;
}
ans=max(ans,x);
}
cout<<"ans"<<endl; | a.cc: In function 'int main()':
a.cc:17:21: error: expected '}' at end of input
17 | cout<<"ans"<<endl;
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s097943971 | p03827 | C++ | import sys
import math
import bisect
def main():
n = int(input())
max_val = 0
val = 0
for c in input():
if c == 'I':
val += 1
elif c == 'D':
val -= 1
max_val = max(max_val, val)
print(max_val)
if __name__ == "__main__":
main()
| a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s450186646 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,nu=0,x=0;
string s;
cin>>n>>s;
for(int i=0;i<n;i++){
if(s[i]=='I'){
nu++;
}
else if(s[i]=='D'){
nu--;
}
if(nu>x){
x=nu;
}
cout<<x<<endl;
}
| a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s914637501 | p03827 | C++ | #include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int a,b,state,n;
cin>>n;
char data;
cin>>data;
b=0;
a=0;
state=0;
for(int i=0;i<n;i++){
if(data[i]=='I')a+=1;
else if(data[i]=='D')a-=1;
if(a>b){
b=a;
state=i+1;
}
... | a.cc: In function 'int main()':
a.cc:16:12: error: invalid types 'char[int]' for array subscript
16 | if(data[i]=='I')a+=1;
| ^
a.cc:17:17: error: invalid types 'char[int]' for array subscript
17 | else if(data[i]=='D')a-=1;
| ^
|
s150060628 | p03827 | C++ | #include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int a,b,state;
cin>>a;
char data;
cin>>data;
b=0;
a=0;
state=0;
for(int i=0;i<sizeof(data)/sizeof(*data);i++){
if(data[i]=='I')a+=1;
else if(data[i]=='D')a-=1;
if(a>b){
b=a;
... | a.cc: In function 'int main()':
a.cc:15:37: error: invalid type argument of unary '*' (have 'char')
15 | for(int i=0;i<sizeof(data)/sizeof(*data);i++){
| ^~~~~
a.cc:16:12: error: invalid types 'char[int]' for array subscript
16 | if(data[i]=='I')a+=1;
| ... |
s717832676 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll size, ans = ans_tmp = 0;
string s;
cin >> size >> s;
for(int i = 0; i < size(); i++){
if(s[i] == 'I'){
ans_tmp++;
ans = max(ans, ans_tmp);
}else{
ans_tmp--;
}... | a.cc: In function 'int main()':
a.cc:7:20: error: 'ans_tmp' was not declared in this scope
7 | ll size, ans = ans_tmp = 0;
| ^~~~~~~
a.cc:11:28: error: 'size' cannot be used as a function
11 | for(int i = 0; i < size(); i++){
| ~~~~^~
|
s832018723 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,x=0,cnt[105],val=-1000000;
string s;
cin>>n;
cin>>s;
for(int i=0;i<n;i++){
if(s[i]=='I') x++;
else x--;
cnt[i]=x;
}
cnt[n]=0;
for(int i=0;i<=n;i++) val=max(val,cnt[i]);
cout<<val<<endl;
return 0; | a.cc: In function 'int main()':
a.cc:16:18: error: expected '}' at end of input
16 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s805299462 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,x=0,cnt[105],val=-1000000;
string s;
cin>>n;
cin>>s;
for(int i=0;i<n;i++){
if(s[i]=='I') x++;
else x--;
cnt[i]=x;
}
cnt[n]=0;
for(int i=0;i<=n;i++) val=max(val,cnt[i]);
cout<<val<<endl;
return 0; | a.cc: In function 'int main()':
a.cc:16:18: error: expected '}' at end of input
16 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s555661839 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int ctoi(const char c) {
if ('0' <= c && c <= '9') return (c - '0');
return -1;
}
vector<int> input(int n) {
vector<int> vec(n);
for (int i = 0; i < n; i++) {
cin >> vec.at(i);
}
return vec... | a.cc: In function 'int main()':
a.cc:90:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
90 | if(s[i]=="I"){
|
s145490414 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, count=0;
cin >> n;
string s;
cin >> s;
for (char c: s){
if ( c == "I") count++;
else count--;
maxc = max(maxc,count);
}
| a.cc: In function 'int main()':
a.cc:11:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if ( c == "I") count++;
| ~~^~~~~~
a.cc:13:17: error: 'maxc' was not declared in this scope
13 | maxc = max(maxc,count);
| ... |
s323995843 | p03827 | C | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define COIN const int
#define ite iterator
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define REPD(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define ALL(c) (c).begin(),... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s582435135 | p03827 | C++ | //#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, ... | a.cc: In function 'int main()':
a.cc:61:21: error: expected ';' before '}' token
61 | chmax(ans,x)
| ^
| ;
62 | }
| ~
|
s412236317 | p03827 | C++ | //#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, ... | a.cc: In function 'int main()':
a.cc:61:21: error: expected ';' before '}' token
61 | chmax(ans,0)
| ^
| ;
62 | }
| ~
|
s626676919 | p03827 | C++ | #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
... | a.cc: In function 'int main()':
a.cc:40:1: error: 're' was not declared in this scope; did you mean 'rep'?
40 | re
| ^~
| rep
a.cc:40:3: error: expected '}' at end of input
40 | re
| ^
a.cc:26:12: note: to match this '{'
26 | int main() {
| ^
|
s042068351 | p03827 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s,ans=0,max=0;
int n;
cin>>n;
cin>>s;
for(int i=0;i<n;i++){
if(s[i]=='I') {
ans++;
if(ans>max) max=ans;
}else ans--;
}
cout<<max<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:10: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
11 | ans++;
| ~~~^~
a.cc:13:14: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
13 | }else ans--;
| ~~~^~
|
s108801779 | p03827 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s,ans,max=0;
int n;
cin>>n;
cin>>s;
for(int i=0;i<n;i++){
if(a[i]=='I') {
ans++;
if(ans>max) max=ans;
}else ans--;
}
cout<<max<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:8: error: 'a' was not declared in this scope
10 | if(a[i]=='I') {
| ^
a.cc:11:10: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
11 | ans++;
| ~~~^~
a.cc:13:14: error: no 'operator--(int)' declared for postfix '--' [-... |
s118883821 | p03827 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
long long N,Q,a,b,count=0;
string S;
cin>>N>>S;
int k=0;
for (int i=0; i<N; i++){
if(S.at(i)=='I'){
count++;}
else{
count--;}
k=max(k,count);}
cout<<k<<endl;}
| a.cc: In function 'int main()':
a.cc:15:8: error: no matching function for call to 'max(int&, long long int&)'
15 | k=max(k,count);}
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c... |
s493184817 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(false);
int n;
cin>>n;
string s;
cin>>s;
if(s[0]=='I'){
a[0]=1;
}else{
a[0]=-1;
}
for(int i=1;i<n;i++){
if(s[i]=='I'){
a[i]=a[i-1]+1;
}else{
a[i]=a[i-1]-1;
}
}
sort(a,... | a.cc: In function 'int main()':
a.cc:12:5: error: 'a' was not declared in this scope
12 | a[0]=1;
| ^
a.cc:14:5: error: 'a' was not declared in this scope
14 | a[0]=-1;
| ^
a.cc:18:7: error: 'a' was not declared in this scope
18 | a[i]=a[i-1]+1;
| ^
a.cc:20:8: erro... |
s798048508 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n
string s;
cin >> n >> s;
int x = 0;
int ans = 0;
for(char c:s){
if(c=='I') x++;
else x--;
ans = max(ans,x);
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'string'
6 | string s;
| ^~~~~~
a.cc:7:10: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | cin >> n >> s;
| ^
| yn
a.cc:7:15: error: 's' was not declared in this scope
7 |... |
s391454419 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
string s;
cin >> s;
int i,j;
for(j=0;j<n;j++){
int x=0;
for(i=0;i<j;i++){
if(s.at(i)=='I'){
x++;
}
if(s.at(i)=='D'){
x--;
}
x=max(0,x);
}
}
cout << x;
} | a.cc: In function 'int main()':
a.cc:21:11: error: 'x' was not declared in this scope
21 | cout << x;
| ^
|
s700331271 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ft ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define pi pair<int,int>
#define pb push_back
#define F first
#define S second
const int N=2e5+3;
//string s,p;
//vector<int>v;
//map<int,int>mp;
int main()
{
ft
ll t,... | a.cc: In function 'int main()':
a.cc:18:10: error: 's' was not declared in this scope
18 | cin>>s;
| ^
|
s333236211 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
string s;
cin >> s;
int ans=0;
int count=0;
for (int i=0;i<n;++i){
if (s[i]==I){
count++;
}
if (s[i]==D){
count--;
}
ans=max(ans,count);
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:13:15: error: 'I' was not declared in this scope
13 | if (s[i]==I){
| ^
a.cc:16:15: error: 'D' was not declared in this scope
16 | if (s[i]==D){
| ^
|
s178418005 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
int main()
{
int n;
cin>>n;
int ans=0;
int maxn=-100;
while(n--)
{
char x;
cin>>x;
if(x=='I')ans++;
else if(x=='D') ans--;
maxn=max(maxn,ans);
}
cout<<maxn<<endl;
return 0;
} | cc1plus: error: '::main' must return 'int'
|
s300581857 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
signed main(){
string S;
cin>>S;
int x=0;
int ans=0;
REP(i,S.size()){
if(S[i]=='I')x++;
if(S{i}=='D')x--;
ans=max(ans,x);
}
... | a.cc: In function 'int main()':
a.cc:14:13: error: expected ')' before '{' token
14 | if(S{i}=='D')x--;
| ~ ^
| )
a.cc:14:12: error: could not convert 'S' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
14 | if(S{i}=='D')x--;
| ... |
s417913970 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
signed main(){
string S;
cin>>S;
int x=0;
int ans=0;
REP(i,S.size()){
if(S[i]=='I')x++;
if(S{i}=='D')x--;
ans=max(ans,x);
}
... | a.cc: In function 'int main()':
a.cc:14:13: error: expected ')' before '{' token
14 | if(S{i}=='D')x--;
| ~ ^
| )
a.cc:14:12: error: could not convert 'S' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
14 | if(S{i}=='D')x--;
| ... |
s249779912 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename L> using gpp_map = tre... | a.cc: In function 'int main()':
a.cc:31:13: error: expected primary-expression before 'long'
31 | #define int long long
| ^~~~
a.cc:76:15: note: in expansion of macro 'int'
76 | cout<<max(int 0,ans[0])<<endl;
| ^~~
|
s754227624 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, x = 0, prev = INT_MIN, maxi;
cin>>n;
string s;
cin>>s;
for (i = 0; i < n; i++)
{
if (s[i] == 'I')
x++;
else
x--;
maxi = max(x, prev);
prev = a[i];
}
cout<<maxi;
}
| a.cc: In function 'int main()':
a.cc:16:24: error: 'a' was not declared in this scope
16 | prev = a[i];
| ^
|
s436353756 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, x = 0, prev = INT_MIN, max;
cin>>n;
string s;
cin>>s;
for (i = 0; i < n; i++)
{
if (s[i] == 'I')
x++;
else
x--;
max = max(x, prev);
}
cout<<max;
}
| a.cc: In function 'int main()':
a.cc:15:26: error: 'max' cannot be used as a function
15 | max = max(x, prev);
| ~~~^~~~~~~~~
|
s355411129 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n, x = 0, ans = 0;
string s;
cin >> n >> s;
REP(i, n) {
if ... | a.cc:29:2: error: stray '#' in program
29 | }#include <bits/stdc++.h>
| ^
a.cc:29:3: error: 'include' does not name a type
29 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:38:5: error: redefinition of 'int main()'
38 | int main() {
| ^~~~
a.cc:10:5: note: 'int main()' previously defined h... |
s777903333 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
string s(n);
cin >> s;
int x = 0, max = 0;
for (int i=0; i<n; i++) {
if (s.at(i) == 'I') {
x++;
if (x > max) {
max = x;
}
}
else {
x--;
}
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:8:13: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
8 | string s(n);
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/incl... |
s557778950 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,a,X=0;
cin >> N;
string S(N);
cin S;
for(int i=0;i<N;i++){
if(S.at(i)=='I')
X++;
else
X--;
a=max(a,X)
}
cout << a << endl;
} | a.cc: In function 'int main()':
a.cc:7:13: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
7 | string S(N);
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/incl... |
s877681166 | p03827 | 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 int INF= 1e9+5;
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=1000000007L... | a.cc: In function 'int main()':
a.cc:27:18: error: expected ';' before '}' token
27 | cout<<MAX<<endl
| ^
| ;
28 | }
| ~
|
s357504504 | p03827 | C++ | int main(){
int n;
string s;
cin>>n;
cin>>s;
int ans=0;
int now=0;
for(int i=0;i<s.size();i++){
if(s[i]=='I'){
now++;}
else{
now--;
}
ans=max(ans,now);
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
4 | string s;
| ^~~~~~
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin>>n;
| ^~~
a.cc:6:6: error: 's' was not declared in this scope
6 | cin>>s;
| ^
a.cc:15:13: error: 'max' was not ... |
s426397231 | p03827 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int mod = 1000000007;
int main(void){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int ans = 0;
int N; cin >> N;
string S; cin >> S;
int ans = 0, pos = 0;
rep(i, N){
... | a.cc: In function 'int main()':
a.cc:15:9: error: redeclaration of 'int ans'
15 | int ans = 0, pos = 0;
| ^~~
a.cc:12:9: note: 'int ans' previously declared here
12 | int ans = 0;
| ^~~
|
s884572792 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int MAX = 0 , sum = 0 , n;
char s;
cin >> n;
while(n--){
cin >> s;
s == 'I' ? (sum++) : (sum--);
MAX = max (MAX , sum);
}
cout << max << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
12 | cout << max << endl;
| ~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:41,
from /us... |
s097478989 | p03827 | C++ | #include"bits/stdc++.h"
using namespace std;
int main() {
int N, S;
cin >> N >> S;
int x = 0;
int record = 0;
for (int i = 0;i < N;++i) {
if (S[i] == 'I') {
x += 1;
}
else {
x -= 1;
}
if (x > record) {
record = x;
}
}
cout << record << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:22: error: invalid types 'int[int]' for array subscript
10 | if (S[i] == 'I') {
| ^
|
s983593191 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
int ans = 0;
int count = 0;
for (int i = 0; i < N; i++) {
if (S[i] == 'I') {
count++;
}
else if (S[i] == 'D') {
count--+
}
ans = max(ans,count);
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:5: error: expected primary-expression before '}' token
15 | }
| ^
|
s347792890 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s(n);
cin >> s;
int x=0;
int y=0;
for(int i=0;i<n;i++){
if(s.at(i)=='I'){
x++;
}
else{
x--;
}
y = max(y,x);
}
cout << y << endl;
}
| a.cc: In function 'int main()':
a.cc:7:13: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
7 | string s(n);
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/incl... |
s231163596 | p03827 | C++ | #include<iostream>
using namespace std ;
int main(){
int n ; cin >> n ;
char c ;
int ans = x = 0 ;
for(int i=0;i<n;i++){
cin >> c ;
if(c=='I'){
if(ans==x) ans = x = x+1 ;
else x++ ;
}else x-- ;
}
cout << ans << endl ;
} | a.cc: In function 'int main()':
a.cc:7:19: error: 'x' was not declared in this scope
7 | int ans = x = 0 ;
| ^
|
s034989270 | p03827 | C++ | #include<iostream>
using namespace std;
int main(){
int unko,x=0;
string aho;
cin>>unko>>aho;
for(int i;i<aho.size();i++){
if(aho[i]=="I")
x++;
else
x--;
unko=max(unko,x);
}
cout<<unko<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(aho[i]=="I")
|
s898062626 | p03827 | C++ | #include<iostream>
using namespace std;
int main(){
int unko;
string aho;
cin>>unko>>aho;
for(int i;i<size(aho);i++){
unko=max(unko,aho.at(i));
}
cout<<unko<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:13: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
8 | unko=max(unko,aho.at(i));
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/in... |
s487729728 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,s;
cin >> n >> s;
int count=0;
int ans=0;
for(int i=0;i<n;i++){
if(s.at(i)=='I'){
count++;
}
else{
count--;
}
ans=max(ans,count);
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:14: error: request for member 'at' in 's', which is of non-class type 'int'
10 | if(s.at(i)=='I'){
| ^~
|
s356717180 | p03827 | Java | import java.util.*;
public class Main{
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
String S = sc.next();
char I = 'I';
int ans = 0;
int maxAns = 0;
char[]list = S.toCharArray();
for(int i = 0; i < N; i++){
// char A = list[i... | Main.java:25: error: reached end of file while parsing
}
^
1 error
|
s238405730 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n; string s;
cin >> n >> s;
int x=0;int max=0;
for(int i=0;i<n;++i){
if(s[i]='I') ++x;
else if(s[i]='D') --y;
if(max<=x) max=x;
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:10:29: error: 'y' was not declared in this scope
10 | else if(s[i]='D') --y;
| ^
|
s283461396 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
string S;
int ans;
cin >> N >> S;
for(int i = 0;i < N;i ++){
if(S.at(i) == "I"){
ans ++;
}else if(S.at(i) == "D"){
ans --;
}
}
cout << ans <<endl;
}
| a.cc: In function 'int main()':
a.cc:13:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if(S.at(i) == "I"){
| ~~~~~~~~^~~~~~
a.cc:17:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | }else if(S.at(i) == "D"){
| ... |
s211662383 | p03827 | C++ | #include<iostream>
#include<fstream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
using namespace std;
long long n,h,da=0;
string st;
int main()
{
cin>>n;
cin>>st;
for(int i=0;i<st.size();i++)
{
if(st[i]=='I')h++;
else h--;
if(h>da)da=h... | a.cc:21:9: error: extended character 。 is not valid in an identifier
21 | 高度。
| ^
a.cc: In function 'int main()':
a.cc:21:9: error: '\U00009ad8\U00005ea6\U00003002' was not declared in this scope
21 | 高度。
| ^~~~~~
|
s741549775 | p03827 | C++ | #include<bits/stdc++.h>
#include<conio.h>
using namespace std;
int getint(void)
{
int a;
scanf("%d",&a);
return a;
}
int main(void)
{
char p;int n=getint(),sum=0,maxn=0;
for(int i=1;i<=n;i++)
{
p=getch();
if(p=='I') sum++;
else sum--;
maxn=max(maxn,sum);
}
printf("%d",maxn);
return 0;
} | a.cc:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s637666551 | p03827 | C++ | #include<bits/stdc++.h>
#include<conio.h>
using namespace std;
int getint(void)
{
int a;
scanf("%d",&a);
return a;
}
int main(void)
{
char p;int n=getint(),sum=0,maxn=0;
for(int i=1;i<=n;i++)
{
p=getch();
if(p=='I') sum++;
else sum--;
maxn=max(maxn,sum);
}
printf("%d",maxn);
return 0;
} | a.cc:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s573134201 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N
string S;
cin>>N>>S;
int x=0;
int a=0;
for(int i=0;i<N;i++){
if(S.at(i)=='I'){
x++;
a=max(a,x);
}else{
x--;
}
}
cout<<a<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'string'
6 | string S;
| ^~~~~~
a.cc:7:8: error: 'N' was not declared in this scope
7 | cin>>N>>S;
| ^
a.cc:7:11: error: 'S' was not declared in this scope
7 | cin>>N>>S;
| ^
|
s159363443 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,max,ma;
char m;
int main(){
cin>>n;
for(int i=1;i<=n;i++) {
cin>>m;
if(m=='I') max++;
else ans--;
if(ans>ma) max=ma;
}
cout<<ma<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:20: error: reference to 'max' is ambiguous
9 | if(m=='I') max++;
| ^~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/inclu... |
s713978649 | p03827 | Java | import java.util.*;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
String s=sc.next();
int max=0;
int x=0;
if(s.length==n){
for(int i=0;i<n;i++) {
if(s.charAt(i)=='I'){
x++;
} else {... | Main.java:10: error: cannot find symbol
if(s.length==n){
^
symbol: variable length
location: variable s of type String
1 error
|
s183182293 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,x=0,Xmax=0;
string S;
cin>>N>>S;
for(int i=0; i<N; i++){
if(S.at(i)=='I'){x++;}
else if(S.at(i)=='D'){x--:}
if(Xmax<x){Xmax=x;}
}
cout<<Xmax<<endl;
}
| a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before ':' token
12 | else if(S.at(i)=='D'){x--:}
| ^
| ;
|
s748158125 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int max(int a,int b)
{
return a>b?a:b;
}
int main()
{
long long n,a[1000001],y,z=-100000;
string s;
cin>>n
for(register int i=0;i<n;i++)
{
if(a[i]=='I') y++;
else y--;
z=max(y,z);
}
cout<<z<<endl;
exit(0);
} | a.cc: In function 'int main()':
a.cc:11:11: error: expected ';' before 'for'
11 | cin>>n
| ^
| ;
12 | for(register int i=0;i<n;i++)
| ~~~
a.cc:12:26: error: 'i' was not declared in this scope
12 | for(register int i=0;i<n;i++)
| ... |
s711943152 | p03827 | C++ |
N = int(input())
S = input()
num = 0
ans = 0
for s in S:
if s == 'I':
num += 1
else:
num -= 1
ans = max(ans, num)
print(ans) | a.cc:2:1: error: 'N' does not name a type
2 | N = int(input())
| ^
|
s873117764 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, sum=0,m=0;
string s;
cin >> n >> s;
for(int i=0; i<n; i++){
if(s[i]=='I') sum++;
else sum--;
m = max(m, sum);
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:14:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
14 | cout << max << endl;
| ~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:41,
... |
s223711834 | p03827 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, sum=0,m=0;
string s;
cin >> n >> s;
for(int i=0; i<n; i==){
if(s[i]=='I') sum++;
else sum--;
m = max(m, sum);
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:9:24: error: expected primary-expression before ')' token
9 | for(int i=0; i<n; i==){
| ^
a.cc:14:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
... |
s095992866 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
void solve(){
int n;
string s;
cin>>n>>s;
int maxi=0;
int cnt=0;
for(auto e:s){
if(e=='I'){
cnt++
maxi=max(maxi, cnt);
}else{
cnt--;
}
}
cout<<maxi<<endl;
}
signed main(){
//while(1)
solve();
} | a.cc: In function 'void solve()':
a.cc:14:30: error: expected ';' before 'maxi'
14 | cnt++
| ^
| ;
15 | maxi=max(maxi, cnt);
| ~~~~
|
s439646446 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,t=0,maxn=0;
string s;
int main()
{
scanf("%d%s",&n,s+1);
for(int i=0;i<n;i++)
{
if(s[i]=='I') ++t;
else --t;
maxn=max(maxn,t);
}
cout<<maxn<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:22: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
7 | scanf("%d%s",&n,s+1);
| ~^~
| | |
| | int
| ... |
s997838222 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,t=0,m=0;
string s;
int main()
{
scanf("%d%s",&n,s+1);
for(int i=0;i<n;i++)
{
if(s[i]=='I') ++t;
else --t;
m=max(m,t);
}
cout<<m<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:22: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
7 | scanf("%d%s",&n,s+1);
| ~^~
| | |
| | int
| ... |
s314191191 | p03827 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,t=0,m=0;
string s;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>s[i];
if(s[i]=='I') ++t;
else --t;
m=max(m,pos);
}
cout<<m<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:25: error: 'pos' was not declared in this scope; did you mean 'pow'?
13 | m=max(m,pos);
| ^~~
| pow
|
s489364339 | p03827 | C++ | #include<cstdio>
using namespace std;
int n;
char s;
int main()
{
scanf("%d", &n);
int ans = 0;
int maxn = -1e9;
for(int i = 0; i < n; i++)
{
scanf("%c", &s);
if(s[i] == 'I') ans += 1;
if(s[i] == 'D') ans -= 1;
if(maxn < ans) maxn = ans;
}
printf("%d\n", maxn);
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:21: error: invalid types 'char[int]' for array subscript
13 | if(s[i] == 'I') ans += 1;
| ^
a.cc:14:21: error: invalid types 'char[int]' for array subscript
14 | if(s[i] == 'D') ans -= 1;
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.