submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s483375781
p03986
C++
#include<bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define int long long #define vec(a,n) vector<int> (a)((n)) #define Vec(a,n) vector<string> (a)((n)) using namespace std; signed main(){ string a; int s,ans=0; cin>>a; REP(i,n){ if(a...
a.cc: In function 'int main()': a.cc:19:15: error: 'n' was not declared in this scope 19 | REP(i,n){ | ^ a.cc:5:40: note: in definition of macro 'REP' 5 | #define REP(i, n) for (int i = 0; i < (n); ++i) | ^
s656909326
p03986
C++
#include<iostream> #include<ctype.h> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; inline int read(){ int x=0,f=0;char ch=getchar(); while(!isdigit(ch))f|=ch=='-',ch=getchar(); while(isdigit(ch))x=x*10+(ch^48),ch=getchar(); return f?-x:x; } string s; int er,ans; int main(){ cin>>s; i...
a.cc: In function 'int main()': a.cc:22:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 22 | cout<<strlen(s)-ans-ans<<"\n"; | ^ | | | std::string {aka std::__cxx11::basic_string<...
s210814375
p03986
C++
#include<cstdio> #include<stack> #include<iostream> #include<algorithm> using namespace std; #define MAXN 200000 stack <char> st; char str[MAXN + 5]; int main() { cin >> str; int len = strlen(str), Ans = 0; for (int i = 0; i < len; i++) if (str[i] == 'S') st.push('S'); else if (st.size() > 0) { Ans += 2; s...
a.cc: In function 'int main()': a.cc:11:19: error: 'strlen' was not declared in this scope 11 | int len = strlen(str), Ans = 0; | ^~~~~~ a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<algorithm> +++...
s645729270
p03986
C++
#include <cmath> #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <map> #include <list> #include <time.h> #include <math.h> #include <random> #include <deque> #include <queue> #include <cassert> #include <unordered_map> #include <unordered_set> #include <iomanip> #inc...
a.cc: In function 'int main()': a.cc:39:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 39 | if (c == "S") | ~~^~~~~~
s177851250
p03986
C++
//#include <bits/stdc++.h> //#include <stdio.h> #include<iostream> #include<cstdio> #include<bitset> #include<algorithm> #include<vector> #include<list> #include<queue> #include<stack> #include<string> #include<string.h> #include<cmath> #include<utility> #include<functional> #include<map> #include<set> #include<cctype>...
a.cc: In function 'int main()': a.cc:41:19: 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...
s313739407
p03986
C++
#include<stdio.h> #include<iostream> #include<string> #include<math.h> #include<cmath> #include<algorithm> #include<map> #include<queue> #include<stack> #include<vector> #include<time.h> #include<ctime> #include<functional> #define int long long #define INT INT_MAX #define LONG LLONG_MAX #define f(i,n) for(int i=0;i<(n...
a.cc: In function 'int main()': a.cc:44:29: error: expected ';' before '}' token 44 | xx=max(x,xx) | ^ | ; 45 | } | ~
s610890226
p03986
C++
#include<bits/stdc++.h> #define ll long long #define pb push_back using namespace std; const int mnx = 3e5 + 9; const int mod = 1e9 + 7; string x; ll cnt; int main(){ cin >> x; int ans = length(x), s = 0; for(int i=0; i<x.size(); i++) { if (x[i] == 'S') s++; else { if(s > 0) { ans -= 2; ...
a.cc: In function 'int main()': a.cc:15:11: error: 'length' was not declared in this scope 15 | int ans = length(x), s = 0; | ^~~~~~ a.cc:17:22: error: 's' was not declared in this scope 17 | if (x[i] == 'S') s++; | ^ a.cc:19:12: error: 's' was not declared in this s...
s227941468
p03986
C++
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; int a = (int)str.size(); int b = (int)str.size(); char ch[a+5]; for(int i = 0; i < (int)str.size(); ++i){ char ch[i] = str[i]; } for(int o; o<a+100; a++){ for(int i = 0;i < a; i++){ if(ch[i] == "S" && ch[...
a.cc: In function 'int main()': a.cc:12:25: error: array must be initialized with a brace-enclosed initializer 12 | char ch[i] = str[i]; | ^ a.cc:16:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | if(ch[i] == "S" && ch[i+1] == "T"){ ...
s361302381
p03986
C++
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; int a = (int)str.size(); int b = (int)str.size(); char ch[a+5] for(int i = 0; i < (int)str.size(); ++i){ char ch[i] = str[i]; } for(int o; o<a+100; a++){ for(int i = 0;i < a; i++){ if(ch[i] == "S" && ch[i...
a.cc: In function 'int main()': a.cc:11:3: error: expected initializer before 'for' 11 | for(int i = 0; i < (int)str.size(); ++i){ | ^~~ a.cc:11:18: error: 'i' was not declared in this scope 11 | for(int i = 0; i < (int)str.size(); ++i){ | ^ a.cc:16:8: error: 'ch' was not declar...
s697000668
p03986
C++
#include<bits/stdc++.h> #include<string> using namespace std; int main(){ string str; cin >> str; for(int i=0;i!=200000;i++){ int a=str.find("ST"); if(a==-1){ break; } if(str.enpty()){ break; } str.erase(str.begin()+a,str.begin()+a+1); } cout << str.size() << endl; }
a.cc: In function 'int main()': a.cc:14:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'enpty'; did you mean 'empty'? 14 | if(str.enpty()){ | ^~~~~ | empty
s344932033
p03986
C++
#include<bits/stdc++.h> #include<string> using namespace std; int main(){ string str; cin >> str; for(int i=0;i!=100000){ int a=str.find("ST"); if(a==-1){ break; } str.erase(str.begin()+a,str.begin()+a+1); } cout << str.size() << endl; }
a.cc: In function 'int main()': a.cc:9:24: error: expected ';' before ')' token 9 | for(int i=0;i!=100000){ | ^ | ;
s595118638
p03986
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int scnt=0,sum=0; for(int i=0;i<s.size();i++){ if(scnt>0&&s[i]=='T'){ scnt--; sum+=2; } if(s[i]=='S')scnt++; } cout<<s.size()-sum<<endl;j return 0; }
a.cc: In function 'int main()': a.cc:15:28: error: 'j' was not declared in this scope 15 | cout<<s.size()-sum<<endl;j | ^
s635034714
p03986
C++
#include <bits/stdc++.h> using namespace std; #define forx(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { string s; cin>>s; int x = 0,ans = 0; rep(i,n){ if(s[i]=='S') x++; else x--; ...
a.cc: In function 'int main()': a.cc:12:11: error: 'n' was not declared in this scope 12 | rep(i,n){ | ^ a.cc:4:40: note: in definition of macro 'rep' 4 | #define rep(i, n) for (int i = 0; i < (n); i++) | ^
s193130391
p03986
C++
#include <bits/stdc++.h> using namespace std; #define forx(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { string s; cin>>s; bool a=true; while(a){ rep(i,s.size()-1) if(s[i]=='S'&&s[i+1]=='T'){ ...
a.cc: In function 'int main()': a.cc:15:51: error: expected ';' before 'a' 15 | s.erase(s.begin()+i,s.begin()+i+2) | ^ | ; 16 | a=false; | ~ ...
s629146222
p03986
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; bool a=true; while(a){ rep(i,s.size()-1) if(s[i]=='S'&&s[i+1]=='T'){ s.erase(s.begin()+i,s.begin()+i+2) a=false; break; } } cout << s.size() <...
a.cc: In function 'int main()': a.cc:10:13: error: 'i' was not declared in this scope 10 | rep(i,s.size()-1) | ^ a.cc:10:9: error: 'rep' was not declared in this scope 10 | rep(i,s.size()-1) | ^~~
s216853620
p03986
C++
#include"stdafx.h" #include<iostream> #include<algorithm> #include<math.h> #include<cstdio> #include<ctype.h> #include<stdio.h> #include<set> #include<vector> #include<map> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<numeric> #include<string> using namespace std; ...
a.cc:1:9: fatal error: stdafx.h: No such file or directory 1 | #include"stdafx.h" | ^~~~~~~~~~ compilation terminated.
s881508448
p03986
C++
#include<iostream> #include<algorithm> #include<math.h> #include<cstdio> #include<ctype.h> #include<stdio.h> #include<set> #include<vector> #include<map> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<numeric> #include<string> typedef long long ll; ll dx[] = { 1,1,0,-...
a.cc: In function 'int main()': a.cc:38:9: error: 'string' was not declared in this scope 38 | string X; | ^~~~~~ a.cc:38:9: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c+...
s469805181
p03986
C++
#include<iostream> #include<algorithm> #include<math.h> #include<cstdio> #include<ctype.h> #include<stdio.h> #include<set> #include<vector> #include<map> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<numeric> #include<string> ll dx[] = { 1,1,0,-1,-1,-1,0,1 }; ll dy[]...
a.cc:17:1: error: 'll' does not name a type 17 | ll dx[] = { 1,1,0,-1,-1,-1,0,1 }; | ^~ a.cc:18:1: error: 'll' does not name a type 18 | ll dy[] = { 0,1,1,1,0,-1,-1,-1 }; | ^~ a.cc:19:1: error: 'll' does not name a type 19 | ll prime(ll x) { | ^~ a.cc:29:1: error: 'll' does not name a type ...
s838536491
p03986
C++
#include<iostream> #include<string> #include<algorithm> #include<cmath> #include<iomanip> #include<cstring> #include<map> #include<vector> #include<queue> #include<stack> #include<climits> #include<set> #include<utility> using namespace std; typedef long long int ll; typedef pair<int, int> P; const ll MOD=1e9+7; int m...
a.cc: In function 'int main()': a.cc:21:15: error: wrong number of template arguments (0, should be at least 1) 21 | stack<> s; | ^ In file included from /usr/include/c++/14/stack:63, from a.cc:10: /usr/include/c++/14/bits/stl_stack.h:99:11: note: provided for 'template<c...
s811177806
p03986
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; for(int i=0;i<s.size();i++){ if(s[i]=='S'&&s[i+1]=='T'){ s=s.substr(0,i)+s.substr(i+2,s.size()-i-2); i=-1; } } else cout<<s.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'else' without a previous 'if' 12 | else cout<<s.size()<<endl; | ^~~~
s251484164
p03986
C++
#include<iostream> using namespace std; int main(){ int s,t,i,length,count; string N; s = 0; t = 0; count = 0; cin >> N; length = N.size(); for(i=0;i<length;i++){ if(N[i] == 'S'){ s++; if(s-t=>0) count++; } else{ t++; if(s-t=>0) count++; } } co...
a.cc: In function 'int main()': a.cc:14:14: error: expected primary-expression before '>' token 14 | if(s-t=>0) | ^ a.cc:19:14: error: expected primary-expression before '>' token 19 | if(s-t=>0) | ^
s147864027
p03986
C++
#include<iostream> using namespace std; int main(){ int s,t,i,length,count; string N; s = 0; t = 0; count = 0; cin >> N; length = N.size(); for(i=0;i<length;i++){ if(N[i] == 'S'){ S++; if(S-T=>0) count++; } else{ T++; if(S-T=>0) count++; } } co...
a.cc: In function 'int main()': a.cc:13:7: error: 'S' was not declared in this scope 13 | S++; | ^ a.cc:14:12: error: 'T' was not declared in this scope 14 | if(S-T=>0) | ^ a.cc:14:14: error: expected primary-expression before '>' token 14 | if(S-T=>0) | ...
s452099031
p03986
C++
using System; using System.Linq; using System.Collections.Generic; using System.Text.RegularExpressions; namespace Solution { class Solution { static void Main(string[] args) { string s = System.Console.ReadLine(); for(int i = 0; i < 100000; i++) { ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Collections.Gene...
s894596681
p03986
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i) #define REP(i,n) FOR(i,0,n) int main() { string s; cin >> s; stack<char> S; REP(i,s.size()) { if (s[i] == 'S') S.push(s[i]); else { if (S.back() == 'S') S.pop(); else S.push(s[i]); ...
a.cc: In function 'int main()': a.cc:13:13: error: 'class std::stack<char>' has no member named 'back' 13 | if (S.back() == 'S') S.pop(); | ^~~~
s664550662
p03986
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; stack<char> S; REP(i,s.size()) { if (s[i] == 'S') S.push(s[i]); else { if (S.back() == 'S') S.pop(); else S.push(s[i]); } } cout << S.size() << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: 'i' was not declared in this scope 7 | REP(i,s.size()) { | ^ a.cc:7:3: error: 'REP' was not declared in this scope 7 | REP(i,s.size()) { | ^~~
s823409043
p03986
C++
#include <iostream> #include<algorithm> #include<stdio.h> #include<stdlib.h> #include <string.h> #include<cmath> using namespace std; int ss[1000008]= {0}; int main() { char s[1000008]= {0}; int i,j,x,n,r=0; scanf("%s",s); for(i=0,j=0; s[i]!=0; i++) { if(s[i]=='S') { ss[j...
a.cc: In function 'int main()': a.cc:26:15: error: expected ',' or ';' before 'for' 26 | for(i=ss[p]; ss[p]!=0; p++) | ^~~ a.cc:26:41: error: expected ';' before ')' token 26 | for(i=ss[p]; ss[p]!=0; p++) | ^ | ...
s975865685
p03986
Java
import java.util.*; public class AGC05a{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); sc.close(); Deque<Character> deq = new ArrayDeque<Character>(); int count = 0; for(int i = 0; i < str.length(); i++){ ...
Main.java:2: error: class AGC05a is public, should be declared in a file named AGC05a.java public class AGC05a{ ^ 1 error
s492421228
p03986
C++
def finalLength(sample): foo = len(sample) tmp = 0 for c in sample: if c=='S': tmp += 1 elif tmp>0: tmp -= 1 foo -= 2 return foo def main(): sample = raw_input().strip() print finalLength(sample) if __name__ == '__main__': main()
a.cc:16:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 16 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def finalLength(sample): | ^~~
s001674034
p03986
C++
#pragma GCC optimize("O3") #include<bits/stdc++.h> #define rc(x) return cout<<x<<endl,0 #define pb push_back #define in insert #define er erase #define fr first #define sc second using namespace std; typedef long long ll; const long long llnrm=LLONG_MAX; const int nrm=INT_MAX; const int nrn=INT_MIN; const int nmax=1e5+...
a.cc: In function 'int main()': a.cc:26:9: error: 'len' was not declared in this scope 26 | len=s.size(); | ^~~
s812983623
p03986
C
#define _CRT_SECURE_NO_WARNINGS 1 #include <iostream> #include <fstream> #include <string> #include <cmath> #include <cstdlib> #include <ctime> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <set> #include <queue> #include <deque> #include <functional> char x[200005]; int main(vo...
main.c:2:10: fatal error: iostream: No such file or directory 2 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s483964541
p03986
C++
#include <iostream> #include <algorithm> #include <string> #include <stack> using namespace std; int main() { string s; cin >> s; stack<char> st; for (auto x : s) { if (x == 'S') st.push(x); else if (st.top() == x) st.push(); st.pop(); } cout << st.size(); return 0; }...
a.cc: In function 'int main()': a.cc:15:40: error: no matching function for call to 'std::stack<char>::push()' 15 | else if (st.top() == x) st.push(); | ~~~~~~~^~ In file included from /usr/include/c++/14/stack:63, from a.cc:4: /usr/include/c++/14/bits/s...
s683814295
p03986
C++
#include<iostream> #include<string> using namespace std; int main(){ string str; cin>>str; for(int i=0;i<str.size()-1;i++){ if(str[i]=='S'&&str[i+1]=='T'){ flag=0; str=str.substr(0,i)+str.substr(i+2,str.size()-i-1); i--; } if(str.size()==0||str.size()==1){ flag=1; break; ...
a.cc: In function 'int main()': a.cc:9:7: error: 'flag' was not declared in this scope 9 | flag=0; | ^~~~ a.cc:14:7: error: 'flag' was not declared in this scope 14 | flag=1; | ^~~~
s303582813
p03986
C++
X = input() i = 0 while i < len(X): # print(i) while i + 1 < len(X) and X[i:i+2] != 'ST': i += 1 if i + 1 >= len(X): break X = X[:i] + X[i+2:] i -= 1 print(len(X))
a.cc:5:7: error: invalid preprocessing directive #print 5 | # print(i) | ^~~~~ a.cc:6:42: warning: multi-character character constant [-Wmultichar] 6 | while i + 1 < len(X) and X[i:i+2] != 'ST': | ^~~~ a.cc:1:1: error: 'X' does not name a type ...
s622365607
p03986
Java
package agc0.agc005; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class MainA { public static void main(String[] args) throws IOException { BufferedReader input =new BufferedReader (new InputStreamReader (System.in)); String str = input.readLine( ); whil...
Main.java:7: error: class MainA is public, should be declared in a file named MainA.java public class MainA { ^ 1 error
s968722221
p03986
C++
5 aabac 3 1 a 1 b 1 c
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^
s139585743
p03986
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string s; cin >> s; int minx = INT_MAX, x = 0; for (int i = 0; i < s.size(); i++){ if (s[i] == 'T')x--; else x++; minx = min(minx, x); } cout << minx << endl; }
a.cc: In function 'int main()': a.cc:7:20: error: 'INT_MAX' was not declared in this scope 7 | int minx = INT_MAX, x = 0; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include<algorithm> +++ |...
s012794313
p03986
C++
#include <stack> #include <cstdio> #include <vector> char x[1<<19]; int solve(void) { std::stack<char> st; int len = strlen(x); for(int i = 0; i < len; i++) { if(x[i] == 'S') st.push(x[i]); else if(x[i] == 'T' && (st.empty() || st.top() == 'T') st.push(x[i]); else st.pop(); } ...
a.cc: In function 'int solve()': a.cc:7:15: error: 'strlen' was not declared in this scope 7 | int len = strlen(x); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <vector> +++ |+#include <cstring>...
s917849437
p03986
C
#include <stack> #include <cstdio> #include <vector> char x[1<<19]; int solve(void) { std::stack<char> st; int len = strlen(x); for(int i = 0; i < len; i++) { if(x[i] == 'S') st.push(x[i]); else if(x[i] == 'T' && (st.empty() || st.top() == 'T') st.push(x[i]); else st.pop(); } ...
main.c:1:10: fatal error: stack: No such file or directory 1 | #include <stack> | ^~~~~~~ compilation terminated.
s828056811
p03986
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #define LL long long #define RG register using namespace std; #define N 800000 inline int gi() { RG int w=0; RG bool q=1; RG char c=getchar(); while ((c<'0'||c>'9') && c!='-') c=getchar(); if (c=='-') q=0,c=getchar(); while (c...
a.cc: In function 'int gi()': a.cc:11:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 11 | RG int w=0; | ^ a.cc:12:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 12 | RG bool q=1; | ...
s747305713
p03986
C++
1 #include<bits/stdc++.h> 2 3 4 #define sz(a) int((a).size()) 5 #define pb push_back 6 7 #define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++) 8 #define present(c,x) ((c).find(x) != (c).end()) 9 #define cpresent(c,x) (find(all(c),x) != (c).end()) 10 using namespace s...
a.cc:1:5: error: stray '#' in program 1 | 1 #include<bits/stdc++.h> | ^ a.cc:4:6: error: stray '#' in program 4 | 4 #define sz(a) int((a).size()) | ^ a.cc:5:6: error: stray '#' in program 5 | 5 #define pb push_back | ^ a.cc:7:6: error: stray '#' in program 7 | 7...
s744632805
p03986
C++
#include <iostream> #include <stack> #include <string> using namespace std; void PRF(string T, int f[]){ int m = T.length(); int k; f[0] = -1; for(int i = 1; i<m; i++){ k=f[i-1]; while(k>=0){ if(T[k] == T[i-1]){ break; } else{ k = ...
a.cc: In function 'void KMP(std::string, std::string)': a.cc:45:48: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop' 45 | String.pop(); | ^~~
s466946058
p03986
C++
#include <iostream> #include <stack> #include <string> using namespace std; void prefixKMP(string T, int f[]){ int m = T.length(); int k; f[0] = -1; for(int i = 1; i<m; i++){ k=f[i-1]; while(k>=0){ if(T[k] == T[i-1]){ break; } else{ ...
a.cc: In function 'void KMPcheck(std::string, std::string)': a.cc:29:9: error: conflicting declaration 'int z' 29 | int z = 0; | ^ a.cc:25:16: note: previous declaration as 'std::string z' 25 | string z; | ^ a.cc:46:43: error: 'std::string' {aka 'class std::__cxx11::...
s788008456
p03986
C++
s = gets.chomp countS = 0 count = s.length s.each_char do |e| countS += 1 if e == "S" if(e == "T" and countS > 0) count -= 2 countS -= 1 end end puts count
a.cc:1:1: error: 's' does not name a type 1 | s = gets.chomp | ^
s205907469
p03986
C++
#include <bits/stdc++.h> using namespace std; #define ll long long string x; int main(){ cin >> x; ll pos = 0; ll ans = 0; while(1){ if(x == "ST"){ cout << 0 << endl; return 0; } while(pos + 1 < x.length() && x.substr(pos,2) != "ST"){ pos++; } if(pos + 1 == x.length()){ ...
a.cc: In function 'int main()': a.cc:23:32: error: 'newstring' was not declared in this scope 23 | cout << "newstring: " << newstring << endl; | ^~~~~~~~~
s283851136
p03986
C++
#include <iostream>//cin/cout/wcin/wcout/left/right/internal/dec/hex/oct/fixed/scientific #include <string>//stoi/stol/stoul/stoll/stoull/stof/stod/stold/to_string/getline #include <vector> using namespace std; int main(void) { string x; cin >> x; ul n = x.size(); vector<bool> b; b.push_back(x[0] == 'S'); for ...
a.cc: In function 'int main()': a.cc:10:9: error: 'ul' was not declared in this scope 10 | ul n = x.size(); | ^~ a.cc:14:29: error: 'n' was not declared in this scope 14 | for (int i = 1; i < n; ++i) | ^
s722022984
p03986
C++
#include <iostream> #include <string> #include <stack> #include <stdin.h> using namespace std; int main(){ char* x; cin >> x; string st = "ST"; // スタックを準備する stack<char> stack; for (int i = 0; i < strlen(x); i++){ if (x[i] == 'T') { if(stack.top() == 'S'){ stack.pop(); } else { ...
a.cc:4:10: fatal error: stdin.h: No such file or directory 4 | #include <stdin.h> | ^~~~~~~~~ compilation terminated.
s418865388
p03986
C++
#include <iostream> #include <string> #include <stack> using namespace std; int main(){ char* x; cin >> x; string st = "ST"; // スタックを準備する stack<char> stack; for (int i = 0; i < strlen(x); i++){ if (x[i] == 'T') { if(stack.top() == 'S'){ stack.pop(); } else { stack.push(x[i...
a.cc: In function 'int main()': a.cc:14:23: error: 'strlen' was not declared in this scope 14 | for (int i = 0; i < strlen(x); i++){ | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <stack> +++...
s279772918
p03986
C++
// TEMPLATES ----------------------------------------------------------------------------------------------------------- #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #...
a.cc:41:17: error: 'INT_MAX' was not declared in this scope 41 | const int INF = INT_MAX / 3; | ^~~~~~~ a.cc:24:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 23 | #include <ctime> +++ |+#include <climits> 24 |
s498414192
p03986
C++
cin.tie(0); ios::sync_with_stdio(false); string str; cin >> str; // while (cin >> a) {} stack<char> s; for (auto c : str) { if (c == 'S') { s.push(c); } else { if (!s.empty() && s.top() == 'S') { s.pop(); } else { ...
a.cc:1:5: error: 'cin' does not name a type 1 | cin.tie(0); | ^~~ a.cc:2:5: error: 'ios' does not name a type 2 | ios::sync_with_stdio(false); | ^~~ a.cc:4:5: error: 'string' does not name a type 4 | string str; | ^~~~~~ a.cc:5:5: error: 'cin' does not name a type ...
s905937749
p03986
C++
#include<iostream> #include<algorithm> using namespace std; string x; int s,t,i; main() { cin>>x; for(i=0;i;x.size();i++){ if(x[i]=='T') t++; else s++; } cout<<max(s,t)*2<<endl; }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~ a.cc: In function 'int main()': a.cc:9:21: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const...
s222161222
p03986
C++
#include<bits/stdc++.h> using namespace std; char s[200005]; int n; int solve(int i, int j){ if (j == n)return 0; if (s[i] == 'S' && s[j] == 'T'){ if (i > 0){ return solve(i - 1, j + 1) + 2; } return solve(j + 1, j + 2) + 2; } return solve(i + 1, j + 1); } int main(){ gets(s); n = strlen(s); cout << (n...
a.cc: In function 'int main()': a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(s); | ^~~~ | getw
s184272232
p03986
C
r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2);
main.c:1:1: warning: data definition has no type or storage class 1 | r;main(c){for(;~(c=getchar());)r+=c>83?!!r:-1;printf("%d",~r*2); | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | r;main(c){for(;~...
s118027371
p03986
C++
#include <iostream> #include <string> #include <stack> using namespace std; int main() { string x; cin>>x; stack<char> s; for(e: x) { if (e=='T' and s.size() and s.top()=='S') s.pop(); else s.push(e); } cout<<s.size()<<endl; } #include <iostream> #include <s...
a.cc: In function 'int main()': a.cc:11:10: error: found ':' in nested-name-specifier, expected '::' 11 | for(e: x) { | ^ | :: a.cc:11:9: error: 'e' has not been declared 11 | for(e: x) { | ^ a.cc:18:1: error: expected primary-expression before '}' token 18 |...
s126566055
p03986
C++
// #include <iostream> #include <cstdio> #include <string> #include <cmath> #include <algorithm> #include <vector> #include <map> #include <set> #include <array> #include <numeric> #include <functional> #include<list> #include<queue> #include<deque> #include<algorithm> #include<utility> #include<complex> using namespa...
a.cc:29:16: error: 'INT_MAX' was not declared in this scope 29 | const ll inf = INT_MAX; | ^~~~~~~ a.cc:19:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 18 | #include<complex> +++ |+#include <climits> 19 |
s059813935
p03986
Java
import java.util.Scanner; public class Mondai1 { public static void main(String[] args) { Scanner scan = null; try { scan = new Scanner(System.in); System.out.println(replace(scan.nextLine()).length()); } finally { if (scan != null) { sca...
Main.java:3: error: class Mondai1 is public, should be declared in a file named Mondai1.java public class Mondai1 { ^ 1 error
s464816235
p03986
C++
#include <iostream> #include<string> using namespace std; string str; int main() { cin>>str; for(int n=0;n<str.size();n++){if(str=="ST")str.clear(); if(*(str.begin()+n)=='S'&&*(str.begin()+n+1)=='T'){ str.erase(str.begin()+n); str.erase(str.begin()+n); n--;} ...
a.cc: In function 'int main()': a.cc:14:15: error: expected '}' at end of input 14 | return 0;} | ^ a.cc:6:16: note: to match this '{' 6 | int main() { | ^
s488436720
p03986
C++
str = STDIN.gets.chomp result = str count = 0 while str.size > count result = result.sub("ST" , "") count += 1 end STDOUT.puts result.size
a.cc:1:1: error: 'str' does not name a type 1 | str = STDIN.gets.chomp | ^~~
s897195641
p03986
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ string s; cin>>s; stack<string> st; for(int i=0;i<s.size();i++){ if(s[i]=='S') st.push(s[i]); else{ if(st.top()=='S') st.pop(); else st.push(s[i]); } } //cout<<st.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:26: error: no matching function for call to 'std::stack<std::__cxx11::basic_string<char> >::push(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 11 | if(s[i]=='S') st.push(s[i]); | ~~~~~~~^~~~~~ In file included from /usr/includ...
s680045100
p03986
Java
public class Solution { public static void main(String[] args) { try (java.util.Scanner sc = new java.util.Scanner(System.in)) { StringBuilder sb = new StringBuilder(); char[] a = sc.next().toCharArray(); int i = 0; java.util.Deque<Character> stack = new java.util.ArrayDeque<>(); whi...
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ 1 error
s859436459
p03986
C++
#include <iostream> #include <stdio.h> using namespace std; int main() { char x[200000]; int depth=0; int ans=0; cin >> x; for(int i=0;x[i]!='\0' && i < ;++i){ if(x[i]=='S'){ ++depth; ++ans; }else if(x[i]=='T' && depth>0){ --depth; --a...
a.cc: In function 'int main()': a.cc:11:35: error: expected primary-expression before ';' token 11 | for(int i=0;x[i]!='\0' && i < ;++i){ | ^
s118326383
p03986
C++
fack you
a.cc:1:1: error: 'fack' does not name a type 1 | fack you | ^~~~
s474681285
p03986
C++
#include <iostream> #include <cstring> using namespace std; S char s[200010]; int l, T; int main() { scanf("%s", s); while (s[++l]); int i = 0; while (1) { if (s[i++] == 'S') { T--; l-=2; } else T++; if(T==l/2) break; } p...
a.cc:5:1: error: 'S' does not name a type 5 | S | ^ a.cc: In function 'int main()': a.cc:10:17: error: 's' was not declared in this scope 10 | scanf("%s", s); | ^
s354344154
p03986
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; int a=s.length(); long i,ans=0; for(i=a-1;i>=0;i--) { if(s[i]=='S') {ans++;continue;} break; } printf("%ld\n",n-ans); return 0; }
a.cc: In function 'int main()': a.cc:17:24: error: 'n' was not declared in this scope 17 | printf("%ld\n",n-ans); | ^
s272690120
p03986
Java
public class Solution { public static void main(String[] args) { try (java.util.Scanner sc = new java.util.Scanner(System.in)) { StringBuilder sb = new StringBuilder(); char[] s = sc.next().toCharArray(); int len = s.length; for (int i = 1, j = 0; i < s.length; i++) { if (s[j] == '...
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ 1 error
s821625614
p03986
Java
public class Atcoder_20161001_A { public static void Main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); sc.close(); int s_cnt = s.length(); StringBuilder sb = new StringBuilder(); for (int l = s_cnt / 2; l >= 1; l--) { sb = ...
Main.java:1: error: class Atcoder_20161001_A is public, should be declared in a file named Atcoder_20161001_A.java public class Atcoder_20161001_A { ^ Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Atcoder_20161001_A Main....
s398967640
p03986
Java
public class Main{ public static void main(String[] args) { final String check_str = "ST"; Scanner sc = new Scanner(System.in); String s = sc.next(); sc.close(); int s_cnt = s.length(); StringBuilder sb = new StringBuilder(); for (int l = s_cnt / 2; l >= 1; ...
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
s841047005
p03986
C++
#include <cstdio> #include <iostream> #include <algorithm> #include <string> #include <map> #include <regex> using namespace std; typedef long long ll; string s; string search = "ST"; std::regex reg(R"(\{ST\}+)"); int main() { ios::sync_with_stdio(false); cin >> s; s = regex_replace(s, r, ""); ...
a.cc: In function 'int main()': a.cc:23:26: error: 'r' was not declared in this scope 23 | s = regex_replace(s, r, ""); | ^
s200490738
p03986
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; string X; cin>>X; while(1){ if(n==X.length())break; for(int i=0;i<X.length();i++){ if(X[i]=='S'&&X[i+1]=='T'){ X.erase(X.begin()+i,X.begin()+i+2); X[i]=X[i+1]=x; } } n=X.length(); } cout<<X.length()<<endl; ...
a.cc: In function 'int main()': a.cc:14:21: error: 'x' was not declared in this scope 14 | X[i]=X[i+1]=x; | ^
s005591482
p03986
C++
#include <iostream> using namespace std; int main(void){ int i=0,j,k,tlen,slen=0,stlen=0; string s; cin >> s; for(;(s[i]=='T')&&(i<s.length());i++){} while(i<s.length()){ j=i; for(;(s[i]=='S')&&(i<s.length());i++){} slen+=i-j; k=i; for(;(s[i]=='T')&&(i<s.length());i++){} tlen=i-k; if(slen>tlen){ s...
a.cc: In function 'int main()': a.cc:20:10: error: expected ';' before '}' token 20 | slen=0 | ^ | ; 21 | } | ~
s947564407
p03986
Java
import java.util.Scanner; public class Atcoder_20161001_A { public static void main(String[] args) { final String check_str = "ST"; Scanner sc = new Scanner(System.in); String s = sc.next(); sc.close(); while(true){ s = s.replaceFirst(check_str, ""); ...
Main.java:3: error: class Atcoder_20161001_A is public, should be declared in a file named Atcoder_20161001_A.java public class Atcoder_20161001_A { ^ 1 error
s510647316
p03986
C++
#include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> #include <utility> #include <unordered_set> #include <unordered_map> #include <stack> #include <queue> #include <...
a.cc: In function 'int main()': a.cc:68:13: error: 'N' was not declared in this scope 68 | rrep(i, N) { | ^ a.cc:45:30: note: in definition of macro 'rrep' 45 | #define rrep(i,x) for(int i=(x)-1;i>=0;--i) | ^
s561013603
p03986
Java
import java.util.Scanner; public class A { static Scanner sc; public static void main(String[] args) { String x; sc = new Scanner(System.in); x = sc.next(); long n = x.length(); char[] X = x.toCharArray(); long len= n; for(long i=0; i<n-1; i++){ if(X[(int) i]=='S' && X[(int) (i+1)]=='...
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s658494481
p03986
C++
#include<iostream> using namespace std; int main() { string s; cin >> s; string::sizetype index i; bool b = 1; unsigned int u = 0; while(b){ i = s.find("ST"); if(index == string::npos){ b = 0; } else { s.erase(i); s.erase(i); u = u + 1; } } cout << s.length(); return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: 'sizetype' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 7 | string::sizetype index i; | ^~~~~~~~ a.cc:11:17: error: 'i' was not declared in this scope 11 | i = s.find("ST"); | ...
s307365801
p03986
C++
#include <stdio.h> #include <algorithm> using namespace std; int N, a[212345], tmp = 0; __int64 ans; int main(void) { scanf("%d", &N); for (int i = 0; i < N; ++i) { scanf("%d", &a[i]); } for (int l = 0; l < N; ++l) { for (int r = l; r < N; ++r) { for (int i = l; i <= r; ++i) { if (i == l) { tmp = a[i]; ...
a.cc:7:1: error: '__int64' does not name a type; did you mean '__int64_t'? 7 | __int64 ans; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:19:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 19 | ans += tmp; | ^~~ ...
s518560918
p03986
C++
#include<cstdio> using namespace std; char str[200001] = {}; void sort(int n){ int j,k; for(j = n;str[j] != '\0';j++){ str[j] = str[j +2]; } } int main(){ int i; gets(str); for(i = 0;i <= 200000 ;i++){ if(str[i] == 'S'){ if(str[i + 1] == 'T'){ str[i] == '\0'; str[i + 1] == '\0'; sort(i); ...
a.cc: In function 'int main()': a.cc:15:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 15 | gets(str); | ^~~~ | getw
s908085221
p03986
Java
import java.io.*; import java.util.Scanner; public class STring { public static void main(String[] args){ Scanner reader = new Scanner(System.in); // Reading from System.in int i; String input = reader.next(); // Scans the next token of the input as an int. String current = ""; for(i=0...
Main.java:4: error: class STring is public, should be declared in a file named STring.java public class STring { ^ 1 error
s885153416
p03986
Java
import java.util.Scanner; public class ProblemA { public static void Main(String[] args) { StringBuilder sb; Scanner sc = new Scanner(System.in); sb = new StringBuilder(sc.nextLine()); sc.close(); String pattern = "ST"; int patternIndex; do{ pattern...
Main.java:3: error: class ProblemA is public, should be declared in a file named ProblemA.java public class ProblemA { ^ 1 error
s142526430
p03986
Java
import java.util.Scanner; public class ProblemA { public static void main(String[] args) { StringBuilder sb; Scanner sc = new Scanner(System.in); sb = new StringBuilder(sc.nextLine()); sc.close(); String pattern = "ST"; int patternIndex; do{ pattern...
Main.java:3: error: class ProblemA is public, should be declared in a file named ProblemA.java public class ProblemA { ^ 1 error
s563922590
p03986
C++
#include <iostream> #include <cstring> #include <algorithm> #define REP(i,n) for(int i=0;i<(n);++i) #define FOR(i,a,b) for(typeof(a) i=a;i!=(b);++i) #define CLEAR(a,v) memset(a,v,sizeof(a)) #define SORT(a) sort(a,a+sizeof(a)/sizeof(a[0])) using namespace std; int main(){ string S; cin >> S; int s = 0, t = ...
a.cc: In function 'int main()': a.cc:26:25: error: 'r' was not declared in this scope 26 | cout << s+t << endl;r | ^
s860241236
p03986
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static String ST = "ST"; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder line = new StringBu...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ 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.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fm...
s617785178
p03986
C++
package AtCoder; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static String ST = "ST"; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder l...
a.cc:1:1: error: 'package' does not name a type 1 | package AtCoder; | ^~~~~~~ a.cc:3:1: error: 'import' does not name a type 3 | import java.io.BufferedReader; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import ja...
s982781306
p03986
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import javax.script.ScriptException; public class Main { public static String ST = "ST"; public static void main(String[] args) throws IOException, ScriptException { BufferedReader br = new BufferedReader(new InputStream...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ 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.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fm...
s460044624
p03986
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> void main() { int len; int i; int ans; char *a = (char *)malloc(200004); scanf("%s", a); len = strlen(a); ans = len; for (i = 0; i < len;) { if (a[i] == 'S' && a[i + 1] == 'T') { memmove(&a[i], &a[i + 2], len - i); --i; } else { +...
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~
s834554416
p03986
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.regex.Matcher; import java.util.regex.Pattern; public class AtCoder { public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws Exception { String in = br.r...
Main.java:6: error: class AtCoder is public, should be declared in a file named AtCoder.java public class AtCoder { ^ 1 error
s516540674
p03986
C++
#include <bits/stdc++.h> using namespace std; const int N = 1234567; char s[N], st[N]; int main() { gets(s); int n = strlen(s); int e = 0; for (int i = 0; i < n; i++) { if (e > 0 && st[e - 1] == 'S' && s[i] == 'T') { e--; } else { st[e++] = s[i]; } } printf("%d\n", e); return 0...
a.cc: In function 'int main()': a.cc:10:3: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(s); | ^~~~ | getw
s873933941
p03986
Java
import java.util.*; public class main{ public static void main(String[] args){ Scanner scan=new Scanner(System.in); String str=scan.next(); String strb; for(int i=0;i<200000;i++){ strb=str; str=str.replaceFirst("ST",""); if(str.equals(strb)) break; } System.out.print(str.length()); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main{ ^ 1 error
s645491174
p03986
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.regex.Matcher; import java.util.regex.Pattern; public class AtCoder { public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws Exception { String in = br.r...
Main.java:6: error: class AtCoder is public, should be declared in a file named AtCoder.java public class AtCoder { ^ 1 error
s862208810
p03986
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <set> #include <map> #include <numeric> #include <unordered_map> #include <unordered_set> #include <comple...
a.cc: In member function 'void segtree<T, Func>::updateall(int, int)': a.cc:174:9: error: expected ';' before '}' token 174 | } | ^
s369904732
p03986
C++
#include <iostream> #include <string> using namespace std; main(){ string x; int a; int start=0; int end=0; a=x.length(); for(int i=0;i<a;i++){ if(x[i]=='T'){ start++; }else{ break; } } for(int i=(a-1);i>=0;i--){ if(x[i]=='S'){ end++; }else{ break } } cout << a-start-end <<endl; }
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:24:30: error: expected ';' before '}' token 24 | break | ^ | ; 25 | ...
s903597034
p03986
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vb = vector<bool>; using vvb = vector<vb>; using vl = vector<ll>; using vvl = vector<vl>; using vd = vector<double>; using vvd = vector<vd>; #define REP(i,n) for(ll...
a.cc: In function 'int main()': a.cc:31:20: error: no matching function for call to 'max(ll&, long long unsigned int)' 31 | ll ma = max(l, s.size() - r - 1); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linu...
s338925595
p03987
Java
import utils.SegmentTree; import java.io.*; import java.util.*; import java.util.Map.Entry; import java.util.function.Function; /** * Created by Katushka on 11.03.2020. */ public class Main { public static final Comparator<int[]> COMPARATOR = Comparator.comparingInt(o -> o[0]); static Integer[] readArray...
Main.java:1: error: package utils does not exist import utils.SegmentTree; ^ 1 error
s864956477
p03987
C++
#include <bits/stdc++.h> #include "../lib/segmenttree/segtree_update_min.hpp" #include "../lib/segmenttree/segtree_update_max.hpp" using namespace std; #define SZ(x) (int)(x.size()) #define REP(i, n) for(int i=0;i<(n);++i) #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define RREP(i, n) for(int i=(int)(n);i>=0;--i) #...
a.cc:2:10: fatal error: ../lib/segmenttree/segtree_update_min.hpp: No such file or directory 2 | #include "../lib/segmenttree/segtree_update_min.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s771795902
p03987
C++
#include<algorithm> #include<iostream> #include<string.h> #include<utility> #include<stdio.h> #include<vector> #include<string> #include<math.h> #include<cmath> #include<queue> #include<stack> #include<deque> #include<map> #pragma warning(disable:4244) #define PI 3.1415926536 #pragma GCC optimize(2) using namespace std...
a.cc: In function 'll RMQ(ll, ll)': a.cc:52:16: error: 'save' was not declared in this scope 52 | return save[dp[s][k]] < save[dp[v - ((ll)1 << k) + 1][k]] ? dp[s][k] : dp[v - ((ll)1 << k) + 1][k]; | ^~~~
s948791370
p03987
C++
#include <iostream> #include <cstring> #include <set> #include <vector> #include <algorithm> #define MOD 1000000007 using namespace std; int n, arr[200010], cvp; vector<pair<int, int> > index; set<int> step; int main(void){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n; for(int i=1;i<=n;i++){...
a.cc:10:25: error: 'std::vector<std::pair<int, int> > index' redeclared as different kind of entity 10 | vector<pair<int, int> > index; | ^~~~~ In file included from /usr/include/string.h:462, from /usr/include/c++/14/cstring:43, from a.cc:2: /usr/inclu...
s186358275
p03987
C++
include<iostream> #include<cstdio> #define int long long using namespace std; int n,top,minn; const int N=1000010; int a[N],zhan[N],r[N],l[N]; long long ans; signed main() { cin>>n; for(int i=1;i<=n;++i)scanf("%lld",&a[i]); for(int i=1;i<=n;++i)r[i]=n+1,l[i]=0; for(int i=1;i<=n;++i) { while(...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:11:5: error: 'cin' was not declared in this scope 11 | cin>>n; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include ...
s815916631
p03987
C++
#include <iostream> #include <string> #include <map> #include <queue> #include <algorithm> #include <vector> #include <math.h> #include <bitset> #include <cmath> #include <set> #include <queue> typedef long long ll; #define rep(i,s,n)for(ll i = s;i<n;i++) #define repe(i,s,n)for(ll i = s;i<=n;i++) #define rep_r(i,s,n)f...
a.cc:20:23: warning: overflow in conversion from 'double' to 'll' {aka 'long long int'} changes value from '1.0000000000000001e+25' to '9223372036854775807' [-Woverflow] 20 | static const ll INF = 1e25; | ^~~~ a.cc: In function 'int main()': a.cc:47:42: error: expected '}' at end of input...
s082442612
p03987
C++
#include <iostream> #include <set> using namespace std; using ll = long long; int main(){ int N; cin >> N; ll place[N + 1] for (int i = 0; i <= N; ++i) { ll a; cin >> a; place[a] = i; } ll ans = 0; set<ll> used = {0, N + 1}; for (int i = 0; i <=N; ++i) { ll r, l; auto itr = used.lower_bound(pl...
a.cc: In function 'int main()': a.cc:12:9: error: expected initializer before 'for' 12 | for (int i = 0; i <= N; ++i) | ^~~ a.cc:12:25: error: 'i' was not declared in this scope 12 | for (int i = 0; i <= N; ++i) | ^ a.cc:26:45: error: 'place' was not dec...
s744304111
p03987
C++
#include <algorithm> #include <bitset> #include <complex> #include <deque> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <random> #include <tuple>...
a.cc: In function 'int main()': a.cc:116:29: error: no matching function for call to 'lower_bound(ll&)' 116 | auto right = lower_bound(pos); | ~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:1530:...
s549225317
p03987
C++
#include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using na...
a.cc: In function 'void solve(long long int, std::vector<long long int>)': a.cc:330:24: error: 'i' was not declared in this scope 330 | checked.insert(pos[i]); | ^
s840284881
p03987
C++
明天AGC005写完,CF1188写完
a.cc:1:1: error: '\U0000660e\U00005929AGC005\U00005199\U00005b8c\U0000ff0cCF1188\U00005199\U00005b8c' does not name a type 1 | 明天AGC005写完,CF1188写完 | ^~~~~~~~~~~~~~~~~~~~~~~~~~