problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02937 | Python | Runtime Error | # Library
import bisect
alp = "abcdefghijklmnopqrstuvwxyz"
#
s = input()
t = input()
ss = s * 2
index = -1
cir = 0
letter = []
res = 0
for i in range(len(ss)):
letter.append([ss[i], i])
# Sort出来る.
letter.sort()
for i in range(len(t)):
search = [t[i], index]
tmp_ind = bisect.bisect(letter, search)
#... | # Library
import bisect
alp = "abcdefghijklmnopqrstuvwxyz"
#
s = input()
t = input()
ss = s * 2
index = -1
cir = 0
letter = []
res = 0
for i in range(len(ss)):
letter.append([ss[i], i])
# Sort出来る.
letter.sort()
for i in range(len(t)):
search = [t[i], index]
tmp_ind = bisect.bisect(letter, search)
#... | insert | 26 | 26 | 26 | 29 | 0 | |
p02937 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
using ll = long long;
int main() {
string s, t;
cin >> s >> t;
ll s_size = s.length();
ll t_size = t.length();
ll s_table[26][s_size];
ll s_cur[26];
bool used[26];
for (int i = 0; i < 26; i++) {
for (int j = 0; j < s_size; j++) {
... | #include <iostream>
#include <string>
using namespace std;
using ll = long long;
int main() {
string s, t;
cin >> s >> t;
ll s_size = s.length();
ll t_size = t.length();
ll s_table[26][s_size];
ll s_cur[26];
bool used[26];
for (int i = 0; i < 26; i++) {
for (int j = 0; j < s_size; j++) {
... | replace | 52 | 53 | 52 | 53 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
string s, t;
vector<int> dict[30];
long long ans;
long long search(char t) {
long long x;
long long y = 0;
x = ans % s.length();
if (dict[(int)t... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
string s, t;
vector<int> dict[30];
long long ans;
long long search(char t) {
long long x;
long long y = 0;
x = ans % s.length();
if (dict[(int)t... | insert | 38 | 38 | 38 | 39 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll findNext(ll curr_idx, ll len, vector<ll> pos) {
ll multiplier = curr_idx / len;
curr_idx = curr_idx % len;
ll next_pos = lower_bound(pos.begin(), pos.end(), curr_idx) - pos.begin();
if (next_pos == pos.size())
return len * (multiplier ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll findNext(ll curr_idx, ll len, vector<ll> pos) {
ll multiplier = curr_idx / len;
curr_idx = curr_idx % len;
ll next_pos = lower_bound(pos.begin(), pos.end(), curr_idx) - pos.begin();
if (next_pos == pos.size())
return len * (multiplier ... | replace | 48 | 49 | 48 | 58 | TLE | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int64_t s, t;
s = S.size();
t = T.size();
S = S + S;
vector<vector<int64_t>> a(1e+5 + 10, vector<int64_t>(26, 2 * s));
for (int64_t i = 2 * s - 1; i >= 0; --i) {
for (int64_t j = 0; j < 26; ++j) {
a[i][j... | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int64_t s, t;
s = S.size();
t = T.size();
S = S + S;
vector<vector<int64_t>> a(2 * s + 10, vector<int64_t>(26, 2 * s));
for (int64_t i = 2 * s - 1; i >= 0; --i) {
for (int64_t j = 0; j < 26; ++j) {
a[i][... | replace | 13 | 14 | 13 | 14 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1 << (n))
#define ii(x) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1 << (n))
#define ii(x) ... | replace | 65 | 68 | 65 | 68 | TLE | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
char a[maxn];
char b[maxn];
vector<int> c[30];
int main() {
scanf("%s %s", a, b);
int n = strlen(a);
int m = strlen(b);
long long sum = 0;
for (int i = 0; i < n; i++) {
c[a[i] - 'a'].push_back(i + 1);
}
int j;
int x = b[0] - 'a... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
char a[maxn];
char b[maxn];
vector<int> c[30];
int main() {
scanf("%s %s", a, b);
int n = strlen(a);
int m = strlen(b);
long long sum = 0;
for (int i = 0; i < n; i++) {
c[a[i] - 'a'].push_back(i + 1);
}
int j;
int x = b[0] - 'a... | insert | 24 | 24 | 24 | 28 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define pp pair<int, int>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define ll long long
ll MOD = 1000000007;
ll mod = 998244353;
int inf = 1000000000;
ll INF = 10000000000000000;
int main() {
string s, t;
cin >> s >> t;
vector<vector<ll>> o(26, vector<ll>(... | #include <bits/stdc++.h>
using namespace std;
#define pp pair<int, int>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define ll long long
ll MOD = 1000000007;
ll mod = 998244353;
int inf = 1000000000;
ll INF = 10000000000000000;
int main() {
string s, t;
cin >> s >> t;
vector<vector<ll>> o(26, vector<ll>(... | replace | 24 | 29 | 24 | 28 | TLE | |
p02937 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
string ss = s + s;
vector<vector<int>> nex(s.length(), vector<int>(26, -1));
vector<int> idx(26, -1);
for (size_t i = ss.length() - 1; i >= s.length(); --i) {
idx[ss[i] - 'a'] = i;
}
for (size_t i = ... | #include <iostream>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
string ss = s + s;
vector<vector<int>> nex(s.length(), vector<int>(26, -1));
vector<int> idx(26, -1);
for (size_t i = ss.length() - 1; i >= s.length(); --i) {
idx[ss[i] - 'a'] = i;
}
for (size_t i = ... | replace | 13 | 14 | 13 | 14 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> t >> s;
vector<vector<long>> tc(26);
long n = t.size();
for (long i = 0; i < n; i++) {
// cout << t[i] <... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> t >> s;
vector<vector<long>> tc(26);
long n = t.size();
for (long i = 0; i < n; i++) {
// cout << t[i] <... | replace | 33 | 42 | 33 | 38 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define EM 1000000
using namespace std;
using LL = long long;
using P = pair<LL, LL>;
LL LINF = 1e18;
int INF = 1e9;
LL mod = 1e9 + 7;
using vint = vector<int>;
using vLL = vector<LL>;
using vvint = vector<vector<int>>;
using vvLL = vector<vector<LL>>;
template <class T> inline bool chmax(T &a,... | #include <bits/stdc++.h>
#define EM 1000000
using namespace std;
using LL = long long;
using P = pair<LL, LL>;
LL LINF = 1e18;
int INF = 1e9;
LL mod = 1e9 + 7;
using vint = vector<int>;
using vLL = vector<LL>;
using vvint = vector<vector<int>>;
using vvLL = vector<vector<LL>>;
template <class T> inline bool chmax(T &a,... | replace | 64 | 66 | 64 | 65 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
string s, t;
cin >> s >> t;
vector<vector<int>> memo(26);
int cur = 0; // 今何週目を見ているか
int dex = 0; // 次に何文字目をみるか
ll ans = 0;
for (int i = 0; i < s.size(); i++) {
memo[s[i] -... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
string s, t;
cin >> s >> t;
vector<vector<int>> memo(26);
int cur = 0; // 今何週目を見ているか
int dex = 0; // 次に何文字目をみるか
ll ans = 0;
for (int i = 0; i < s.size(); i++) {
memo[s[i] -... | replace | 23 | 29 | 23 | 36 | TLE | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct Fast {
Fast() {
std::cin.tie(0);
ios::sync_with_stdio(false);
}
} fast;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
... | #include <bits/stdc++.h>
using namespace std;
struct Fast {
Fast() {
std::cin.tie(0);
ios::sync_with_stdio(false);
}
} fast;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
... | replace | 27 | 28 | 27 | 28 | -11 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void YES() { cout... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void YES() { cout... | replace | 40 | 50 | 40 | 46 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s, t;
cin >> s >> t;
string ss = s + s;
map<char, vi> ss_m;
for (int i = ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s, t;
cin >> s >> t;
string ss = s + s;
map<char, vi> ss_m;
for (int i = ... | replace | 28 | 34 | 28 | 36 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
string ds = s + s;
vector<vector<int>> abc(26);
for (int i = 0; i < ds.length(); i++) {
abc[ds[i] - 'a'].push_back(i);
}
for (int i = 0; i < 26; i++) {
sort(abc[i].begin(), abc[i].end());
}
// now:今のsでの添字
... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
string ds = s + s;
vector<vector<int>> abc(26);
for (int i = 0; i < ds.length(); i++) {
abc[ds[i] - 'a'].push_back(i);
}
for (int i = 0; i < 26; i++) {
sort(abc[i].begin(), abc[i].end());
}
// now:今のsでの添字
... | replace | 18 | 21 | 18 | 22 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
vector<set<int>> v(26);
int n = int(s.size());
rep(i, n) { v[s[i] - 'a'].insert(i + 1); }
ll ans = 0;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
vector<set<int>> v(26);
int n = int(s.size());
rep(i, n) { v[s[i] - 'a'].insert(i + 1); }
ll ans = 0;
... | replace | 22 | 23 | 22 | 23 | TLE | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
ll gcd(ll a, ll b) { return b ? gcd... | #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
ll gcd(ll a, ll b) { return b ? gcd... | insert | 33 | 33 | 33 | 37 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int last = -1, ans = 0;
vector<vector<int>> v(26);
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size(); ++i) {
v[s[i] - 'a'].push_back(i);
}
for (int i = 0; i < t.size(); ++i) {
if (v[t[i] - 'a'].size() == 0) {
cout <... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int last = -1, ans = 0;
vector<vector<int>> v(26);
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size(); ++i) {
v[s[i] - 'a'].push_back(i);
}
for (int i = 0; i < t.size(); ++i) {
if (v[t[i] - 'a'].size() == 0) {
cout <... | replace | 17 | 18 | 17 | 21 | TLE | |
p02937 | Python | Time Limit Exceeded | def main():
s = input()
t = input()
if not set(t) <= set(s):
print(-1)
return
s_indexes = {c: [] for c in "abcdefghijklmnopqrstuvwxyz"}
for i, s_c in enumerate(s):
s_indexes[s_c].append(i)
s_pointer = {c: 0 for c in "abcdefghijklmnopqrstuvwxyz"}
s_length = {c: len(s... | def main():
s = input()
t = input()
if not set(t) <= set(s):
print(-1)
return
s_indexes = {c: [] for c in "abcdefghijklmnopqrstuvwxyz"}
for i, s_c in enumerate(s):
s_indexes[s_c].append(i)
s_pointer = {c: 0 for c in "abcdefghijklmnopqrstuvwxyz"}
s_length = {c: len(s... | replace | 22 | 25 | 22 | 25 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using ll = ... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using ll = ... | replace | 41 | 49 | 41 | 44 | TLE | |
p02937 | C++ | Runtime Error | //
// Created by yamunaku on 2019/08/19.
//
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repl(i, l, r) for (int i = (l); i < (r); i++)
#define per(i, n) for (int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for (int i = ((r)-1); i >= (l); i--)
#define all(x... | //
// Created by yamunaku on 2019/08/19.
//
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repl(i, l, r) for (int i = (l); i < (r); i++)
#define per(i, n) for (int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for (int i = ((r)-1); i >= (l); i--)
#define all(x... | replace | 45 | 46 | 45 | 52 | 0 | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define db long double
#define ii pair<int, int>
#define vi vector<int>
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define a... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define db long double
#define ii pair<int, int>
#define vi vector<int>
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define a... | replace | 41 | 42 | 41 | 42 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#ifdef _PRINTDEBUG
#include "lib/printdebug.hpp"
#else
#define printdebug(...) 1
#endif
#define MOD_1_000_000_007 (1000000007LL)
#define LINF (1LL << 60)
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i, n) for (long long i = 1; i < (long long)(n); i++)
#define r... | #include <bits/stdc++.h>
#ifdef _PRINTDEBUG
#include "lib/printdebug.hpp"
#else
#define printdebug(...) 1
#endif
#define MOD_1_000_000_007 (1000000007LL)
#define LINF (1LL << 60)
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i, n) for (long long i = 1; i < (long long)(n); i++)
#define r... | replace | 36 | 43 | 36 | 47 | TLE | |
p02937 | C++ | Runtime Error | /*author : Yashvardhan
Sunday, August 18, 2019
6:46 PM
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define pb push_back
#define vi vector<int>
#define pi pair<int, int>
#define vpi vector<pi>
#define ff first
#define ss second
#define mp make_pair
#define endl '\n'
#define a... | /*author : Yashvardhan
Sunday, August 18, 2019
6:46 PM
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define pb push_back
#define vi vector<int>
#define pi pair<int, int>
#define vpi vector<pi>
#define ff first
#define ss second
#define mp make_pair
#define endl '\n'
#define a... | replace | 143 | 144 | 143 | 144 | 0 |
18892
|
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int>> mati;
typedef vector<vector<double>> matd;
type... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int>> mati;
typedef vector<vector<double>> matd;
type... | insert | 155 | 155 | 155 | 156 | 0 | |
p02937 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
// contest
// sentence
// s e nte n c... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
// contest
// sentence
// s e nte n c... | insert | 35 | 35 | 35 | 39 | 0 | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define pb push_back
using namespace std;
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
ll ans = -1;
vector<vector<int>> a(26);
rep(i, s.size()) { a[s[i] - 'a'].pb(i); }
/* vector<vector<int>> b(t.size());
rep(i, ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define pb push_back
using namespace std;
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
ll ans = -1;
vector<vector<int>> a(26);
rep(i, s.size()) { a[s[i] - 'a'].pb(i); }
rep(i, t.size()) {
if (a[t[i] - 'a'].empty(... | replace | 13 | 23 | 13 | 20 | 0 | |
p02937 | C++ | Runtime Error | /*
[abc138] E - Strings of Impurity
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define ALL(c) (c).begin(), (c).end()
const int MAX_S = 1e5;
const int INF = 1e9;
string s, t;
int d['z' - 'a' + 1][MAX_S];
... | /*
[abc138] E - Strings of Impurity
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define ALL(c) (c).begin(), (c).end()
const int MAX_S = 1e5;
const int INF = 1e9;
string s, t;
int d['z' - 'a' + 1][MAX_S];
... | replace | 29 | 30 | 29 | 30 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
ios::sync_with_stdio(false);
cin.... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
ios::sync_with_stdio(false);
cin.... | replace | 24 | 32 | 24 | 28 | TLE | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
using ll = long long;
using ld = long double;
const char nl = '\n';
/* -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*-
* -*- -*- -*- -*- */
#include <bits/extc++.h>
namespace pbds = __gnu_pbds;
template <typen... | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
using ll = long long;
using ld = long double;
const char nl = '\n';
/* -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*-
* -*- -*- -*- -*- */
#include <bits/extc++.h>
namespace pbds = __gnu_pbds;
template <typen... | replace | 92 | 93 | 92 | 93 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
int main() {
string s, t;
cin >> s >> t;
map<char, vector<ll>> mps;
for (ll i = 0; i < s.size(); i++)
mps[s[... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
int main() {
string s, t;
cin >> s >> t;
map<char, vector<ll>> mps;
for (ll i = 0; i < s.size(); i++)
mps[s[... | replace | 30 | 32 | 30 | 31 | TLE | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
const ll mod = 1e9 + 7;
ll powmod(ll a, ll b) {
ll res = 1;
a %= mod;
assert(b >= 0);
for (; b; b >>= 1) {
if (b & 1)
res = res * a % mod;
a = a * a % mod;
}
return res;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;... | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
const ll mod = 1e9 + 7;
ll powmod(ll a, ll b) {
ll res = 1;
a %= mod;
assert(b >= 0);
for (; b; b >>= 1) {
if (b & 1)
res = res * a % mod;
a = a * a % mod;
}
return res;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;... | insert | 37 | 37 | 37 | 38 | 0 | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
typedef pair<int, int> PI;
typedef pair<int, pair<int, int>> PII;
static const int INF = 1010000000000000017LL;
static const double eps = 1... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
typedef pair<int, int> PI;
typedef pair<int, pair<int, int>> PII;
static const int INF = 1010000000000000017LL;
static const double eps = 1... | replace | 35 | 36 | 35 | 36 | 0 | |
p02937 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <float.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <s... | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <float.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <s... | insert | 111 | 111 | 111 | 115 | 0 | |
p02937 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MN 400005
char ch[MN], ch2[MN];
int nex[MN][26];
long long ans;
int main() {
scanf("%s%s", ch + 1, ch2);
long long l1 = strlen(ch + 1), l2 = strlen(ch2);
for (int i = 0; i < 26; ++i)
nex[(l1 << 1)][i] = -1;
for (int i = (l1 << 1); i; --i) {
for (int ... | #include <bits/stdc++.h>
using namespace std;
#define MN 400005
char ch[MN], ch2[MN];
int nex[MN][26];
long long ans;
int main() {
scanf("%s%s", ch + 1, ch2);
long long l1 = strlen(ch + 1), l2 = strlen(ch2);
for (int i = 0; i < 26; ++i)
nex[(l1 << 1)][i] = -1;
for (int i = (l1 << 1); i; --i) {
for (int ... | replace | 15 | 16 | 15 | 19 | 0 | |
p02937 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
int main() {
string s, t;
cin >> s >> t;
string sample = s + s;
ll pos[s.size()][26];
for (int yi = 0; yi < s.size(); ++yi) {
for (int ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
int main() {
string s, t;
cin >> s >> t;
string sample = s + s;
ll pos[s.size()][26];
for (int yi = 0; yi < s.size(); ++yi) {
for (int ... | replace | 31 | 32 | 31 | 32 | 0 | |
p02937 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >... | replace | 29 | 30 | 29 | 30 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using P = pair<char, int>;
vector<int> c2p[10000];
string s, t;
int main() {
cin >> s >> t;
int sz = s.size();
for (int i = 0; i < sz; i++) {
c2p[s[i]].push_back(i);
}
long long int cnt = 0;
int prep = -1;
for (auto c : t) {
if (c2p[c].size() == 0) ... | #include <bits/stdc++.h>
using namespace std;
using P = pair<char, int>;
vector<int> c2p[10000];
string s, t;
int main() {
cin >> s >> t;
int sz = s.size();
for (int i = 0; i < sz; i++) {
c2p[s[i]].push_back(i);
}
long long int cnt = 0;
int prep = -1;
for (auto c : t) {
if (c2p[c].size() == 0) ... | replace | 22 | 23 | 22 | 23 | TLE | |
p02937 | C++ | Runtime Error | // 17571@nith.ac.in @Ankit Verma
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize("O3")
#ifndef ONLINE_JUDGE
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cerr ... | // 17571@nith.ac.in @Ankit Verma
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize("O3")
#ifndef ONLINE_JUDGE
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cerr ... | delete | 131 | 135 | 131 | 131 | 0 | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define invrep(i, n) for (int64_t i = n - 1; i >= 0; i--)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor, int number, int ... | #include <bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define invrep(i, n) for (int64_t i = n - 1; i >= 0; i--)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor, int number, int ... | replace | 96 | 101 | 96 | 99 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
void solve(string s, string t) {
int sn = s.size(), tn = t.size();
vector<vector<int>> positions(26);
for (int i = 0; i < sn; i++) {
positions.at(s.at(i) - 'a').push_back(i);
}
for (int i = 0; i < sn; i++) {
positions.at(s.at(i) - 'a').push_back(sn + i);
... | #include <bits/stdc++.h>
using namespace std;
void solve(string s, string t) {
int sn = s.size(), tn = t.size();
vector<vector<int>> positions(26);
for (int i = 0; i < sn; i++) {
positions.at(s.at(i) - 'a').push_back(i);
}
for (int i = 0; i < sn; i++) {
positions.at(s.at(i) - 'a').push_back(sn + i);
... | replace | 22 | 24 | 22 | 25 | TLE | |
p02937 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
vector<vector<ll>> a(26);
int main() {
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size(); i++) {
ll now = s[i] - 'a';
a[now].push_back(i + 1);
}
ll ans = 0, now = 0;
bool out = fa... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
vector<vector<ll>> a(26);
int main() {
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size(); i++) {
ll now = s[i] - 'a';
a[now].push_back(i + 1);
}
ll ans = 0, now = 0;
bool out = fa... | replace | 19 | 28 | 19 | 27 | TLE | |
p02938 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
int main() {
long long l, r;
cin >> l >> r;
long long ans = 0;
// x ⊂ y
// (0, 0), (0, 1), (1, 1)
for (int k = 0; k < 62; k++) {
long long c = 1LL << k;
long long d = 1LL << (k + 1);
if (l >= d || c > r)
continue;
lon... | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
int main() {
long long l, r;
cin >> l >> r;
long long ans = 0;
// x ⊂ y
// (0, 0), (0, 1), (1, 1)
for (int k = 0; k < 62; k++) {
long long c = 1LL << k;
long long d = 1LL << (k + 1);
if (l >= d || c > r)
continue;
lon... | replace | 52 | 56 | 52 | 53 | 0 | |
p02938 | C++ | Runtime Error | #include <bits/stdc++.h>
#define dbug(x) cout << #x << "=" << x << endl
using namespace std;
template <typename T> void read(T &t) {
t = 0;
char ch = getchar();
int f = 1;
while ('0' > ch || ch > '9') {
if (ch == '-')
f = -1;
ch = getchar();
}
do {
(t *= 10) += ch - '0';
ch = getchar()... | #include <bits/stdc++.h>
#define dbug(x) cout << #x << "=" << x << endl
using namespace std;
template <typename T> void read(T &t) {
t = 0;
char ch = getchar();
int f = 1;
while ('0' > ch || ch > '9') {
if (ch == '-')
f = -1;
ch = getchar();
}
do {
(t *= 10) += ch - '0';
ch = getchar()... | replace | 43 | 44 | 43 | 44 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define endl '\n'
#define PI 3.14159265359d
#define sz(x) (int)x.size()
#define rep(i, a, b) for (int i = a; i < b; i++)
#define magic 109
#define INF INT_MAX
... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define endl '\n'
#define PI 3.14159265359d
#define sz(x) (int)x.size()
#define rep(i, a, b) for (int i = a; i < b; i++)
#define magic 109
#define INF INT_MAX
... | replace | 83 | 89 | 83 | 84 | 0 | |
p02939 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
char s[100010];
int main() {
scanf("%s", s + 1);
int L = strlen(s + 1), ans = 0;
for (int i = 1, j; i <= L; ++i) {
for (j = i; s[j] == s[j + 1]; ++j)
;
int l = j - i + 1;
switch (l % 3) {
case 0:
ans += l / 3 * 2;
break;
case 1:
ans ... | #include <cstdio>
#include <cstring>
char s[200010];
int main() {
scanf("%s", s + 1);
int L = strlen(s + 1), ans = 0;
for (int i = 1, j; i <= L; ++i) {
for (j = i; s[j] == s[j + 1]; ++j)
;
int l = j - i + 1;
switch (l % 3) {
case 0:
ans += l / 3 * 2;
break;
case 1:
ans ... | replace | 2 | 3 | 2 | 3 | 0 | |
p02939 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);
string s;
map<pair<int, string>, int> memo;
int ans;
int solve(int pos, string last) {
auto key = make_pair(pos, last);
if (memo.find(key) != memo.end())
return memo[key];... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);
string s;
map<pair<int, string>, int> memo;
int ans;
int solve(int pos, string last) {
auto key = make_pair(pos, last);
if (memo.find(key) != memo.end())
return memo[key];... | replace | 24 | 25 | 24 | 25 | TLE | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define int long long
#define MOD 998244353
using namespace std;
const int N = 300005;
string s;
int dp[100001][2];
... | #include <bits/stdc++.h>
#define fio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define int long long
#define MOD 998244353
using namespace std;
const int N = 300005;
string s;
int dp[200006][2];
... | replace | 10 | 11 | 10 | 11 | 0 | |
p02939 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, o) for (int i = 0; i < (o); i++)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
#define NUM 1e5
typedef long lon... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, o) for (int i = 0; i < (o); i++)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
#define NUM 1e5
typedef long lon... | replace | 40 | 41 | 40 | 41 | 0 | |
p02939 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 mt(736);
int foo(const string &s, const string &last = "", int p = 0) {
static map<pair<int, string>, int> dp;
if (p == s.size())
return 0;
for (int i = p + 1; i <= s.size() && i < p + 4; i++)
if (s.substr(p, i - p) != last)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 mt(736);
int foo(const string &s, const string &last = "", int p = 0) {
static map<pair<int, string>, int> dp;
if (p == s.size())
return 0;
if (!dp.count({p, last}))
for (int i = p + 1; i <= s.size() && i < p + 4; i++)
... | replace | 14 | 17 | 14 | 18 | TLE | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, n) for (ll i = x; i < n; i++)
#define pb push_back
#define pf push_front
#define ll long long
#define hii cout << "hii" << endl
#define pii pair<int, int>
#define pll pair<ll, ll>
#define int ll
#define mpp make_pair
#define endl '\n'
#define ff first
#de... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, n) for (ll i = x; i < n; i++)
#define pb push_back
#define pf push_front
#define ll long long
#define hii cout << "hii" << endl
#define pii pair<int, int>
#define pll pair<ll, ll>
#define int ll
#define mpp make_pair
#define endl '\n'
#define ff first
#de... | replace | 62 | 66 | 62 | 66 | 0 | |
p02939 | C++ | Runtime Error | #include "bits/stdc++.h"
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(), a.end())
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MP(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define INF LLONG_MAX / 2... | #include "bits/stdc++.h"
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(), a.end())
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MP(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define INF LLONG_MAX / 2... | replace | 21 | 22 | 21 | 22 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define N 200005
#define task "t"
#define mu(x) x *x
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using piii = pair<int, pii>;
const int inf = 1e9 + 7;
const int base = 311;
string s;
ll Hash = 0, res = 0, Hash1 = -1;
int main() {
ios::sync_with_stdio(false);
ci... | #include <bits/stdc++.h>
#define N 200005
#define task "t"
#define mu(x) x *x
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using piii = pair<int, pii>;
const int inf = 1e9 + 7;
const int base = 311;
string s;
ll Hash = 0, res = 0, Hash1 = -1;
int main() {
ios::sync_with_stdio(false);
ci... | replace | 20 | 22 | 20 | 22 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define maxn 20100
using namespace std;
string s;
int f[maxn][3], n;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
// freopen("in.txt","r",stdin);
cin >> s;
n = s.length();
for (int i = 0; i < n; i++)
for (int k = 0; k < 3; k++)
f[i][k] = -1;
f[0][0] = 0;
f... | #include <bits/stdc++.h>
#define maxn 200100
using namespace std;
string s;
int f[maxn][3], n;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
// freopen("in.txt","r",stdin);
cin >> s;
n = s.length();
for (int i = 0; i < n; i++)
for (int k = 0; k < 3; k++)
f[i][k] = -1;
f[0][0] = 0;
... | replace | 1 | 2 | 1 | 2 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | replace | 19 | 20 | 19 | 20 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p02939 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;
using namespace std;
... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;
using namespace std;
... | replace | 53 | 54 | 53 | 54 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define debug(var) \
do { ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define debug(var) \
do { ... | replace | 47 | 48 | 47 | 48 | 0 | |
p02939 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define MAXN 100000
#define LL long long
LL read() {
LL x = 0, F = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
F = -1;
c = getchar();
}
whil... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
#define MAXN 200000
#define LL long long
LL read() {
LL x = 0, F = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
F = -1;
c = getchar();
}
whil... | replace | 7 | 8 | 7 | 8 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int INF = 1 << 29;
int main() {
string s;
cin >> s;
int n = s.length();
int dp[100001][2] =
{}; // dp[i][j] = (s[0,i) について, 分割した一番右の文字列が長さ j+1
// であるような最大分割数)
for (int i = 1; i <= n; i++) {... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int INF = 1 << 29;
int main() {
string s;
cin >> s;
int n = s.length();
int dp[200001][2] =
{}; // dp[i][j] = (s[0,i) について, 分割した一番右の文字列が長さ j+1
// であるような最大分割数)
for (int i = 1; i <= n; i++) {... | replace | 13 | 14 | 13 | 14 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define M 1000000007
#define sz(a) (ll) a.size()
#define pll pair<ll, ll>
#define rep(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define sep(i, a, b) for (ll i = (ll)a; i >= (ll)b; i--)
#define m... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define M 1000000007
#define sz(a) (ll) a.size()
#define pll pair<ll, ll>
#define rep(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define sep(i, a, b) for (ll i = (ll)a; i >= (ll)b; i--)
#define m... | replace | 22 | 23 | 22 | 23 | 0 | |
p02939 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
const int inf = 1012345678;
int dp[100009][5];
int main() {
string s;
cin >> s;
int n = s.size();
for (int i = 0; i <= n; ++i) {
for (int j = 1; j <= 4; ++j) {
dp[i][j] = -inf;
}
}
for (int i = 1; i <= n; ++i) {
... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
const int inf = 1012345678;
int dp[200009][5];
int main() {
string s;
cin >> s;
int n = s.size();
for (int i = 0; i <= n; ++i) {
for (int j = 1; j <= 4; ++j) {
dp[i][j] = -inf;
}
}
for (int i = 1; i <= n; ++i) {
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int n;
char s[N + 5];
int main() {
scanf("%s", s);
n = strlen(s);
vector<int> a;
int j = 0;
for (int i = 0; i < n; ++i) {
if (i && s[i] != s[i - 1])
a.push_back(j), j = 1;
else
++j;
}
a.push_back(j);
int ans = 0... | #include <bits/stdc++.h>
using namespace std;
const int N = 200000;
int n;
char s[N + 5];
int main() {
scanf("%s", s);
n = strlen(s);
vector<int> a;
int j = 0;
for (int i = 0; i < n; ++i) {
if (i && s[i] != s[i - 1])
a.push_back(j), j = 1;
else
++j;
}
a.push_back(j);
int ans = 0... | replace | 3 | 4 | 3 | 4 | 0 | |
p02939 | Python | Runtime Error | from sys import stdin
def main():
S = stdin.readline().rstrip()
S_len = len(S)
sum = 0
s = S[0]
x = 1
while True:
if len(s) == 1:
if s == S[x]:
s = s + S[x]
else:
sum += 1
s = S[x]
else:
sum +... | from sys import stdin
def main():
S = stdin.readline().rstrip()
S_len = len(S)
sum = 0
s = S[0]
x = 1
while True:
if len(s) == 1:
if s == S[x]:
s = s + S[x]
else:
sum += 1
s = S[x]
else:
sum +... | insert | 21 | 21 | 21 | 24 | 0 | |
p02939 | Python | Runtime Error | # https://atcoder.jp/contests/agc037/tasks/agc037_a
s = input()
ans = 0
pre = s[0]
i = 0
while i < len(s):
cur = s[i]
if pre == cur:
pre = s[i] + s[i + 1]
i += 2
else:
pre = cur
i += 1
ans += 1
print(ans)
| # https://atcoder.jp/contests/agc037/tasks/agc037_a
s = input()
ans = 0
pre = ""
cur = ""
for i in range(len(s)):
pre += s[i]
if pre != cur:
ans += 1
cur = pre
pre = ""
print(ans)
| replace | 5 | 16 | 5 | 13 | 0 | |
p02939 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef pair<int, int> P;
typedef long long ll;
const int INF = 100000000;
int dfs(string S, string s_pre, string s_post, int i) {
if (i == S.size()) {
return 0;
} else {
s_... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
typedef pair<int, int> P;
typedef long long ll;
const int INF = 100000000;
int dfs(string &S, string &s_pre, string &s_post, int i) {
if (i == S.size()) {
return 0;
} else {
... | replace | 8 | 9 | 8 | 9 | TLE | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);
string S;
int dp[220... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);
string S;
int dp[220... | replace | 35 | 36 | 35 | 36 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef pair<int, int> pii;
const int MN = 1e5 + 5;
int N, D[MN][2];
string S;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> S;
int N = S.size();
D[0][1] = 1;
D[0][2] = -1e9;
D[1][1] = -1e9;
if (S[0] != S[1])... | #include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef pair<int, int> pii;
const int MN = 2e5 + 5;
int N, D[MN][2];
string S;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> S;
int N = S.size();
D[0][1] = 1;
D[0][2] = -1e9;
D[1][1] = -1e9;
if (S[0] != S[1])... | replace | 5 | 6 | 5 | 6 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long double ld;
typedef long long ll;
const int max_n = 100011, max_m = 500011, inf = 1000111222;
const ll inff = 1000111222333444;
int dp[2][max_n];
int n;
int main() {
// freopen("input.txt", "r", stdin);
// freopen("outpu... | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long double ld;
typedef long long ll;
const int max_n = 200011, max_m = 500011, inf = 1000111222;
const ll inff = 1000111222333444;
int dp[2][max_n];
int n;
int main() {
// freopen("input.txt", "r", stdin);
// freopen("outpu... | replace | 9 | 10 | 9 | 10 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
... | replace | 21 | 22 | 21 | 22 | 0 | |
p02939 | C++ | Runtime Error | /**
* author: bholuakku
**/
#include <bits/stdc++.h>
#define Endl cout << "\n"
#define Test cout << "Hello\n"
using namespace std;
using ll = long long;
int main() {
#ifndef ONLINE_JUDGE
freopen("C:\\Users\\ACER\\Desktop\\Codes\\input.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL... | /**
* author: bholuakku
**/
#include <bits/stdc++.h>
#define Endl cout << "\n"
#define Test cout << "Hello\n"
using namespace std;
using ll = long long;
int main() {
#ifndef ONLINE_JUDGE
// freopen("C:\\Users\\ACER\\Desktop\\Codes\\input.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(N... | replace | 13 | 14 | 13 | 14 | 0 | |
p02939 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define abdelrahman010 \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
typedef lo... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define abdelrahman010 \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
typedef lo... | replace | 14 | 21 | 14 | 16 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FASTIO
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();
template <typename T1, typename T2>... | #include <bits/stdc++.h>
#define FASTIO
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();
template <typename T1, typename T2>... | replace | 62 | 63 | 62 | 63 | 0 | |
p02939 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
#d... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
#d... | replace | 21 | 22 | 21 | 22 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = a; i > n; i--)
#define leng(n) (int)(log10(n) + 1)
#define INF 9000000000000000000
using namespace std;
int gcd(int a, int b) { r... | #include <bits/stdc++.h>
#define int long long
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = a; i > n; i--)
#define leng(n) (int)(log10(n) + 1)
#define INF 9000000000000000000
using namespace std;
int gcd(int a, int b) { r... | replace | 40 | 45 | 40 | 47 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #pragma GCC optimize("O3")
// #pragma GCC target("sse4")
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i >= (a); --i)
#define ITER(it, a) \
for (__typeof(a.beg... | #include <bits/stdc++.h>
using namespace std;
// #pragma GCC optimize("O3")
// #pragma GCC target("sse4")
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i >= (a); --i)
#define ITER(it, a) \
for (__typeof(a.beg... | replace | 24 | 25 | 24 | 25 | 0 | |
p02939 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
long long int cnt = 1;
char cur = s[0];
int i = 1;
while (1) {
if (s[i] != cur) {
cur = s[i];
cnt++;
i++;
... | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
long long int cnt = 1;
char cur = s[0];
int i = 1;
while (1) {
if (s[i] != cur) {
cur = s[i];
cnt++;
i++;
... | insert | 34 | 34 | 34 | 37 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
int main() {
string s;
cin >> s;
int ret = 0;
if (s.size() == 1) {
ret = 1;
} else if (s.size() == 2 && s[0] == s[1]) {
ret = 1;
} else if (s.size() == 2 && s[0] != s[1]) {
ret = 2;
} else {
string bef = "";
while (true... | #include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
int main() {
string s;
cin >> s;
int ret = 0;
if (s.size() == 1) {
ret = 1;
} else if (s.size() == 2 && s[0] == s[1]) {
ret = 1;
} else if (s.size() == 2 && s[0] != s[1]) {
ret = 2;
} else {
string bef = "";
while (true... | replace | 18 | 20 | 18 | 22 | 0 | |
p02939 | C++ | Runtime Error | /**
* Name: Ajay
* Institute: IIITH
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string.h>
#include <vector>
#define ll long long
#define inf 0x7ffff... | /**
* Name: Ajay
* Institute: IIITH
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string.h>
#include <vector>
#define ll long long
#define inf 0x7ffff... | delete | 46 | 47 | 46 | 46 | 0 | |
p02939 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
int len, ans;
char S[100100];
int main() {
scanf("%s", S + 1);
len = strlen(S + 1);
int now = 1;
while (now <= len) {
ans++, now++;
while (S[now] != S[now - 1] && now <= len)
ans++, now++;
if (now >= len)
break;
ans++, now += 2;
}
printf("%d\n... | #include <cstdio>
#include <cstring>
int len, ans;
char S[200100];
int main() {
scanf("%s", S + 1);
len = strlen(S + 1);
int now = 1;
while (now <= len) {
ans++, now++;
while (S[now] != S[now - 1] && now <= len)
ans++, now++;
if (now >= len)
break;
ans++, now += 2;
}
printf("%d\n... | replace | 3 | 4 | 3 | 4 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#define GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, NAME, ...) NAME
#define pr(...) \
cerr << GET_MACRO(__VA_ARGS__, pr8, pr7, pr6, pr5, pr4, pr3, pr2, \
pr1)(__VA_ARGS__) ... | #include <bits/stdc++.h>
#define GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, NAME, ...) NAME
#define pr(...) \
cerr << GET_MACRO(__VA_ARGS__, pr8, pr7, pr6, pr5, pr4, pr3, pr2, \
pr1)(__VA_ARGS__) ... | replace | 56 | 57 | 56 | 57 | 0 | |
p02939 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
cout << setprecision(15);
char s[2000000];
scanf("%s", s);
int ans = 0;
const int n = strlen(s);
for (int length = 1; length < n; ++length) {
if (n - length <= ans)
break;
int prev_length = length;
int count ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
cout << setprecision(15);
char s[2000000];
scanf("%s", s);
int ans = 0;
const int n = strlen(s);
for (int length = 1; length <= 2; ++length) {
if (n - length <= ans)
break;
int prev_length = length;
int count... | replace | 10 | 11 | 10 | 11 | TLE | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#if !ONLINE_JUDGE
#define debug
#endif
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#if !ONLINE_JUDGE
#define debug
#endif
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/... | replace | 127 | 128 | 127 | 128 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string s;
void Process() {
int i = 0, cou = 0, state = 0;
while (i <= s.length() - 1) {
if (s[i] == s[i + 1]) {
if (state == 0) {
i += 2;
state = 1;
} else {
state = 0;
i++;
}
} else {
i++;
state ... | #include <bits/stdc++.h>
using namespace std;
string s;
void Process() {
int i = 0, cou = 0, state = 0;
while (i <= s.length() - 1) {
if (s[i] == s[i + 1]) {
if (state == 0) {
i += 2;
state = 1;
} else {
state = 0;
i++;
}
} else {
i++;
state ... | replace | 36 | 37 | 36 | 37 | -11 | |
p02939 | C++ | Time Limit Exceeded | // #pragma GCC optimize ('O3')
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef long double ld;
#define mp make_pair
#define f first
#define s second
#define pb push_back
const int N = 2e5 + 5;
const int M = 17 + 5;
const int W = 1000 + 5;
const int OO = 1e9;
const... | // #pragma GCC optimize ('O3')
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef long double ld;
#define mp make_pair
#define f first
#define s second
#define pb push_back
const int N = 2e5 + 5;
const int M = 17 + 5;
const int W = 1000 + 5;
const int OO = 1e9;
const... | insert | 31 | 31 | 31 | 33 | TLE | |
p02939 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i, a, b) for (int i = a; i <= (int)(b); i++)
#define ALL(x) begin(x), end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
template <class T> inline bool chmax(... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i, a, b) for (int i = a; i <= (int)(b); i++)
#define ALL(x) begin(x), end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
template <class T> inline bool chmax(... | replace | 31 | 32 | 31 | 32 | TLE | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
#define gc getchar //_unlocked
#define pc putchar //_unlocked
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define pp pair<int, ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
#define gc getchar //_unlocked
#define pc putchar //_unlocked
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define pp pair<int, ... | replace | 73 | 74 | 73 | 74 | 0 | |
p02939 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using edge = pair<ll, P>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++)
#define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--)
using Graph = vector<vector<ll>>;
cons... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using edge = pair<ll, P>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++)
#define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--)
using Graph = vector<vector<ll>>;
cons... | replace | 23 | 24 | 23 | 24 | 0 | |
p02940 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define zerol
using LL = long long;
#define FOR(i, x, y) \
for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) \
for ... | #include <bits/stdc++.h>
using namespace std;
#define zerol
using LL = long long;
#define FOR(i, x, y) \
for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) \
for ... | replace | 33 | 34 | 33 | 34 | 0 | |
p02940 | C++ | Runtime Error | // marico el que lo lea
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vec... | // marico el que lo lea
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vec... | replace | 120 | 121 | 120 | 121 | 0 | |
p02940 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, mod = 998244353;
typedef long long ll;
int n, f[1 << 3];
char s[N];
int main() {
scanf("%d", &n);
f[0] = n;
scanf("%s", s + 1);
ll ans = 1;
for (int l = 1; l <= n * 3; l++) {
int t = 0;
if (s[l] == 'R')
t = 1;
if (s[l] == '... | #include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, mod = 998244353;
typedef long long ll;
int n, f[1 << 3];
char s[N];
int main() {
scanf("%d", &n);
f[0] = n;
scanf("%s", s + 1);
ll ans = 1;
for (int l = 1; l <= n * 3; l++) {
int t = 0;
if (s[l] == 'R')
t = 1;
if (s[l] == '... | replace | 2 | 3 | 2 | 3 | 0 | |
p02940 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
#define ll long long
#define mp make_pair
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define Time (doubl... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
#define ll long long
#define mp make_pair
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define Time (doubl... | replace | 14 | 15 | 14 | 15 | 0 | |
p02940 | C++ | Runtime Error | // 08:09~
#include <bits/stdc++.h>
using namespace std;
template <uint32_t mod> class modint {
uint64_t value;
public:
constexpr modint(const int64_t x = 0) noexcept
: value(x % mod + (x < 0 ? mod : 0)) {}
constexpr explicit operator uint64_t() const noexcept { return value; }
constexpr modint inverse()... | // 08:09~
#include <bits/stdc++.h>
using namespace std;
template <uint32_t mod> class modint {
uint64_t value;
public:
constexpr modint(const int64_t x = 0) noexcept
: value(x % mod + (x < 0 ? mod : 0)) {}
constexpr explicit operator uint64_t() const noexcept { return value; }
constexpr modint inverse()... | replace | 90 | 91 | 90 | 91 | 0 | |
p02940 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ss(x) (int)x.size()
#define cat(x) cerr << #x << " = " << x << endl
#define rep(i, j, n) for (int i = j; i <= n; ++i)
#define per(i, j, n) for (int i = n; j <= i; --i)
using ll = long long;
using namespace std... | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ss(x) (int)x.size()
#define cat(x) cerr << #x << " = " << x << endl
#define rep(i, j, n) for (int i = j; i <= n; ++i)
#define per(i, j, n) for (int i = n; j <= i; --i)
using ll = long long;
using namespace std... | replace | 13 | 14 | 13 | 14 | 0 | |
p02940 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;
template <class T> void read(T &x) {
x = 0;
int f = 1, ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 1... | #include <cstdio>
#include <iostream>
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;
template <class T> void read(T &x) {
x = 0;
int f = 1, ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 1... | replace | 22 | 23 | 22 | 23 | 0 | |
p02940 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define fornum(A, B, C) for (A = B; A < C; A++)
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
/////////////////////////////////////////////////////
#define MOD 998244353ll
char S[303030];
ll N, N3, rgb[5];
ll Fa[303030];
ll... | #include <bits/stdc++.h>
#define ll long long
#define fornum(A, B, C) for (A = B; A < C; A++)
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
/////////////////////////////////////////////////////
#define MOD 998244353ll
char S[303030];
ll N, N3, rgb[303030];
ll Fa[303030... | replace | 13 | 14 | 13 | 14 | 0 | |
p02940 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#define mod 998244353
#define MN 101000
int n, cnt[8];
char s[MN];
int main() {
scanf("%d", &n);
scanf("%s", s + 1);
int ans = 1;
for (int i = 1; i <= n; i++)
ans = 1ll * ans * i % mod;
for (int i = 1; i <= 3 * n; i++) {
int x;
if (s[i] == 'R')
x = 1;... | #include <cstdio>
#include <iostream>
#define mod 998244353
#define MN 301000
int n, cnt[8];
char s[MN];
int main() {
scanf("%d", &n);
scanf("%s", s + 1);
int ans = 1;
for (int i = 1; i <= n; i++)
ans = 1ll * ans * i % mod;
for (int i = 1; i <= 3 * n; i++) {
int x;
if (s[i] == 'R')
x = 1;... | replace | 3 | 4 | 3 | 4 | 0 | |
p02940 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define db long double
#define ii pair<int, int>
#define vi vector<int>
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define a... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define db long double
#define ii pair<int, int>
#define vi vector<int>
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define a... | replace | 57 | 58 | 57 | 58 | 0 | |
p02940 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 998244353;
char s[100005];
int n, cnt[3];
int main() {
while (~scanf("%d", &n)) {
ll ans = 1;
scanf("%s", s + 1);
for (int i = 1; i <= n * 3; i++) { // 思路填满再说
int x[3], _x[3];
x[0] = cnt[0], x[1] = cnt[1], x[2]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 998244353;
char s[300005];
int n, cnt[3];
int main() {
while (~scanf("%d", &n)) {
ll ans = 1;
scanf("%s", s + 1);
for (int i = 1; i <= n * 3; i++) { // 思路填满再说
int x[3], _x[3];
x[0] = cnt[0], x[1] = cnt[1], x[2]... | replace | 4 | 5 | 4 | 5 | 0 | |
p02940 | C++ | Runtime Error | /*Lucky_Glass*/
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
const int N = 1e5, MOD = 998244353;
int n;
char str[N + 3];
struct MODNUM {
int num;
MODNUM() {}
MODNUM(int _n) : num(_n) {}
MODNUM operator*(const MODNUM B) { return 1ll * num * B.num % MOD; }
MODNUM operator+(c... | /*Lucky_Glass*/
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
const int N = 1e5, MOD = 998244353;
int n;
char str[3 * N + 3];
struct MODNUM {
int num;
MODNUM() {}
MODNUM(int _n) : num(_n) {}
MODNUM operator*(const MODNUM B) { return 1ll * num * B.num % MOD; }
MODNUM operato... | replace | 9 | 10 | 9 | 10 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.