submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s276096402
p03695
C++
// need #include <iostream> #include <algorithm> // data structure #include <bitset> //#include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> //#include <array> //#include <tuple> //#include <unordered_map> //#include <unordered_set> #incl...
a.cc: In function 'int main()': a.cc:111:27: error: no matching function for call to 'max(std::set<long long int>::size_type, unsigned int)' 111 | int min = std::max(set.size(), 1u); | ~~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /...
s446971877
p03695
C++
#pragma comment(linker, "/STACK:64000000") #include <iostream> #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <cassert> #include <ctime> #include <sstream> #include <algorithm> #include <functional> #include <numeric> #include <string> #include <vector> #include <queue> #include <stac...
a.cc: In function 'int main()': a.cc:75:35: error: no matching function for call to 'min(int, std::set<int>::size_type)' 75 | cout << s.size() << " " << min(8, s.size() + cnt) << endl; | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, ...
s146140718
p03695
C++
#pragma comment(linker, "/STACK:64000000") #include <iostream> #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <cassert> #include <ctime> #include <sstream> #include <algorithm> #include <functional> #include <numeric> #include <string> #include <vector> #include <queue> #include <stac...
a.cc: In function 'int main()': a.cc:72:30: error: expected ';' before '}' token 72 | else s.insert(get(x)) | ^ | ; 73 | } | ~ a.cc:75:35: error: no matching function for call to 'min(int, std::set...
s940020892
p03696
Java
import java.math.BigInteger; import java.util.*; public class B { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); String s=sc.next(); int ob=0; int cb=0; boolean check=false; Deque<Character> dq=new LinkedList<>(); for(int i=0;i<n;i++) { dq.addLast(s...
Main.java:4: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s833909931
p03696
C++
#include <bits/stdc++.h> using namespace std; #define for0(i, n) for (int i = 0; i < (int)(n); ++i) #define for1(i, n) for (int i = 1; i <= (int)(n); ++i) #define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) #define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) #define forr1(i, n) for (int i = (int...
a.cc: In function 'int main()': a.cc:45:31: error: expected ';' before '}' token 45 | beginning+='(' | ^ | ; 46 | } | ~
s610541735
p03696
C++
void solve() { ll n; cin>>n; string s; cin>>s; ll cnt=0; string t=""; for(ll i=0;i<n;i++) { if(s[i]==')' && cnt==0) t='('+t; else if(s[i]==')') cnt--; else cnt++; t+=s[i]; } while(cnt>0) { t+=')'; cnt--; } cout<<t; return; }
a.cc: In function 'void solve()': a.cc:3:9: error: 'll' was not declared in this scope 3 | ll n; | ^~ a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin>>n; | ^~~ a.cc:4:14: error: 'n' was not declared in this scope 4 | cin>>n; | ...
s256805939
p03696
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string s; cin >> s; int cnt)=0; int cnt(=0; stack<char> st; for(int i=0;i<n;++i){ if(!st.empty()){ if(st.top()=='(' && s[i]==')')st.pop(); else st.push(s[i]); } else st.p...
a.cc: In function 'int main()': a.cc:10:12: error: expected initializer before ')' token 10 | int cnt)=0; | ^ a.cc:11:14: error: expected primary-expression before '=' token 11 | int cnt(=0; | ^ a.cc:21:29: error: expected ';' before ')' token 21 | if(st.top...
s883849875
p03696
C++
#define _GLIBCXX_DEBUG #include<bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; #define vec(s) vector<s>; #define vvec(s) vector<vector<s>> ; typedef vector<lli> vi; typedef vector<vi> vvi; typedef pair<lli,lli> pii; #define rep(i, n) for (int i = 0; i < (int)(n); i++...
a.cc: In function 'int main()': a.cc:39:16: error: expected ';' before '}' token 39 | c++ | ^ | ; 40 | } | ~
s003335759
p03696
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n; string s; cin >> n >> s; ll left = 0; ll right = 0; ll pi = 0; for(int i = 0; i < n; i++){ if(s[i] == '(') left++; if(s[i...
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s322523391
p03696
C++
6 )))())
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 | ^
s855913239
p03696
Java
import java.util.Scanner; public class Maiin { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s = sc.next(); int left = 0; StringBuilder l = new StringBuilder(""); StringBuilder r = new StringBuilder(""); for (int i = 0; i < n; i++) { S...
Main.java:5: error: class Maiin is public, should be declared in a file named Maiin.java public class Maiin { ^ 1 error
s454367090
p03696
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < n; i++) #include <vector> using namespace std; int main(){ int n; cin >> n; string s; cin >> s; vector<int> checked(n,0); int pair = 0; int right = 0; int left = 0; rep(i, n-1){ if(s[i] == '(' && !checked[i]){ //left++; for(i...
a.cc:36:15: warning: missing terminating " character 36 | cout << "\n; | ^ a.cc:36:15: error: missing terminating " character 36 | cout << "\n; | ^~~~ a.cc: In function 'int main()': a.cc:37:5: error: expected primary-expression before '}' token 37 | }els...
s380374231
p03696
Java
class Main { static int mod = (int) (Math.pow(10,9)+7); // static int mod = 998244353; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String S = sc.next(); char[] c = S.toCharArray(); int lcnt=0; i...
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s037160753
p03696
C++
#include <iostream> #include <string> using namespace std; string reduce(string s) { auto pos = s.find("()"); if (pos == string::npos) { return s; } return reduce(s.erase(pos, 2)); } int main() { int N; string S; cin >> N >> S; string T = reduce(S); int l = count(T.begin(), T.end(), '('); int r = count(...
a.cc: In function 'int main()': a.cc:22:17: error: 'count' was not declared in this scope 22 | int l = count(T.begin(), T.end(), '('); | ^~~~~
s692108515
p03696
C++
#include<bits/stdc++.h> #include <iostream> #include <string> #include <cmath> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repR(i,n) for(ll i=n;i>=0;i--) #define all(v)(v).begin(),...
a.cc: In function 'int main()': a.cc:60:3: error: expected ',' or ';' before 'while' 60 | while(l){ | ^~~~~
s353486805
p03696
C++
#include<bits/stdc++.h> #include <iostream> #include <string> #include <cmath> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repR(i,n) for(ll i=n;i>=0;i--) #define all(v)(v).begin(),...
a.cc: In function 'int main()': a.cc:6:12: error: expected primary-expression before 'long' 6 | #define ll long long | ^~~~ a.cc:59:16: note: in expansion of macro 'll' 59 | vector<char> ll(0),rr(0) | ^~ a.cc:65:5: error: 'rr' was not declared in this scope; did you mean '...
s867415235
p03696
C++
#include <iostream> #include <sstream> #include <algorithm> #include <functional> #include <iterator> #include <numeric> #include <cstdint> #include <cmath> #include <bitset> #include <string> #include <list> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #define N_TIMES(i, n) fo...
a.cc: In function 'int main()': a.cc:33:3: error: 'debug' was not declared in this scope 33 | debug(d); | ^~~~~
s827706595
p03696
C++
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; string str; string s2; int left(0), right(0); while (n--) { char c; cin >> c; if (s2.empty() || !(s2.back() == '(' && c == ')')) { s2 += c; c == '(' ? left++ : right++; } else if (!s2.empty()...
a.cc: In function 'int main()': a.cc:18:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop' 18 | s2.pop(); | ^~~
s447757079
p03696
C++
#include <iostream> #include <string> int main() { int n; cin >> n; string str; string s2; int left(0), right(0); while (n--) { char c; cin >> c; if (s2.empty() || !(s2.back() == '(' && c == ')')) { s2 += c; c == '(' ? left++ : right++; } else if (!s2.empty()) { s2.back() ...
a.cc: In function 'int main()': a.cc:6:3: 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 to sta...
s763825671
p03696
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i=0; i<(int)(n); i++) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll MOD = 1000000007; const ll INF = 9999999999; template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}retu...
a.cc: In function 'int main()': a.cc:16:16: error: 'N' was not declared in this scope 16 | int n; cin >>N; | ^
s766899484
p03696
C
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; int main(){ int n; cin >> n; string s; cin >> s; stack<char> stk; rep(i,n){ if(!stk.empty() && (stk.top() == '(' && s.at(i) == ')')){ stk.pop(); }else{ stk.push(s.at(i)); } } int lcnt = 0; ...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s417654025
p03696
C++
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; string s; cin >> n >> s; int l = 0, r = 0; int x = n; for(int i = 0; i < n; i++){ if(s[i] == '(') l++; else r++; int d = l-r; x = min(x, d); } ...
a.cc: In function 'int main()': a.cc:20:24: error: 'd' was not declared in this scope 20 | for(int i = 0; i < d-x; i++) cout << ")"; | ^
s375943333
p03696
C++
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, a, b) for (int i = a; i <= (b); ++i) #define repr(i, a, b) for (int i = a; i >= (b); --i) #define bit(n) (1LL << (n)...
a.cc: In function 'int main()': a.cc:51:7: error: 'i' was not declared in this scope 51 | if (i != 0) { | ^
s381419896
p03696
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define co(a) cout<<a<<endl #define sz size #define bgn begin() #define en end() #define pb(a) push...
a.cc: In function 'int main()': a.cc:10:12: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig...
s100134898
p03696
C++
#include<iostream> #include<vector> #include<string> #include<cmath> #include<algorithm> #include <numeric> #include<map> #include<unordered_map> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<n;++i) #define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++) #define ALL(a) (a).begin...
a.cc: In function 'int main()': a.cc:34:49: error: expected ';' before 'cout' 34 | while(cnt > 0)s.insert(s.size(), ")"), cnt-- | ^ | ; ...... 37 | cout << s; | ~~~~ ...
s442747629
p03696
C++
#include<bits/stdc++.h> #pragma GCC optimize("Ofast") using namespace std; #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; ...
a.cc: In function 'int main()': a.cc:39:37: error: lvalue required as increment operand 39 | if(pointer == 0) ++need_left++; | ~~~~~~~~~^~
s995953228
p03696
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, i, count = 0, add = 0; string s; cin >> n >> s; for(i = 0; i < s.size(); i++){ if(s.at(i) == ')'){ count++; add = max(add, count); } else{ count--; add = max(add, count); } } for(i = 0; i < add; ...
a.cc: In function 'int main()': a.cc:24:18: error: 'addadd' was not declared in this scope 24 | for(i = 0; i < addadd-count; i++){ | ^~~~~~
s901599732
p03696
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; string S; cin >> S; string result; int a = 0; for(int i = 0;i < N;++i){ if(S[i] == '('){ a = a + 1; } if(S[i] == ')'){ if(a > 0){ a = a - 1; ...
a.cc: In function 'int main()': a.cc:24:23: error: redeclaration of 'std::string result' 24 | std::string result = result + ")"; | ^~~~~~ a.cc:23:23: note: 'std::string result' previously declared here 23 | std::string result = result + "("; | ...
s723528927
p03696
C++
8 ))))((((
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 8 | ^
s578199597
p03696
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int l_sum = 0; vector<int> V; for (int i = 0; i < N; i++) { if (S[i] == '(') { l_sum++; } else l_sum--; V.push_back(l_...
a.cc: In function 'int main()': a.cc:23:16: error: 'min_element' was not declared in this scope 23 | int min = *min_element(V.begin(), V.end()); | ^~~~~~~~~~~
s399582358
p03696
C++
#include <bits/stdc++.h> using namespace std; int N; string S; void abc064d() { int cnt[2] = {0, 0}; string res = S; if (S[0] == '(') { cnt[0]++; } else { cnt[1]++; } for (int i = 1; i < N; i++) { if (S[i] == '(') { cnt[0]++; } else if (S[i] == ')') { cnt[1]++; } ...
a.cc: In function 'void abc064d()': a.cc:33:9: error: expected '}' before 'else' 33 | else { | ^~~~ a.cc:28:28: note: to match this '{' 28 | if (cnt[0] > cnt[1]) { | ^ a.cc: At global scope: a.cc:42:15: error: 'cnt' was not declared in this scope; did y...
s888286313
p03696
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int r=0;l=0; string s; cin>>s; for(int i=0;i<n;i++){ if(s[i]=='('){ l++; }else{ if(l>0){ l--; }else{ r++; } } } for(int i=0;i<r;i++){ cout<<'('; } cout<<s; for(int i=0;i<...
a.cc: In function 'int main()': a.cc:6:11: error: 'l' was not declared in this scope 6 | int r=0;l=0; | ^
s792483822
p03696
C++
#include<bits/stdc++.h> int main(){ int n; cin>>n; string s; cin>>s; int cnt1=0,cnt2=0; for(int i=0; i<n; i++){ cin>>s[i]; if(s[i]=='('){cnt1++;} else{ if(cnt1>0){cnt1--;} else b++; } } if(b>0){ for(int i=0; i<b; i++){ cout<<'('; } } cout<<s; if(a>0){ ...
a.cc: In function 'int main()': a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin>>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::c...
s747730830
p03696
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; string s;cin>.s; string t="",u=""; vector<string> v={}; int a=0; for(int i=0;i<n-1;i++){ if(s[i]==')'&&s[i+1]=='('){ v.push_back(substr(a,i-a+1)); a=i+1; } } v.push_back(substr(a,n-a)); for(int i=0;i<v.size();i+...
a.cc: In function 'int main()': a.cc:5:16: error: expected primary-expression before '.' token 5 | string s;cin>.s; | ^ a.cc:11:19: error: 'substr' was not declared in this scope; did you mean 'strstr'? 11 | v.push_back(substr(a,i-a+1)); | ^~~~~~ | ...
s333646916
p03696
C++
//smartphone #include "bits/stdc++.h" using namespace std; #define rep(i,n) for(int i=0;i<n;++i) int main(){ int n,a=0,b=0;cin>>n;if(!n)cout<<"()",return 0; string s;cin>>s;rep(i,n){ a+=s[i]-'('?-1:1; b=min(a,b);}b=max(0,-b); if(a<0)rep(i,-a)s.insert(0,"(");else rep(i,a)s.push_back(')'); rep(i,b-abs(a)){s.inser...
a.cc: In function 'int main()': a.cc:6:40: error: expected primary-expression before 'return' 6 | int n,a=0,b=0;cin>>n;if(!n)cout<<"()",return 0; | ^~~~~~
s191274754
p03696
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> #include<utility> #include<numeric> #include<vector> #include<map> #include<unordered_map> #include<set> #include<tuple> #include<stack> #include<queue> #include<functional> #include<iterator> #include<cmath> #include<cctype> using namespace std;...
a.cc: In function 'int main()': a.cc:48:33: error: expected '}' before 'else' 48 | else if(ml+l > r){ | ^~~~ a.cc:45:46: note: to match this '{' 45 | if(ml+l < r) { | ...
s752350217
p03696
C++
include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <map> #include <stdio.h> #include <stack> #include <queue> #include <deque> #include <numeric> #define MAX 100000007 using namespace std; using ll = long long; ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __...
s813907620
p03696
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; string le, ri; int n = 0; int l = 0, r = 0; cin >> n >> s; for (int i = 0; i < n; i++) if (s[i] == ')') l++; for (int i = 0; i < n; i++) if (s[i] == '(') r++; for (int i = 0; i < n; i++) { if (s[i] == '(') { ...
a.cc: In function 'int main()': a.cc:18:21: error: 'a' was not declared in this scope 18 | a--; | ^
s466280765
p03696
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; string le, ri; int n = 0; int l = 0, r = 0; cin >> n >> s; for (int i = 0; i < n; i++) if (s[i] == ')') l++; for (int i = 0; i < n; i++) if (s[i] == '(') r++; for (int i = 0; i < n; i++) { if (s[i] == '(') { ...
a.cc: In function 'int main()': a.cc:18:21: error: 'a' was not declared in this scope 18 | a--; | ^
s595938600
p03696
C++
#include<iostream> #include<string> using namespace std; int main() { int N; string s; cin >> N >> s; int x = 1e9 + 1; int d; for(int i = 0; i <= N; i++) { string ss = s.substr(0, i); int l = count(ss.begin(), ss.end(), '('); int r = count(ss.begin(), ss.end(), ')')...
a.cc: In function 'int main()': a.cc:14:17: error: 'count' was not declared in this scope 14 | int l = count(ss.begin(), ss.end(), '('); | ^~~~~
s181252385
p03696
Java
import org.apache.commons.lang3.*; import java.util.*; public class Main { public void main(Scanner sc) { int n = sc.nextInt(); String s = sc.next(); int lastClose = s.lastIndexOf(')'); lastClose = lastClose == -1 ? n : lastClose; int firstOpen = s.indexOf('('); f...
Main.java:1: error: package org.apache.commons.lang3 does not exist import org.apache.commons.lang3.*; ^ Main.java:28: error: cannot find symbol System.out.println(StringUtils.repeat('(', head) + s + StringUtils.repeat(')', foot)); ^ symbol: variable StringUtils location: class ...
s804755669
p03696
C++
#include <bits/stdc++.h> using namespace std; string s; int n,d,c; int main() { cin>>n>>s; for(int i=0;i<n;i++){if(s[i]=='(')c++;else c--;d=min(c,d); for(int i=0;i<-d;i++)cout<<'(';cout<<s; for(int i=0;i<c-d;i++)cout<<')'; }
a.cc: In function 'int main()': a.cc:10:2: error: expected '}' at end of input 10 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s803844935
p03696
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <cmath> #include <cstdlib> #include <tuple> using ll = long long; using namespace std; #define modmod 1000000007 int main(){ int N; string S; cin >> N >> S; int left=0, right=0; string result; for(int i = 0;...
a.cc: In function 'int main()': a.cc:28:27: error: 'ans' was not declared in this scope; did you mean 'abs'? 28 | result.insert(ans.begin(),'('); | ^~~ | abs
s605788543
p03696
C++
#include <iostream> #include <vector> #include <string> #include <tuple> using namespace std; pair<int,int> count_bra(string str){ vector<int> d(str.length()+1); d[0] = 0; for(int j=0;j<str.length();j++){ if(str[j] == '(') d[j+1] = d[j] + 1; if(str[j] == ')') d[j+1] = d[j] - 1; } r...
a.cc: In function 'std::pair<int, int> count_bra(std::string)': a.cc:15:23: error: 'min_element' was not declared in this scope 15 | return make_pair(*min_element(d.begin()+1, d.end()), d[str.length()]); | ^~~~~~~~~~~
s232142852
p03696
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; string s; cin>>n>>s; int l=0,r=0,d=0; for(int i=0;i<s.size();++i){ if(s[i]=='(') ++l; else ++r; chmax(d,r-l); } string ans(d,'('); ans+=s; ans.append(l+d-r,')'); cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:12:17: error: 'chmax' was not declared in this scope 12 | chmax(d,r-l); | ^~~~~
s997006966
p03696
C++
#include <bits/stdc++.h> using namespace std; #define loop(i, a, b) for(int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define all(a) (a).begin(),(a).end() using namespace std; const int MOD = 1e9 + 7, INF = 1e9; using vi = vector <int>; using vvi = vector <vi>; int main(){ int n; string s; cin >> n >...
a.cc: In function 'int main()': a.cc:23:5: error: 'else' without a previous 'if' 23 | else{ | ^~~~
s433290559
p03696
C++
#include <bits/stdc++.h> using namespace std; #define loop(i, a, b) for(int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define all(a) (a).begin(),(a).end() using namespace std; const int MOD = 1e9 + 7, INF = 1e9; using vi = vector <int>; using vvi = vector <vi>; int main(){ int n; string s; cin >> n >...
a.cc: In function 'int main()': a.cc:23:5: error: 'else' without a previous 'if' 23 | else{ | ^~~~
s232042246
p03696
C++
#include<stdio.h> #include<malloc.h> int main() { int N; char* S; char* stack[101]; int stack_number = 0; int i, j; int left_count = 0; int right_count = 0; scanf("%d", &N); S = (char *)malloc(sizeof(char) * (N+1)); scanf("%s", S); for(i = 0; i < N; i++) { stack[...
a.cc: In function 'int main()': a.cc:20:34: error: invalid conversion from 'char' to 'char*' [-fpermissive] 20 | stack[stack_number] = S[i]; | ~~~^ | | | char a.cc:22:54: error: ISO C++ forbids c...
s977738091
p03696
C++
import java.util.*; import java.math.*; import java.io.*; class Main{ public static InputReader sc; public static PrintWriter out; public static final long MOD = (long)1e9 + 7L; public static void main(String[] args){ sc=new InputReader(System.in); out=new PrintWriter(System.out); int n=sc....
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:2:1: error: 'import' does not name a type 2 | import java.math.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1...
s828708211
p03696
C++
#include <vector> // vectorを使うためにインクルードする #include <iostream> #include the <algorithm> using namespace std; int main() { int N; cin >> N; vector<int> vec; string s; cin >> s; for(int i=0;i<N;i++){ if(i==0){ if(s[i]=='(')vec.push_back(1); else{vec.push_back(-1);} } else if(s[i]=='('){vec.push_back(ve...
a.cc:3:10: error: #include expects "FILENAME" or <FILENAME> 3 | #include the <algorithm> | ^~~ a.cc: In function 'int main()': a.cc:22:33: error: 'min_element' was not declared in this scope 22 | int mini = -1*(*min_element(vec.begin(),vec.end())); | ...
s880136400
p03696
C++
#include <vector> // vectorを使うためにインクルードする #include <iostream> using namespace std; int main() { int N; cin >> N; vector<int> vec; string s; cin >> s; for(int i=0;i<N;i++){ if(i==0){ if(s[i]=='(')vec.push_back(1); else{vec.push_back(-1);} } else if(s[i]=='('){vec.push_back(vec[i-1]+1);} else{vec.pu...
a.cc: In function 'int main()': a.cc:21:33: error: 'min_element' was not declared in this scope 21 | int mini = -1*(*min_element(vec.begin(),vec.end())); | ^~~~~~~~~~~
s654270030
p03696
C++
#include <vector> // vectorを使うためにインクルードする #include <iostream> using namespace std; int main() { int N; cin >> N; vector<int> vec; string s; cin >> s; for(int i=0;i<N;i++){ if(i==0){ if(s[i]=='(')vec.push_back(1); else{vec.push_back(-1);} } else if(s[i]=='('){vec.push_back(vec[i-1]+1);} else{vec.pu...
a.cc: In function 'int main()': a.cc:21:38: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 21 | int mini = -1*(*std::min_element(vec.begin(),vec.end())); | ^~~~~~~~~~~ | tuple_element
s905756374
p03696
C++
#include <vector> // vectorを使うためにインクルードする #include <iostream> using namespace std; int main() { int N; cin >> N; vector<int> vec; string s; cin >> s; for(int i=0;i<N;i++){ if(i==0){ if(s[i]=='(')vec.push_back(1); else{vec.push_back(-1);} } else if(s[i]=='('){vec.push_back(vec[i-1]+1);} else{vec.pu...
a.cc: In function 'int main()': a.cc:21:37: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 21 | int min = -1*(*std::min_element(vec.begin(),vec.end())); | ^~~~~~~~~~~ | tuple_element
s606378299
p03696
C++
#include <vector> // vectorを使うためにインクルードする #include <iostream> using namespace std; int main() { int N; cin >> N; vector<int> vec; string s; cin >> s; for(int i=0;i<N;i++){ if(i==0){ if(s[i]=='(')vec.push_back(1); else{vec.push_back(-1);} } else if(s[i]=='('){vec.push_back(vec[i-1]+1);} else{vec...
a.cc: In function 'int main()': a.cc:24:32: error: 'min_element' was not declared in this scope 24 | int min = -1*(*min_element(vec.begin(),vec.end())); | ^~~~~~~~~~~
s248906945
p03696
C++
#include "stdafx.h" #include<string.h> int main(void) { char str[100]; char str1[10] = ""; char str2[10] = ""; int i, a; int num = 0; int num2 = 0; int sum = 0; scanf("%d", &a); scanf("%s", str); for (i = 0; i<100; i++) { if (str[i] == '(') { num++; } } for (i = 0; i<100; i++) { if (str[i] == ')...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s029727403
p03696
Java
import java.util.*; import java.io.*; public class Main2{ static PrintWriter out; static Scanner in; public static void main(String args[]){ in = new Scanner(System.in); out = new PrintWriter(System.out); solve(); in.close(); out.close(); } public static void solve(){ int N ...
Main.java:4: error: class Main2 is public, should be declared in a file named Main2.java public class Main2{ ^ 1 error
s896078525
p03696
Java
import java.io.*; public class Main2 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); String s = br.readLine(); int left = 0; int right =0; for (int i = 0; i < num; i++) { if...
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s718368688
p03696
Java
import java.io.*; public class Main2 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); String s = br.readLine(); int left = 0; int right =0; for (int i = 0; i < num; i++) { if...
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s889278599
p03696
C++
#include<cstdio> #include<cstdlib> #include<cmath> #include<iostream> #include<string> #include<stack> #include<queue> #include<vector> #include<map> #include<set> #include<algorithm> #define rep(n) for(int i=0;i<n;i++) #define repp(j, n) for(int j=0;j<n;j++) #define reppp(i, m, n) for(int i=m;i<=n;i++) #define all(c)...
a.cc: In function 'int main()': a.cc:48:9: error: 'post' was not declared in this scope 48 | post += ')'; | ^~~~ a.cc:51:25: error: 'post' was not declared in this scope 51 | cout << pre << s << post; | ^~~~
s641545001
p03696
C++
n = int(input()) s = input() head = "" depth = 0 for i in s: if i == "(": depth += 1 else: if depth == 0: head += "(" else: depth -= 1 tail = "".join([")" for _ in range(depth)]) print(head + s + tail)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s159333360
p03696
C++
#include <iostream> #include <string> using namespace std; int main(){ int n,ln=0,rn=0; string ans, s,l,r; l="(", r=")"; cin>>n; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]=="("){ ln++; }else{ rn++; } } ans=s; if(ln<rn){ for(int i=0;i<ln-rn;i++){ ans=l+ans; }...
a.cc: In function 'int main()': a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(s[i]=="("){
s755156880
p03696
C++
#include <iostream> #include <string> using namespace std; int main(){ int n,ln=0,rn=0; string ans, s,l,r; l="(", r=")"; cin>>n; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]=="(")ln++; else rn++; } ans=s; if(ln<rn){ for(int i=0;i<ln-rn;i++){ ans=l+ans; } }else if(rn>ln){ ...
a.cc: In function 'int main()': a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(s[i]=="(")ln++;
s772778061
p03696
C++
#include <iostream> #include <string> using namespace std; int main(){ int n,ln=0,rn=0; string ans[201]; string s,l,r; l="(", r=")"; cin>>n; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]=="(")ln++; else rn++; } ans=s; if(ln<rn){ for(int i=0;i<ln-rn;i++){ans=l+ans;} }else if(rn>ln){ ...
a.cc: In function 'int main()': a.cc:13:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | if(s[i]=="(")ln++; a.cc:17:6: error: incompatible types in assignment of 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::string [201]' {aka 'std::__cxx11::basic_string<cha...
s932056198
p03696
C++
#include <iostream> #include <string> using namespace std; int main(){ int n,ln=0,rn=0; string ans[201]; string s,l,r; l[0]="(", r[0]=")"; cin>>n; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]=="(")ln++; else rn++; } ans=s; if(ln<rn){ for(int i=0;i<ln-rn;i++)ans=l+ans; }else if(rn>l...
a.cc: In function 'int main()': a.cc:8:8: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 8 | l[0]="(", r[0]=")"; | ^~~ | | | const char* a.cc:8:18: error: invalid conversion from...
s608758226
p03696
C++
#include<iostream> #include<algorithm> #include <string> #include<cstdio> #include<vector> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) using namespace std; typedef long long ll; int main() { REP(i, 3) { cout << z[i] << endl; } string moji; int n; cin >> n; vector<int>a(10000); REP(i, ...
a.cc: In function 'int main()': a.cc:13:29: error: 'z' was not declared in this scope 13 | REP(i, 3) { cout << z[i] << endl; } | ^
s601442944
p03696
C++
#include<iostream> using namespace std; int main(void){ int N,a=0,b=0,c; string S; cin>>N>>S; for(int i=0;i<N;i++){ if(S[i]=='('){ a++; } else if(S[i]==')'){ if(a>0) a=a-1; else b++; } } if(a==0) cout<<S<<endl; else if(a<0){ for(int i=0;i<a;i++){ cout<<'('; } cout<<S<<en...
a.cc: In function 'int main()': a.cc:31:32: error: expected ';' before ')' token 31 | for(int i=0;i<b){ | ^ | ;
s465317317
p03696
C++
//problem-C #include <algorithm> #include <cmath> #include <cstdlib> #include <cstdio> #include <iostream> #include <vector> #include<string> #include<queue> #include<map> using namespace std; int main() { int N; string S; cin >> N >> S; int putFirst = 0; int putLast = 0; int nowCount = 0; for (int i = 0; i ...
a.cc: In function 'int main()': a.cc:44:28: error: expected ';' before '}' token 44 | cout << ')' | ^ | ; 45 | } | ~
s624913923
p03696
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int n; char cs[105]; vector<int> parens; int inserts[100];// 場所 int insert; int depth; int main() { scanf("%d",&n); scanf("%s",cs); for(int i=0;i<n;i++){ if(cs[i]=='(')depth++; else depth--; if(depth<0){ insert++; depth++; ...
a.cc: In function 'int main()': a.cc:30:18: error: expected '}' at end of input 30 | return 0; | ^ a.cc:13:12: note: to match this '{' 13 | int main() { | ^
s593410704
p03696
C++
#include <iostream> #include <string.h> using namespace std; int main() { char s[100], f[100], l[100]; memset(s, '\0', 100); memset(f, '\0', 100); memset(l, '\0', 100); int cnt = 0, i = 0; int fi = 0, li = 0; cin >> cnt; for(; i != cnt; i++){ cin >> s[i]; } i = 0; int flag = 0; while (s[i] != '\0') { i...
a.cc: In function 'int main()': a.cc:41:9: error: 'strcat_s' was not declared in this scope; did you mean 'strcat'? 41 | strcat_s(f, s); | ^~~~~~~~ | strcat
s959212742
p03696
C++
#include <iostream> #include <string.h> using namespace std; int main() { char s[100], f[100], l[100]; memset(s, '\0', 100); memset(f, '\0', 100); memset(l, '\0', 100); int cnt = 0, i = 0; int fi = 0, li = 0; cin >> cnt; for(; i != cnt; i++){ cin >> s[i]; } i = 0; int flag = 0; while (s[i] != '\0') { i...
a.cc: In function 'int main()': a.cc:41:9: error: 'strcat_s' was not declared in this scope; did you mean 'strcat'? 41 | strcat_s(f, s); | ^~~~~~~~ | strcat
s667080334
p03696
C++
include<iostream> #include<cstdio> #include<cmath> #include<vector> using namespace std; int n,a,b,c; char s[310]; bool z = true; int main() { cin >> n; for(int i = 0;i < n;i++) { cin >> s[i]; if(z && s[i] == ')') { a++; continue; } if(!z && s[i] == '(') { b++; continue; } if(s[i] == '...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/cmath:45, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 16...
s457896649
p03696
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String s = sc.next(); int first = 0; int last = 0; if(s.charAt(0) == ')') first = 1; if(s.charAt(s.length() - 1) == '(') l = 1; int plus = 0; ...
Main.java:11: error: cannot find symbol if(s.charAt(s.length() - 1) == '(') l = 1; ^ symbol: variable l location: class Main Main.java:32: error: cannot find symbol if(l == 1) { ^ symbol: variable l location: class Main 2 errors
s708305011
p03696
C++
#define _USE_MATH_DEFINES #include<iostream> #include <math.h> #include <algorithm> #include <vector> #include <string> using namespace std; int main() { int n; char *ch; cin >> n; ch = new char[n]; for (int i = 0; i < n; i++){ cin >> ch[i]; } //対は消していって、その左右端は覚えておいた上で余りと対になる()を埋めていく char pre = '('; int...
a.cc: In function 'int main()': a.cc:64:13: error: redeclaration of 'int numl' 64 | int numl = 0; | ^~~~ a.cc:24:13: note: 'int numl' previously declared here 24 | int numl = 0; | ^~~~ a.cc:81:13: error: redeclaration of 'int addr' 81 | int addr = n -...
s042208163
p03696
C++
#include <algorithm> #include <iostream> #include <string> using namespace std; #define int long long int main() { int n; string s; cin >> n >> s; n = s.length(); int a[n]; for (int i = 0; i < n; i++) { a[i] = 0; if (s[i] == '(') { a[i] = 1; } else if (s[i] == ')') { a[i] = -1; ...
cc1plus: error: '::main' must return 'int'
s920508527
p03696
C
#include <stdio.h> int main() { int n, i, a, b, k; char s[100], a[200]; scanf("%d", &n); scanf("%s", s); a = b = 0; for (i = 0; i < n; i++){ if (s[i] == '(') a++; else b++; } if (a > b){ k = a - b; for (i = 0; i < n; i++){ a[i] = s[i] } for (i = 0; i < k; i++){ a[i + n] = ')'; } } ...
main.c: In function 'main': main.c:6:22: error: conflicting types for 'a'; have 'char[200]' 6 | char s[100], a[200]; | ^ main.c:5:19: note: previous declaration of 'a' with type 'int' 5 | int n, i, a, b, k; | ^ main.c:20:36: error: expected ';' ...
s135271756
p03696
C++
#include <bits/stdc++.h> using namespace std; static const int MAXN = 1e3 + 10; deque<char> ans; stack<char> s; char data[MAXN]; int n; int main() { scanf("%d" , &n); scanf(" %s" , data + 1); for(int i = 1 ; i <= n ; ++i) { char a = data[i]; if(a == '(') { if(data[i...
a.cc: In function 'int main()': a.cc:13:19: error: reference to 'data' is ambiguous 13 | scanf(" %s" , data + 1); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bit...
s692017082
p03696
Java
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String str = sc.next(); char[] S = new char[N]; for(int i=0;i<N;i++){ S[i] = str.charAt(i); } int[] depth = new int[N]; int deptA = 0; int deptB = 0; ...
Main.java:37: error: reached end of file while parsing } ^ 1 error
s575808293
p03696
C++
#include<cstdio> #include<cstring> #include<iostream> using namespace std; const int inf=1<<29; const int maxn=110; char str[maxn]; int n,dp[maxn][maxn]; pair<int,int> pre[maxn][maxn]; bool check(int i,int j) { if((str[i]=='('&&str[j]==')')||(str[i]=='['&&str[j]==']')) return true; return false; } void ...
a.cc: In function 'int main()': a.cc:46:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 46 | gets(str); | ^~~~ | getw
s375098244
p03696
C++
#include<string> #include<conio.h> using namespace std; int n; string s,moto; int main(){ cin>>n; cin>>s; for(int i=0;i<n;i++){ //moto[i]=s[i]; if(i!=0&&s[i-1]=='('&&s[i]==')') { s[i-1]='1'; s[i]='2'; } } for(int i=0;i<n;i++){ if(s[i]==')'){ s.insert(s.begin(),'('); } else if(s[i]=='('){ ...
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s320687763
p03696
C++
#include"bits/stdc++.h" #include<conio.h> using namespace std; int n; string st; int b,a; int main(){ cin>>n>>st; int right=0,left=0; for(int i=0;i<st.length();i++){ if(st[i]=='('){ left++; } else if(st[i]==')'){ right++; if(right>left)a++; } } right=0;left=0; for(int i=st.length()-1;i>=0;i--){ ...
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s508820716
p03696
C++
#include <iostream> #include <vector> #include <string> #include <queue> #include <iomanip> #include <stack> #include <bitset> #include <map> using namespace std; typedef long long ll; const ll INF = 1LL << 50; int solve(); void replace(string& target, string& from, string&to) { int pos(target.find(from)); while ...
a.cc: In function 'int solve()': a.cc:39:36: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'} 39 | replace(orig, std::string("()"), string("")); | ...
s397691274
p03696
C++
#include <bits/stdc++.h> using namespace std; int main( int argc, char *argv[] ) { int i; int N; char S[ 200 ]; char C; int iL; int iR; ios::sync_with_stdio( false ); cin.tie( 0 ); cin >> N; cin >> S; a = 0; b = 0; iL = 0; iR = 0; for( i = 0; i < N; i++ ) { C = S[ i ]; if( C == ')' ) { if( iL >...
a.cc: In function 'int main(int, char**)': a.cc:21:9: error: 'a' was not declared in this scope 21 | a = 0; | ^ a.cc:22:9: error: 'b' was not declared in this scope 22 | b = 0; | ^
s051606539
p03696
C++
#include <iostream> #include <cstdio> #include <map> #include <cstring> #define INF 210 #define NMAX 105 using namespace std; int dp[NMAX][NMAX]; int K[NMAX][NMAX]; map<char,char> M; int i,j,k,N; char C[NMAX]; void afisare(int i,int j) { if(i>j) return ; if(i==j) { if(C[i]=='('||C[i]==')') ...
a.cc: In function 'int main()': a.cc:42:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 42 | gets(C+1); | ^~~~ | getw
s831910612
p03697
C++
#include<bits/stdc++.h> #define Vsort(a) sort(a.begin(), a.end()) #define Vreverse(a) reverse(a.begin(), a.end()) #define Srep(n) for(int i = 0; i < (n); i++) #define Lrep(i,a,n) for(int i = (a); i < (n); i++) #define Brep(n) for(int bit = 0; bit < (1<<n); bit++) #define rep2nd(n,m) Srep(n) Lrep(j,0,m) #define vi vec...
a.cc: In function 'int main()': a.cc:19:23: error: operands to '?:' have different types 'int' and 'const char*' 19 | cout << (a + b < 10 ? a + b : "error") << endl; | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~
s940369163
p03697
C++
#include<bits/stdc++.h> #define Vsort(a) sort(a.begin(), a.end()) #define Vreverse(a) reverse(a.begin(), a.end()) #define Srep(n) for(int i = 0; i < (n); i++) #define Lrep(i,a,n) for(int i = (a); i < (n); i++) #define Brep(n) for(int bit = 0; bit < (1<<n); bit++) #define rep2nd(n,m) Srep(n) Lrep(j,0,m) #define vi vec...
a.cc: In function 'int main()': a.cc:17:10: error: found ':' in nested-name-specifier, expected '::' 17 | int a,b: | ^ | :: a.cc:17:9: error: 'b' has not been declared 17 | int a,b: | ^ a.cc:18:7: error: qualified-id in declaration before '>>' token 18 | cin >>...
s771695204
p03697
C++
#include<bits/stdc++.h> #include<atcoder/all> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using namespace atcoder; using ll = long long; using p = pair<int,int>; const long long INF = 1ll << 60; int main() { int A, B; cin >> A >> B; if (A+B >=10) cout << "error" << endl; else cou...
a.cc:2:9: fatal error: atcoder/all: No such file or directory 2 | #include<atcoder/all> | ^~~~~~~~~~~~~ compilation terminated.
s796513221
p03697
Java
import java.util.Scanner; public class A063 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner stdIn = new Scanner(System.in); int A = stdIn.nextInt(); int B = stdIn.nextInt(); if(A+B >= 10) { System.out.println("error"); } else { System.out.println(A+B); } } }
Main.java:3: error: class A063 is public, should be declared in a file named A063.java public class A063 { ^ 1 error
s954915265
p03697
C++
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include<iostream> #include<cstdint> #include<cstddef> using namespace std; using i32 = int_fast32_t; using i64 = int_fast64_t; using usize = uint_fast64_t; #define rep(i, n) for (usize i = 0; i < (usize)(n); i++) #define all(a) ...
a.cc: In function 'int main()': a.cc:22:1: error: 'elsecout' was not declared in this scope 22 | elsecout << a + b << endl; | ^~~~~~~~
s417987495
p03697
C++
#include<bits/stdc++.h> using namespace std; #define ll long long signed main() { int a,b; cin >> a >> b; cout << ((a+b>=10)?"error":a+b) << endl; }
a.cc: In function 'int main()': a.cc:9:21: error: operands to '?:' have different types 'const char*' and 'int' 9 | cout << ((a+b>=10)?"error":a+b) << endl; | ~~~~~~~~~^~~~~~~~~~~~
s475303901
p03697
C++
#include<bits/stdc++.h> using namespace std; #define ll long long signed main() { int a,b; cin >> a >> b; cout << ((a+b>=10)?"error":a+b << endl; }
a.cc: In function 'int main()': a.cc:9:34: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 9 | cout << ((a+b>=10)?"error":a+b << endl; | ~~~~^~~~~~~ a.cc:9:41: error: expected ')' before ';' token 9 | cout << ((a+b>...
s917380168
p03697
C++
#include <iostream> #include <algorithm> #include <cmath> #include <string> using namespace std; int main() { int a, b; cin >> a >> b; if (a + b >= 10) cout << "error" << "\n"; else cout << a + b << "\n" }
a.cc: In function 'int main()': a.cc:12:38: error: expected ';' before '}' token 12 | cout << a + b << "\n" | ^ | ; 13 | } | ~
s131516918
p03697
C++
#include<iostream> using namespace std; int main(){ int a,b; cin>>a>>b; cout<<((a+b<10)? a+b:"error"); return 0; }
a.cc: In function 'int main()': a.cc:7:18: error: operands to '?:' have different types 'int' and 'const char*' 7 | cout<<((a+b<10)? a+b:"error"); | ~~~~~~~~^~~~~~~~~~~~~
s181522002
p03697
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define vi vector<int> #define bn(n) (n).begin(), (n).end() #define FOR(n) for(int i = 0; i < (int)n; i++) void solve() { int a, b; cin >> a >> b; cout << (a + b > 10 ? "error" : a + b); } int main () { ios::syn...
a.cc: In function 'void solve()': a.cc:15:25: error: operands to '?:' have different types 'const char*' and 'int' 15 | cout << (a + b > 10 ? "error" : a + b); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~
s181984358
p03697
C
#include<stdio.h> int main() { int A,B,C; scanf("%d %d",&a,&b); if(1<=A && A<=9 && 1<=B && B<=9) { C=A+B; if(C<=9) printf("%d",C); else printf("error"); } return 0; }
main.c: In function 'main': main.c:6:20: error: 'a' undeclared (first use in this function) 6 | scanf("%d %d",&a,&b); | ^ main.c:6:20: note: each undeclared identifier is reported only once for each function it appears in main.c:6:23: error: 'b' undeclared (first use in this function) ...
s189227182
p03697
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >>a >>b; if (a + b < 10) cout << a + b; else cout "error"; }
a.cc: In function 'int main()': a.cc:11:9: error: expected ';' before string constant 11 | cout "error"; | ^~~~~~~~ | ;
s616750686
p03697
C++
#include <bits/stdc++.h> using namespace std; int main() { int a , b ; cin >> a >> b ; cout << (a+b < 10 ? a+b : "error") << endl; }
a.cc: In function 'int main()': a.cc:8:21: error: operands to '?:' have different types 'int' and 'const char*' 8 | cout << (a+b < 10 ? a+b : "error") << endl; | ~~~~~~~~~^~~~~~~~~~~~~~~
s622470876
p03697
C++
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, from, to) for (int i = from; i < (to); ++i) #define mp(x,y) make_pair(x,y) #define all(x) (x).begin(),(x).end() #define pb push_back using ll = long long; using vin=vector<int>; using vll=vector<ll>; using vst=vector<string>; using P = ...
a.cc: In function 'int main()': a.cc:26:26: error: operands to '?:' have different types 'int' and 'const char*' 26 | cout<<(a+b<10 ? a+b:"error")<<endl; | ~~~~~~~^~~~~~~~~~~~~
s939014059
p03697
C++
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, from, to) for (int i = from; i < (to); ++i) #define mp(x,y) make_pair(x,y) #define all(x) (x).begin(),(x).end() #define pb push_back using ll = long long; using vin=vector<int>; using vll=vector<ll>; using vst=vector<string>; using P = ...
a.cc: In function 'int main()': a.cc:26:26: error: operands to '?:' have different types 'int' and 'const char*' 26 | cout<<(a+b<10 ?a+b:"error")<<endl; | ~~~~~~~^~~~~~~~~~~~
s299736922
p03697
C++
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, from, to) for (int i = from; i < (to); ++i) #define mp(x,y) make_pair(x,y) #define all(x) (x).begin(),(x).end() #define pb push_back using ll = long long; using vin=vector<int>; using vll=vector<ll>; using vst=vector<string>; using P = ...
a.cc: In function 'int main()': a.cc:26:25: error: operands to '?:' have different types 'int' and 'const char*' 26 | cout<<(a+b<10?a+b:"error")<<endl; | ~~~~~~^~~~~~~~~~~~
s348278079
p03697
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP...
a.cc: In function 'int main()': a.cc:41:22: error: operands to '?:' have different types 'const char*' and 'int' 41 | cout << (a+b >= 10 ? "error" : a+b) << endl; | ~~~~~~~~~~^~~~~~~~~~~~~~~