submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s861137415 | p03979 | C++ | #include "bits/stdc++.h"
using namespace std;
//諸機能
#pragma region MACRO
#define putans(x) std::cerr << "answer: " ; cout << (x) << endl
#define dputans(x) std::cerr << "answer: "; cout << setprecision(13) << (double)(x) << endl
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define RREP(i,a,n) for(int i=(int)(n... | a.cc:32:9: warning: "dbg2" redefined
32 | #define dbg2 {}
| ^~~~
a.cc:27:9: note: this is the location of the previous definition
27 | #define dbg2(var0, var1) { std::cerr << ( #var0 ) << "=" << ( var0 ) << ", "; dbg(var1); }
| ^~~~
a.cc:33:9: warning: "dbg3" redefined
33 | #define ... |
s706869304 | p03979 | C++ | // In the name of God
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
usin... | a.cc: In function 'void add_edge(int, int, int)':
a.cc:31:33: error: reference to 'prev' is ambiguous
31 | to[cnt] = v, cap[cnt] = uv, prev[cnt] = head[u], head[u] = cnt++;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/... |
s930848762 | p03980 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <cctype>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair... | a.cc: In function 'P term(State&, int, int)':
a.cc:36:21: error: 'a' was not declared in this scope
36 | if((a>(*begin-'0')*10+9)){
| ^
a.cc: In function 'P expression(State&, int, int)':
a.cc:60:20: error: 'a' was not declared in this scope
60 | P tmp=term(a,b);
... |
s713014454 | p03980 | Java |
import java.io.*;
import java.math.*;
import java.util.*;
import static java.util.Arrays.*;
public class F_X {
private static final int mod = (int)1e9+7;
final Random random = new Random(0);
final IOFast io = new IOFast();
/// MAIN CODE
public void run() throws IOException {
int TEST_CASE = Integer.parseInt... | Main.java:8: error: class F_X is public, should be declared in a file named F_X.java
public class F_X {
^
1 error
|
s623625458 | p03980 | C++ | // In the name of God
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
usin... | a.cc: In function 'int32_t main()':
a.cc:76:25: error: expected ';' before 't'
76 | update()
| ^
| ;
77 | t--;
| ~
a.cc:84:25: error: expected ';' before 'f'
84 | update()
... |
s211731768 | p03980 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
a
#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x) cerr << #x << " = " <... | a.cc:3:1: error: 'a' does not name a type
3 | a
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:4:
/usr/include/c++/14/ext/type_... |
s648331816 | p03980 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In function 'void solve()':
a.cc:67:22: error: 'R' was not declared in this scope
67 | ZERO(R);
| ^
a.cc:11:24: note: in definition of macro 'ZERO'
11 | #define ZERO(a) memset(a,0,sizeof(a))
| ^
a.cc:71:17: error: 'parse' was not declar... |
s441179327 | p03980 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
char s[1111];
int top;
char oper[1111];int op1[1111],op2[1111],res[1111];
int _top;
int _op1[1111], _op2[1111], _res[1111];
void calc(){
if(res[top] == -1)return;
while(top > 0){
--top;
if(op1[top] == -1){
op1[top] = res[top+1];
top++;
oper[top]... | a.cc: In function 'int calc_min()':
a.cc:35:9: error: 'memcpy' was not declared in this scope
35 | memcpy(_op1, op1, sizeof(int)*(_top+1));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+... |
s691826215 | p03981 | C++ | #ifdef Kelly
#include<DEBUG.h>
#else
#define DEBUG(...)
#endif
/*-------------------------------< Kelly >-------------------------------*/
#include<stdio.h>
#include<string.h>
#include<unordered_map>
#include<string>
using namespace std;
typedef long long int LL;
unordered_map<pair<LL, LL>, int> has;
char ar[1000... | a.cc:15:34: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<long long int, long long int>; _Tp = int; _Hash = std::hash<std::pair<long long int, long long int> >; _Pred = std::equal_to<std::pair<long long int, long long int> >; _Alloc = std::al... |
s473466711 | p03981 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int ... | a.cc: In function 'bool compare_sa(int, int)':
a.cc:26:12: error: reference to 'rank' is ambiguous
26 | if(rank[i]!=rank[j])return rank[i]<rank[j];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
... |
s572949760 | p03981 | C++ | // In the name of God
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
usin... | a.cc: In function 'void make_suffix_array()':
a.cc:47:9: error: reference to 'rank' is ambiguous
47 | rank[i][0] = t[i];
| ^~~~
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/... |
s289903303 | p03981 | C++ | #include <algorithm>
#include <climits>
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)n;++i)
// Larsson-Sadakane's Suffix array Construction: O(n (log n)^2)
struct SAComp {
const int h, *g;
SAComp(int h, ... | a.cc: In function 'int main()':
a.cc:97:17: error: 'strlen' was not declared in this scope
97 | int N = strlen(S);
| ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <cstdio>
+++ |+#include <cstr... |
s117622872 | p03981 | C++ | #include <algorithm>
#include <climits>
#include <vector>
#include <iostream>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)n;++i)
// Larsson-Sadakane's Suffix array Construction: O(n (log n)^2)
struct SAComp {
const int h, *g;
SAComp(int h, int* g) : h(h), g(g) {}
bool operat... | a.cc: In function 'int main()':
a.cc:95:17: error: 'strlen' was not declared in this scope
95 | int N = strlen(S);
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <iostream>
+++ |+#include <cs... |
s085232496 | p03981 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not a)
#define dump(x) cerr << #x << " = " << (... | a.cc:32:1: error: 'a' does not name a type
32 | a
| ^
a.cc: In function 'int dfs(int)':
a.cc:67:29: error: 'ok' was not declared in this scope
67 | if (ok(tmp)) {
| ^~
a.cc: In function 'int main()':
a.cc:81:14: error: 'ok' was not declared in this s... |
s386282771 | p03981 | C++ | #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <set>
#include <map>
#define SIZE 100005
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
typedef pair <P,int> PP;
ch... | a.cc: In function 'int main()':
a.cc:30:30: error: reference to 'rank' is ambiguous
30 | for(int i=0;i<n;i++) rank[i]=str[i]-'a';
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
... |
s859917206 | p03982 | C++ | 京都大学决定在大学西侧修建一堵直墙,以保护大学不受每晚从西方袭击的大猩猩的影响。另外,由于攻击严重的位置不能仅通过墙壁来防止,因此使用增援来处理。虽然增援的数量有限,但最先进的技术可以计算下一次攻击大猩猩的数量和位置,因此我们每天都会相应地移动增援部队。您被称为信息部门的精英,以提高效率。
沿着直墙以相等的间隔使用加强件 ñ 从左到右有 N个地方 1 1, 2 2,..., ñ 它有一个N数。为最后一次攻击做准备,现在每个位置 我 我( 1 \ \ leq \ i \ \ leq \ N. 1 ≤ 我≤ Ñ 中)是 A_I 一
我
使用单独的增援。移动其中一些增援部队,每个部位 我 我( 1 \ \ leq \ i \ ... | a.cc:1:1: error: extended character 。 is not valid in an identifier
1 | 京都大学决定在大学西侧修建一堵直墙,以保护大学不受每晚从西方袭击的大猩猩的影响。另外,由于攻击严重的位置不能仅通过墙壁来防止,因此使用增援来处理。虽然增援的数量有限,但最先进的技术可以计算下一次攻击大猩猩的数量和位置,因此我们每天都会相应地移动增援部队。您被称为信息部门的精英,以提高效率。
| ^
a.cc:1:1: error: extended character 。 is not valid in an identifier
a.cc:1:1: error: ext... |
s655733886 | p03982 | C++ | #include<cstdio>
#include<utility>
#include<set>
#include<cmath>
#include<algorithm>
#include<cstdlib>
using namespace std;
long long arr[100002];
int l[100002],r[100002],n;
set<pair<int,int> > se;
inline void del(const int& a)
{
set<pair<int,int> >::iterator it;
int b=l[a],c=r[a];
r[b]=c;
l[c]=b;
if(b>0)
{
it=... | In file included from /usr/include/c++/14/bits/stl_tree.h:63,
from /usr/include/c++/14/set:62,
from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]... |
s428733933 | p03982 | C++ | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <cassert>
using namespace std;
typedef ... | a.cc: In function 'int main()':
a.cc:80:67: error: no matching function for call to 'min(ll&, int)'
80 | cand = min(cand,0);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/bits/specfu... |
s148707115 | p03982 | C++ | #include <algorithm>//min/max/sort(rand-access it)/merge
#include <array>
#include <bitset>
#include <climits>//INT_MAX/INT_MIN/ULLONG_MAX
#include <cmath>//fmin/fmax/fabs/sin(h)/cos(h)/tan(h)/exp/log/pow/sqrt/cbrt/ceil/floor/round/trunc
#include <cstdlib>//abs/atof/atoi/atol/atoll/strtod/strtof/..., srand/rand, calloc... | a.cc: In function 'int main()':
a.cc:67:12: error: cannot convert 'ull*' {aka 'long long unsigned int*'} to 'int*'
67 | rar(n, a);
| ^
| |
| ull* {aka long long unsigned int*}
a.cc:38:22: note: initializing argument 2 of 'void rar(int, int*)'
38 | void rar(... |
s352805591 | p03982 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In member function 'V MinCostFlow<NV, V>::mincost(int, int, ll)':
a.cc:35:33: error: expected ',' or ';' before 'int'
35 | int cur=Q.top().second;
| ^~~
a.cc:37:41: error: 'cur' was not declared in this scope
37 | ... |
s310818060 | p03982 | Java | import java.util.Arrays;
import java.util.Scanner;
public class MainH {
MyScanner sc = new MyScanner();
Scanner sc2 = new Scanner(System.in);
long start = System.currentTimeMillis();
long fin = System.currentTimeMillis();
final int MOD = 1000000007;
int[] dx = { 1, 0, 0, -1 };
int[] dy = { 0, 1, -1, 0 };
void... | Main.java:4: error: class MainH is public, should be declared in a file named MainH.java
public class MainH {
^
1 error
|
s930553040 | p03984 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
using vint=vector<int>;
using pint=pair<int,int>... | In file included from /usr/include/c++/14/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
from a.cc:1:
a.cc: In function 'int main()':
a.cc:244:23: error: no matching function for call to 'std::set<long long int>::find(pint)'
244 | assert(va.find(pint... |
s876589181 | p03984 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In function 'void solve()':
a.cc:183:37: error: no matching function for call to 'max(int&, std::vector<int>::size_type)'
183 | if(ng==0) maxper=max(maxper,L.size()/i);
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s302748251 | p03985 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | a.cc: In function 'void solve()':
a.cc:32:33: error: 'c' was not declared in this scope
32 | double x = sqrt(c);
| ^
|
s869110739 | p03986 | Java | import java.util.*; import java.io.*; import java.math.*;
public class Main{
//Don't have to see. start------------------------------------------
static class InputIterator{
ArrayList<String> inputLine = new ArrayList<String>(1024);
int index = 0; int max; String read;
InputIterator(){
BufferedReader br = ne... | Main.java:74: error: cannot find symbol
int output = s.szie();
^
symbol: method szie()
location: variable s of type ArrayList<String>
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s810584649 | p03986 | C++ | #include<stack>
using namespace std;
int main()
{
stack<char> x;
string a;
char ex='T';
cin >> a;
for(int i=0;i<a.length();i++)
{
x.push(a[i]);
if (ex == 'S' && x.top() == 'T')
{
x.pop();
x.pop();
}
if (x.size() == 0)ex = 'T';
else
ex = x.top();
}
cout << x.size () << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'string' was not declared in this scope
7 | string a;
| ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
1 | #include<stack>
+++ |+#include <string>
2 | using ... |
s375675937 | p03986 | C++ | # include <iostream>
# include <vector>
# include <algorithm>
using namespace std;
# define ll long long
int main(){
string S;
cin >> S;
vector<char> stack;
for(int i=0; i<S.size(); i++){
if(S[i] == 'S') stack.push_back(s[i]);
else {
if(stack.empty()) stack.push_back(s[i]);
else stack... | a.cc: In function 'int main()':
a.cc:15:37: error: 's' was not declared in this scope
15 | if(S[i] == 'S') stack.push_back(s[i]);
| ^
a.cc:17:41: error: 's' was not declared in this scope
17 | if(stack.empty()) stack.push_back(s[i]);
| ... |
s325307682 | p03986 | C++ | #include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
string a;
cin>>a;
int tmp=a.find("ST");
while(a.length()>0&&tmp>=0&&tmp!=string::npos)
{
a.erase(tmp,2);
tmp=a.find("ST",x);
if(tmp==string::npos)
tmp=-1;
}
cout<<a.length()<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:33: error: 'x' was not declared in this scope
13 | tmp=a.find("ST",x);
| ^
|
s857359740 | p03986 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str = sc.next();
int s = 0;
int t = 0;
for(int i=0;i<str.length();i++){if(s.charAt(i)=='T'){t++;}
else{break;}
... | Main.java:8: error: int cannot be dereferenced
for(int i=0;i<str.length();i++){if(s.charAt(i)=='T'){t++;}
^
Main.java:11: error: int cannot be dereferenced
for(int i=str.length()-1;i>=0;i--){if(s.charAt(i)=='S'){s++;}
... |
s342224149 | p03986 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str = sc.next();
int s = 0;
int t = 0;
for(int i=0;i<str.length();i++){if(s.charAt(i)=='T'){t++;}
else{break;}
... | Main.java:14: error: ')' or ',' expected
System.out.println(Math.max(2*s,2*t);
^
1 error
|
s157118103 | p03986 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
int a=0,b=0;
for(int i=0;i<s.size();i++){
if(s[i] == 'S'){
a++;
}
else{
if(a>0){
a--;
}
b++;
}
cout << a+b << endl;
}
| a.cc: In function 'int main()':
a.cc:26:4: error: expected '}' at end of input
26 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s051354783 | p03986 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <queue>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<... | a.cc: In function 'int main()':
a.cc:92:13: error: 'S' was not declared in this scope
92 | if (S[i]=='S')
| ^
a.cc:95:26: error: expected ';' before 'else'
95 | if(c==0)ans++
| ^
| ;
96 | else c+... |
s153493747 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
void solve(std::string X) {
int tmp = 0;
int tmp1 = 0;
for(int i= 0,i<X.size();i++){
if(X[i] == 'T'){
if(tmp1 == 0)tmp++;
else tmp1++;
}
else tmp1--;
}
cout<<tmp-tmp1;;
}
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tool... | a.cc: In function 'void solve(std::string)':
a.cc:7:17: error: expected ';' before '<' token
7 | for(int i= 0,i<X.size();i++){
| ^
| ;
a.cc:7:17: error: expected primary-expression before '<' token
|
s639919569 | p03986 | C++ | x = input()
while True:
n = len(x)
fl = 0
for i in range(n-1):
if x[i] == "S" and x[i+1] == "T":
x = x[:i] + x[i+2:]
fl = 1
break
if fl == 0:
break
print(len(x)) | a.cc:1:1: error: 'x' does not name a type
1 | x = input()
| ^
|
s578368195 | p03986 | C++ | #include<iostream>
#include<stdio.h>
#include<string.h>
#include<stack>
const int maxn=2e5+5;
using namespace std;
int main()
{
string s;
cin>>s;
stack<char> q;
for(int i=0;i<s.size();i++)
{
if(q.size==0)
{
q.push(s[i]);
continue;
}
char temp=q.top();
q.push(s[i]);
if(temp=='S'&& s[i]=='T')
{
... | a.cc: In function 'int main()':
a.cc:14:22: error: invalid use of member function 'std::stack<_Tp, _Sequence>::size_type std::stack<_Tp, _Sequence>::size() const [with _Tp = char; _Sequence = std::deque<char, std::allocator<char> >; size_type = long unsigned int]' (did you forget the '()' ?)
14 | if(... |
s070843589 | p03986 | C++ | #include<iostream>
#include<stack>
using namespace std;
stack<char>s;
int main()
{
char a;
int res=0;
while(scanf("%c",&a)!=EOF)
{
res++;
if(ch=='S') s.push(a);
else
{
if(!s.empty())
{
s.pop();
res=res-2;
}
}
}
cout<<res<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:20: error: 'ch' was not declared in this scope
13 | if(ch=='S') s.push(a);
| ^~
|
s325154310 | p03986 | C++ | #include<stdio.h>
#include<string.h>
char s1[200005];
char s2[3]={"ST"};
char t[200005];
int main ()
{
gets(s1);
char *p;
while((p=strstr(s1,s2))!=NULL)
{
strcpy(t,p+strlen(s2));
*p='\0';
strcat(s1,t);
}
printf("%d",strlen(s1));
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s1);
| ^~~~
| getw
|
s424636493 | p03986 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string a;
for(int i=0;i)
string b="ST";
string::size_type idx;
idx=a.find(b);
if(idx == string::npos )
cout << "not found\n";
else
cout <<"found\n";
idx=a.find(c);
if(idx == string::npos )
... | a.cc: In function 'int main()':
a.cc:7:18: error: expected ';' before ')' token
7 | for(int i=0;i)
| ^
| ;
a.cc:10:16: error: 'b' was not declared in this scope
10 | idx=a.find(b);
| ^
a.cc:15:16: error: 'c' was not declared in this scope... |
s503571131 | p03986 | C++ | const long long MAXN= 1e1000;
string str;
int pos1,pos2;
int main()
{
pos1=0,pos2=1;
cin>>str;
int cnt=0;
while(pos2<=str.size() && cnt<MAXN )
{
while (!(str[pos1] == 'S' && str[pos2] == 'T')) {
pos1++, pos2++;
if (pos2 > str.size()) break;
}
if (pos2... | a.cc:1:1: warning: floating constant exceeds range of 'double' [-Woverflow]
1 | const long long MAXN= 1e1000;
| ^~~~~
a.cc:1:23: warning: overflow in conversion from 'double' to 'long long int' changes value from '+Inf' to '9223372036854775807' [-Woverflow]
1 | const long long MAXN= 1e1000;
| ... |
s818945263 | p03986 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
using namespace std;
const int N=200500;
char a[N];
int main()
{
int flag=1;
gets(a);
int size;
while(flag==1)
{
size=strlen(a);
for(int i=0;i<size;i++)
{
if(a[i]=='S'&&a[i+... | a.cc: In function 'int main()':
a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
14 | gets(a);
| ^~~~
| getw
|
s791940496 | p03986 | C++ | #include<stdio.h>
#include<string.h>
const int N=2e6+1;
char a[N];
char temp[N];
/*
int main(void)
{
scanf("%s",a);
char b[2]={'S','T'};
char *p;
while((p=strstr(a,b)) != NULL)
{
*p = '\0';
strcpy (temp, p+strlen(b));
strcat (a, temp);
}
long long ans=strlen(a);
... | a.cc: In function 'int main()':
a.cc:24:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
24 | gets(a);
| ^~~~
| getw
a.cc:27:20: warning: NULL used in arithmetic [-Wpointer-arith]
27 | while (a[i] != NULL)
| ^~~~
a.cc:29:23: warning: NULL u... |
s851141985 | p03986 | C++ | #include<iostream>
#include<stdio.h>
#include<vector>
using namespace std;
vector<char> v;
char x;
int main()
{
while (scanf_s("%c", &x))
{
v.push_back(x);
}
int num = 0;
for (vector<char>::iterator it = v.begin() + 1; it != v.end(); it++)
{
if (*(it - 1) == 'S' && *it == 'T')
{
v.erase(it - 1);
v.era... | a.cc: In function 'int main()':
a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | while (scanf_s("%c", &x))
| ^~~~~~~
| scanf
|
s377204952 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
char c[200000+5];
int main()
{
gets(c);
int len=strlen(c);
stack<char>ans;
for(int i=0;i<len;++i){
if(ans.empty()){
ans.push(c[i]);
continue;
}
if(ans.top()=='S'&&c[i]=='T'){
ans.pop();
}
else{
ans.push(c[i]);
}
}
cout<<ans.size()<<endl;
return... | a.cc: In function 'int main()':
a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(c);
| ^~~~
| getw
|
s627297383 | p03986 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<stack>
using namespace std;
stack<char>q;
int main(){
string s;
cin>>s;
int len=s.size() ;
for(int i=0;i<len;i++){
if(s[i]=='S')q.push('S');
else{
if(q.size()==0)q.push('T');
else{
char c=q.top();
if(c=='S')q.pop();
SSelse q.push('... | a.cc: In function 'int main()':
a.cc:18:33: error: 'SSelse' was not declared in this scope
18 | SSelse q.push('T');
| ^~~~~~
|
s539247253 | p03986 | C | #include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
cin >> s;
for (int i = 0; i < s.length()-1; i++) {
if (s[i] == 'S'&&s[i+1]=='T') {
s.erase(i, 2);
if (i > 0) {
i = i - 2;
}
else {
i = i -... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s011181989 | p03986 | C | #include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
cin >> s;
for (int i = 0; i < s.length()-1; i++) {
if (s[i] == 'S'&&s[i+1]=='T') {
s.erase(i, 2);
if (i > 0) {
i = i - 2;
}
else {
i = i -... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s778645818 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<strin... | a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
38 | }
| ^
a.cc:17:11: note: to match this '{'
17 | int main(){
| ^
|
s214308018 | p03986 | C++ | #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int MAX = 1000000;
const int INF = 1e9;
const double pi=acos(-1);
int main(){
int n;
string s;
cin >>s;
n=s.size();
int ans=n,sums=0;
rep(i,n){
if(s[i]=='S'){
... | a.cc: In function 'int main()':
a.cc:29:11: error: 'st' was not declared in this scope; did you mean 's'?
29 | cout << st.size() << endl;
| ^~
| s
|
s537342118 | p03986 | C++ | #include <cstdio>
#include <cstring>
int main(){
char a[];
int len = strlen(a);
for(int i = 0;i < len;i++){
scanf("%c",&a[i]);
}
for(int i = 0;i < len;i++){
if(a[i]=='S'&&a[i+1]=='T')len-=2;
}
printf("%d",len);
return 0;
} | a.cc: In function 'int main()':
a.cc:4:10: error: storage size of 'a' isn't known
4 | char a[];
| ^
|
s872885974 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
#define outc cout
#define int long long
signed main(){
int b=0,f=0,g=0,c;
string a;
cin>>a;
c=a.size();
for(int i=0;i<a.size();i++){
if(a[i]=='S') b++;
if(b&&a[i]=='T') b--,c-=2;
}
cout<<c< | a.cc: In function 'int main()':
a.cc:14:11: error: expected primary-expression at end of input
14 | cout<<c<
| ^
a.cc:14:11: error: expected '}' at end of input
a.cc:5:14: note: to match this '{'
5 | signed main(){
| ^
|
s460856088 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int sloution(int st, int en)
{
int min=a[st];
int minpos=st;
for(int i=st;i<=en;i++){
if(min>a[i]){
min=a[i];
minpos=i;
}
}
int offset=(minpos-st)>(en-minpos)?(en-minpos+1):(minpos-st+1);
int res=min*(1+offset)*offset+(en-st-2*minpos);
ret... | a.cc: In function 'int sloution(int, int)':
a.cc:5:11: error: 'a' was not declared in this scope
5 | int min=a[st];
| ^
a.cc:15:57: error: expected ';' before '}' token
15 | return res+sloution(st,minpos-1)+sloution(minpos+1,en)
| ... |
s577458750 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int sloution(int st, int en)
{
int min=a[st];
int minpos=st;
for(int i=st;i<=en;i++){
if(min>a[i]){
min=a[i];
minpos=i;
}
}
int offset=(minpos-st)>(en-minpos)?(en-minpos+1):(minps-st+1);
int res=min*(1+offset)*offset+(en-st-2*minpos);
retu... | a.cc: In function 'int sloution(int, int)':
a.cc:5:11: error: 'a' was not declared in this scope
5 | int min=a[st];
| ^
a.cc:13:53: error: 'minps' was not declared in this scope; did you mean 'minpos'?
13 | int offset=(minpos-st)>(en-minpos)?(en-minpos+1):(minps-st+1);
| ... |
s200446087 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int count=0;
int res=0;
char cur='A';
while(cur){
cin.getchar()>>cur;
if(cur=='S')
count++;
else if(cur=='T')
count--;
if(count<0){
res++;
count=0;
}
}
cout<<2*res<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:5: error: 'std::istream' {aka 'class std::basic_istream<char>'} has no member named 'getchar'
8 | cin.getchar()>>cur;
| ^~~~~~~
|
s136830113 | p03986 | C++ | include<iostream>
using namespace std;
int main(){
int count=0;
int res=0;
char cur='A';
while(cur){
cin.getchar()>>cur;
if(cur=='S')
count++;
else if(cur=='T')
count--;
if(count<0){
res++;
count=0;
}
}
cout<<2*res<<endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope
8 | cin.getchar()>>cur;
| ^~~
a.cc:18:2: error: 'cout' was not declared in this scope; did you mean 'count'?
18 | cout<<2*res<<end... |
s055570072 | p03986 | C++ | include<iostream>
using namespace std;
int count=0;
int res=0;
char cur;
while(cur){
cin.getchar(X)>>cur;
if(cur=='S')
count++;
else if(cur=='T')
count--;
if(count<0){
res++;
count++;
}
}
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc:7:1: error: expected unqualified-id before 'while'
7 | while(cur){
| ^~~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s540257004 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b)... | a.cc: In function 'void solve()':
a.cc:26:21: error: expected ';' before 's'
26 | else(x=='S')s.push('S');
| ^
| ;
|
s273071292 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b)... | a.cc: In function 'void solve()':
a.cc:26:21: error: expected ';' before 's'
26 | else(x=='S')s.push('S')
| ^
| ;
a.cc:31:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
31 | int main()
| ^~
a.cc:... |
s994957662 | p03986 | C++ | #include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少.
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#defi... | a.cc: In function 'int main()':
a.cc:28:26: error: no matching function for call to 'min(int64_t&, long long int)'
28 | x.push_back(X[min(i, 200000ll)]);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/... |
s946468058 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
string s;
cin>>s;
ll a=0,b=0,sum=0,n=s.size();
bool flag=false;
for(int i=0;i<n-1;i++){
if(s[i]=='S'&&s[i+1]=='S') a++;
else if(s[i]=='S'&&s[i+1]=='T') a++;
else if(s[i]=='T'&&s[i+1]=='T') b++;
else{
b++;
... | a.cc: In function 'int main()':
a.cc:17:12: error: no matching function for call to 'max(int, ll)'
17 | a=max(0,a-b);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/us... |
s401216845 | p03986 | C++ | S = input()
ans = 0
pos = 0
scount = 0
while pos < len(S):
while pos <len(S) and S[pos] == 'T':
pos += 1
ans += 1
if pos >= len(S):
break
while pos <len(S) and S[pos] == 'S':
pos += 1
scount += 1
if pos >= len(S):
ans += scount
break
tcount ... | a.cc:30:11: error: stray '#' in program
30 | else: #scount < tcount
| ^
a.cc:1:1: error: 'S' does not name a type
1 | S = input()
| ^
|
s390670597 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
for(int i = 0;i< s.size()-2 ; i++)
{
if(s[i] == 'S' && s[i+1] == 'T')
{
s.erase(s.begin()+i);
s.erase(s.begin()+i);
i -= 2;
}
}
if(s = "ST")
{
cout << s.size()-2;
return 0;
}
cout << s.size();
return 0;
}
//s.e... | a.cc: In function 'int main()':
a.cc:18:14: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"ST"))' from 'std::__cxx11::basic_string<char>' to 'bool'
18 | if(s = "ST")
| ~~^~~~~~
| |
| std::__cxx11::basic_string<char... |
s297139545 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
string s;
cin >> s;
int n = (int)s.size();
stack<char> st;
for (int i = 0; i < n; ++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... | a.cc: In function 'int main()':
a.cc:12:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if (s[i] == "S") st.push(s[i]);
a.cc:14:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if (st.top() == "S") st.pop();
| ~~~... |
s849637768 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
string s;
cin >> s;
int n = (int)s.size();
string t = s;
sort(s.begin(), s.end, greater<char>());
int cnt = 0;
for (int i = 0; i < n; ++i) {
if (s[i] != t[i]) cnt++;
}
cout << n - cnt << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:7: error: no matching function for call to 'sort(std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>, std::greater<char>)'
11 | sort(s.begin(), s.end, greater<char>());
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr... |
s383223633 | p03986 | C++ | #include<bits/stdc++.h>
int main(){std::string S;std::cin>>S;stack<char> a;
for(int i=0;i<S.size();i++){if(a.size()&&a.top()==S.at(i)-1)a.pop();else a.push(S.at(i));}
std::cout<<a.size();
} | a.cc: In function 'int main()':
a.cc:2:38: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
2 | int main(){std::string S;std::cin>>S;stack<char> a;
| ^~~~~
| std::stack
In file included from /usr/include/c... |
s676399895 | p03986 | C++ | #include<bits/stdc++.h>
int main(){string S;std::cin>>S;stack<char> a;
for(int i=0;i<S.size();i++){if(a.size()&&a.top()==S.at(i)-1)a.pop();else a.push(S.at(i));}
std::cout<<a.size();
}
| a.cc: In function 'int main()':
a.cc:2:12: error: 'string' was not declared in this scope
2 | int main(){string S;std::cin>>S;stack<char> a;
| ^~~~~~
a.cc:2:12: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
from /usr/include/c++/14/bitset:52,
... |
s154943080 | p03986 | C++ | #include<string>
int main(){std::string S;std::cin>>S;stack<char> a;
for(int i=0;i<S.size();i++){if(a.size()&&a.top()==S.at(i)-1)a.pop();else a.push(S.at(i));}
std::cout<<a.size();
} | a.cc: In function 'int main()':
a.cc:2:31: error: 'cin' is not a member of 'std'
2 | int main(){std::string S;std::cin>>S;stack<char> a;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<s... |
s435052078 | p03986 | C++ | #include<string>
int main(){string S;std::cin>>S;stack<char> a;
for(int i=0;i<S.size();i++){if(a.size()&&a.top()==S.at(i)-1)a.pop();else a.push(S.at(i));}
std::cout<<a.size();
}
| a.cc: In function 'int main()':
a.cc:2:12: error: 'string' was not declared in this scope
2 | int main(){string S;std::cin>>S;stack<char> a;
| ^~~~~~
a.cc:2:12: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
from a.cc:1:
/usr/include/c++/14/bits/... |
s605113510 | p03986 | C++ | #include<iostream>
int main(){string S;std::cin>>S;stack<char> a;
for(int i=0;i<S.size();i++){if(a.size()&&a.top()==S.at(i)-1)a.pop();else a.push(S.at(i));}
std::cout<<a.size();
} | a.cc: In function 'int main()':
a.cc:2:12: error: 'string' was not declared in this scope
2 | int main(){string S;std::cin>>S;stack<char> a;
| ^~~~~~
a.cc:2:12: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
... |
s147585620 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
return m;
}... | a.cc: In function 'int main()':
a.cc:28:27: 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... |
s996526529 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> Pi; typedef map<int,int> MPi; typedef pair<Int,Int> Pl;
const int mod = 1000000007;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) v.begin(),v.end()
#define Pr(type) priority_queue<type>
#define gPr(type) priority_queue<... | a.cc: In function 'int main()':
a.cc:33:18: error: no matching function for call to 'max(unsigned int, std::__cxx11::basic_string<char>::size_type)'
33 | cout<<max(0u,s.size()-ans*2)<<'\n';
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
f... |
s895220431 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
cin>>x;
int scount=0;
int tcount=0;
int ans=s.size();
for(int i=0;i<x.size();i++){
if(x.at(i)=='S'){
scount++;
}
else{
tcount++;
}
if(tcount>scount){
ans-=2;
tcount--;
}
}
cout<<ans;
}
| a.cc: In function 'int main()':
a.cc:8:11: error: 's' was not declared in this scope
8 | int ans=s.size();
| ^
|
s027045556 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
cin>>x;
int scount=0;
int tcount=0;
int ans=s.size();
for(int i=0;i<x.size();i++){
if(x.at(i)=='S'){
scount++;
}
else{
tcount++;
}
if(tcount>scount){
ans-=2;
tcount--;
}
}
} | a.cc: In function 'int main()':
a.cc:8:11: error: 's' was not declared in this scope
8 | int ans=s.size();
| ^
|
s556150675 | p03986 | C++ | #include <string>
#include <iostream> int main() { ... | a.cc:2:269: warning: extra tokens at end of #include directive
2 | #include <iostream> ... |
s254313078 | p03986 | C++ | int main() {
string s;
cin >> s;
int k=0,sn;
for (auto c:s) {
if (c=='S') {++sn;}
else {if (sn>0){--sn;k+=2;}}
}
cout << s.length()-k << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:2:5: error: 'string' was not declared in this scope
2 | string s;
| ^~~~~~
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> s;
| ^~~
a.cc:3:12: error: 's' was not declared in this scope
3 | cin >> s;
| ^
a.... |
s715976759 | p03986 | C++ | #include<cstdio>
#define itn int
using namespace std;
int main()
{
string s;
int n=s.size();
int s1=0;
itn ans=0;
for(int i=0;i<n;i++)
{
s[i]=getchar();
if(s[i]=='S') s1+=1;
if(s1&&s[i]=='T')
{
s1-=1;
ans+=2;
}
}
printf("%d"... | a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
6 | string s;
| ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
1 | #include<cstdio>
+++ |+#include <string>
2 | #define itn i... |
s167497263 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int sums,sumt;
int main(){
cin>>s;
for(int i=0;i<S.size();i++){
if(S[i]=='S')sums++;//有S,S出现的次数++
if((sums)&&(S[i]=='T')){//在有S的前提下,有T
sums--;sumt+=2;}}//丢出一个S,自加2,因为需要删除S和T
cout<<s.size()-sumt<<endl;//最后输出即可
} | a.cc: In function 'int main()':
a.cc:7:19: error: 'S' was not declared in this scope
7 | for(int i=0;i<S.size();i++){
| ^
|
s083696445 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
s+='S';
int res=s.length()-1;
int cnt_s=0,cnt_t=0;
if(s[0]=='S') cnt_s++;
else cnt_t++;
for(int i=1;i<s.length();i++){
if(s[i]=='S') { if(s[i-1]=='T') {res-=2*min(cnt_s,cnt_t);
cnt_s=cnt_t=0;
... | a.cc:30:2: error: '_' does not name a type
30 | }_
| ^
|
s431914571 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string X;cin >> X;
int cntS = 0;
int ans = N;
int N = X.size();
for(int i = 0; i < N; ++i){
if(X[i] == 'S')cntS++;
else if(cntS > 0){
cntS--;
ans--;
}
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:13: error: 'N' was not declared in this scope
6 | int ans = N;
| ^
|
s345404348 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin >> s;
int size = s.length(), a = 0, b = 0;
for (int i = 0; i < size; i++) {
if (s[i] == 'S')
a++;
else {
if (s>0)
a--;
else
b++;
}
}
cout << a+b << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:12: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
11 | if (s>0)
| ~^~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}... |
s328860099 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x;
int i, a = 0, b = 0;
cin >> x;
for(i = 0; i < x.size(); i++){
if(x.at(i) == 'T'){
a++;
}
else{
break;
}
}
for(i = n - 1; i >= 0; i--){
if(x.at(i) == 'S'){
b++;
}
else{
break;
}... | a.cc: In function 'int main()':
a.cc:18:11: error: 'n' was not declared in this scope
18 | for(i = n - 1; i >= 0; i--){
| ^
|
s737451177 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string x, i, a = 0, b = 0;
cin >> x;
for(i = 0; i < x.size(); i++){
if(x.at(i) == 'T'){
a++;
}
else{
break;
}
}
for(i = n - 1; i >= 0; i--){
if(x.at(i) == 'S'){
b++;
}
else{
break;
}
}
... | a.cc: In function 'int main()':
a.cc:8:11: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
8 | for(i = 0; i < x.size(); i++){
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c... |
s905546997 | p03986 | Java | import java.util.Scanner;
import java.lang.Math;
public class MainA {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
int ans = str.length();
int sequenceS = 0, sequenceT = 0;
for (int i = 0; i < str.length... | Main.java:4: error: class MainA is public, should be declared in a file named MainA.java
public class MainA {
^
1 error
|
s223310123 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
int cs = 0;
int cnt =0;
for (int i =0;i<s.length();i++)
{
if (s[i]=='S')
cs++;
else if (s[i]=='T'&&cs>0)
{
cs--;
cnt++;
}
}
cour << s.length()- cnt*2 << endl;
}
| a.cc: In function 'int main()':
a.cc:21:3: error: 'cour' was not declared in this scope
21 | cour << s.length()- cnt*2 << endl;
| ^~~~
|
s625407567 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin>>str;
int scnt,tcnt,m=0;
scnt=tcnt=0;
bool s=1;
for(int i=0;i<str.length();++i)
{
if(str[i]=='S'){
if(s)
scnt++;
}
else{
if(scnt>tcnt){
... | a.cc: In function 'int main()':
a.cc:31:9: error: 'else' without a previous 'if'
31 | else{
| ^~~~
a.cc: At global scope:
a.cc:36:5: error: expected unqualified-id before 'if'
36 | if(scnt>tcnt)m+=(scnt-tcnt);
| ^~
a.cc:37:5: error: expected unqualified-id before 'else'
37 |... |
s695625136 | p03986 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:114:26: error: request for member 'size' in 'N', which is of non-class type 'int'
114 | #define SIZ(x) ((int)(x).size())
| ^~~~
a.cc:362:7: note: in expansion of macro 'SIZ'
362 | N = SIZ(N);
| ^~~
|
s578436035 | p03986 | C++ | jhkh | a.cc:1:1: error: 'jhkh' does not name a type
1 | jhkh
| ^~~~
|
s223232293 | p03986 | C++ | #include <iostream>
#include<string>
using namespace std;
int main()
{
int T;
string p1;
cin>>p1;
while(p1.find("ST")!=-1)
{
n=p1.find("ST");
p1.erase(n,2);
}
cout<<p1.length()<<endl;
}
| a.cc: In function 'int main()':
a.cc:12:13: error: 'n' was not declared in this scope
12 | n=p1.find("ST");
| ^
|
s287279465 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int cnt=0,cntmin=0;
string S;
cin >> S;
int ans=S.length();
for(int i=0; i<S.length(); i++){
if(S[i]=='S')cnt++;
else cnt--;
if(cnt<0)cnt=0;
if(cnt>cntmax)cntmax=cnt;
if(cnt==0){
ans-=cntmax*2;
cntmax=0;
}
}
cout ... | a.cc: In function 'int main()':
a.cc:12:12: error: 'cntmax' was not declared in this scope; did you mean 'cntmin'?
12 | if(cnt>cntmax)cntmax=cnt;
| ^~~~~~
| cntmin
a.cc:14:12: error: 'cntmax' was not declared in this scope; did you mean 'cntmin'?
14 | ans-=cntmax*2;
... |
s153497795 | p03986 | C++ | #include<bits/stdc++.h>
#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)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))... | a.cc: In function 'int main()':
a.cc:27:72: error: 's' was not declared in this scope
27 | if (st.empty() || st.top() == X[i] || st.top() == 'T') st.push(s[i]);
| ^
|
s100344183 | p03986 | C++ | #include <iostream>
int main(void)
{
char x[200001];
int l, ct = 0, cs = 0, ans = 0;
std::cin >> x;
l = std::strlen(x);
while(x[ct] == 'T') ct++;
for(int i = ct; i != l; i++){
if(x[i] == 'S'){
cs++;
}else{
if(cs > 0) cs--;
else ans++;
}
}
std::cout << ct + ans + cs << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:18: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
7 | l = std::strlen(x);
| ^~~~~~
| mbrlen
|
s458043424 | p03986 | Java | import java.util.Scanner;
public class ProblemA {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String X = sc.next();
sc.close();
int l = X.length();
for(int i = 0; i < 50; i++) {
X = X.replaceAll("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT... | Main.java:3: error: class ProblemA is public, should be declared in a file named ProblemA.java
public class ProblemA {
^
1 error
|
s043234873 | p03986 | Java | import java.util.Scanner;
public class ProblemA {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String X = sc.next();
sc.close();
int l = X.length();
for(int i = 0; i < 50; i++) {
X = X.replaceAll("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT... | Main.java:3: error: class ProblemA is public, should be declared in a file named ProblemA.java
public class ProblemA {
^
1 error
|
s142385343 | p03986 | C++ | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
int main()
{
int size,ans,cou;
cou = 0;
string X;
cin >> X;
size = X.length();
ans = size;
for (int i = 0; i < size; i++... | a.cc: In function 'int main()':
a.cc:23:29: error: 'S' was not declared in this scope
23 | if (X[i] == S){
| ^
a.cc:25:30: error: 'T' was not declared in this scope
25 | }if (X[i] == T){
| ^
|
s455986438 | p03986 | C++ | #include <bits/stdc++.h>
const int mod = 1000 * 1000 * 1000 + 7;
using namespace std;
int main()
{
string s;
cin >> s;
vector<int> v;
for(auto x : s)
{
if(x == 'S')
v.PB(x);
else if(x == 'T' && v.size() && v.back() == 'S')
v.pop_back();
else
v.PB(x);
}
cout << v.size() << endl;
} | a.cc: In function 'int main()':
a.cc:12:27: error: 'class std::vector<int>' has no member named 'PB'
12 | v.PB(x);
| ^~
a.cc:16:27: error: 'class std::vector<int>' has no member named 'PB'
16 | v.PB(x);
| ... |
s621282895 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> p_int;
typedef pair<ll,ll> p_ll;
typedef tuple<ll,ll,ll> t3_ll;
int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
const ll inf = 1e9+7;
int main() {
... | a.cc: In function 'int main()':
a.cc:17:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | if (s[i] == "S") {stack++;}
|
s137481374 | p03986 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> p_int;
typedef pair<ll,ll> p_ll;
typedef tuple<ll,ll,ll> t3_ll;
int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
const ll inf = 1e9+7;
int main() {
... | a.cc: In function 'int main()':
a.cc:16:30: 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... |
s718978207 | p03986 | C++ | #include<string>
#include<iostream>
using namespace std;
int main()
{
string str;
cin >> str;
while(str.find("ST",0)!=-1)
{
str.erase(str.find("ST", 0), 2);
}
if(str.lenth()==0) return 0;
else cout << str.length();
return 0;
} | a.cc: In function 'int main()':
a.cc:13:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenth'; did you mean 'length'?
13 | if(str.lenth()==0) return 0;
| ^~~~~
| length
|
s094646566 | p03986 | C++ | TSSTTTSS | a.cc:1:1: error: 'TSSTTTSS' does not name a type
1 | TSSTTTSS
| ^~~~~~~~
|
s750381546 | p03986 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner stdin = new Scanner( System.in);
String x;
int i=0,j=0;
x =stdin.next();
for(int k=1;k<=x.length();k++){
String xx=x.substring(k-1,k);
if(xx.equals("S")){i++;
}else{i--;
}
if(i<0){
j++;
i=... | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s143446320 | p03986 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int sum1,sum2,sum;
int main()
{
cin>>s;
int n=s.size();
for(int i=0;i<n;i++)
{
if(s[i]=='S') sum2++;
if(sum2>=sum1)
else if(sum2) sum1++;
{
sum+=min(sum2,sum1)*2;
sum2-=min(sum2,sum1);
... | a.cc: In function 'int main()':
a.cc:13:9: error: expected primary-expression before 'else'
13 | else if(sum2) sum1++;
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.