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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02942 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 205, M = 20005, inf = 0x3f3f3f3f, INF = 0x7fffffff;
int read() {
int f = 1, g = 0;
char ch = getchar();
for (; !isdigit(ch); ch = getchar())
if (ch == '-')
f = -1;
for (; isdigit(ch); ch = getchar())
g = g * 10 + ch ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 205, M = 21005, inf = 0x3f3f3f3f, INF = 0x7fffffff;
int read() {
int f = 1, g = 0;
char ch = getchar();
for (; !isdigit(ch); ch = getchar())
if (ch == '-')
f = -1;
for (; isdigit(ch); ch = getchar())
g = g * 10 + ch ... | replace | 3 | 4 | 3 | 4 | 0 | 3
3
|
p02942 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int N = 105;
int a[N][N], n, m;
bool was[N][N];
void rot(int x) {
int tmp = a[x][1];
for (int i = 2; i <= m; i++)
a[x][i - 1] = a[x][i];
a[x][m] = tmp;
}
void SolveRow(int x) {
sort(a[x] + 1, a[x] + 1 + m);
int cnt = 0;
while (1) {... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int N = 105;
int a[N][N], n, m;
bool was[N][N];
void rot(int x) {
int tmp = a[x][1];
for (int i = 2; i <= m; i++)
a[x][i - 1] = a[x][i];
a[x][m] = tmp;
}
void SolveRow(int x) {
sort(a[x] + 1, a[x] + 1 + m);
int cnt = 0;
while (1) {... | replace | 58 | 59 | 58 | 59 | 0 | |
p02942 | C++ | Runtime Error | #include <bits/stdc++.h>
#define XX first
#define YY second
#define pb emplace_back
#define FOR(i, a, b) for (int(i) = (a); i < (b); ++(i))
#define EFOR(i, a, b) for (int(i) = (a); i <= (b); ++(i))
#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define REP rep
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(... | #include <bits/stdc++.h>
#define XX first
#define YY second
#define pb emplace_back
#define FOR(i, a, b) for (int(i) = (a); i < (b); ++(i))
#define EFOR(i, a, b) for (int(i) = (a); i <= (b); ++(i))
#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define REP rep
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(... | replace | 39 | 40 | 39 | 40 | 0 | |
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int n, k, st = 0, ed;
cin >> n >> k >> s;
if (k > 30 || (1 << (k - 1)) >= n) {
cout << string(n, *min_element(s.begin(), s.end())) << "\n";
return 0;
}
string S = s;
reverse(S.begin(), S.end());
string T = s + S;
for (int i =... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int n, k, st = 0, ed;
cin >> n >> k >> s;
if (k > 30 || (1 << (k - 1)) >= n) {
cout << string(n, *min_element(s.begin(), s.end())) << "\n";
return 0;
}
string S = s;
reverse(S.begin(), S.end());
string T = s + S;
for (int i =... | replace | 18 | 19 | 18 | 19 | 0 | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define lld long double
#define MOD 998244353LL
#define CAP 10000000
#define inf 1000000000000000000LL
#define pii pair<ll, ll>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define sz(v) v.size()
#define all(v) v.begin(), v.en... | #include <bits/stdc++.h>
#define ll long long
#define lld long double
#define MOD 998244353LL
#define CAP 10000000
#define inf 1000000000000000000LL
#define pii pair<ll, ll>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define sz(v) v.size()
#define all(v) v.begin(), v.en... | replace | 70 | 71 | 70 | 71 | TLE | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
re... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
re... | replace | 94 | 95 | 94 | 95 | TLE | |
p02943 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#define _USE_MATH_DEFINES
#include <complex>
#include <functional>
#include <math.h>
using namespace std;
#define rep(i, x) for (ll i = 0; i < x; i++)
#define r... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#define _USE_MATH_DEFINES
#include <complex>
#include <functional>
#include <math.h>
using namespace std;
#define rep(i, x) for (ll i = 0; i < x; i++)
#define r... | replace | 159 | 160 | 159 | 160 | TLE | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i))
#define eFOR(i, a, n) fo... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i))
#define eFOR(i, a, n) fo... | insert | 114 | 114 | 114 | 116 | TLE | |
p02943 | C++ | Runtime Error | //////////////////////////////////////////// _LeMur_
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath... | //////////////////////////////////////////// _LeMur_
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath... | replace | 28 | 29 | 28 | 29 | 0 | |
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
string s, ss, s2, t, ans, ff;
vector<pii> v;
int n, k, i, z, l;
char mn = 127;
int main() {
freopen("1", "r", stdin);
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k >> s;
ss = s;
reverse(ss.begin(), ss.end());
ss = s + ss;
for... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
string s, ss, s2, t, ans, ff;
vector<pii> v;
int n, k, i, z, l;
char mn = 127;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k >> s;
ss = s;
reverse(ss.begin(), ss.end());
ss = s + ss;
for (char c : s)
mn = min(m... | delete | 8 | 9 | 8 | 8 | -11 | |
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
#define LL long long
#define pii pair<int, int>
using namespace std;
const int inf = 2147483647;
const int N = 20001;
int _max(int x, int y) { return x > y ? x : y; }
int _min(int x, int y) { return x < y ? x : y; }
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (ch < ... | #include <bits/stdc++.h>
#define LL long long
#define pii pair<int, int>
using namespace std;
const int inf = 2147483647;
const int N = 20001;
int _max(int x, int y) { return x > y ? x : y; }
int _min(int x, int y) { return x < y ? x : y; }
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (ch < ... | replace | 31 | 32 | 31 | 32 | 0 | |
p02943 | C++ | Time Limit Exceeded | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
constexpr long long INF = 1LL << 60;
constexpr long long MOD = 1000000007;
double PI = acos(-1.0);
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define r... | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
constexpr long long INF = 1LL << 60;
constexpr long long MOD = 1000000007;
double PI = acos(-1.0);
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define r... | replace | 205 | 206 | 205 | 206 | TLE | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin >>
#define Z class
#define ll long long
#define ln cout << '\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n", a)
#define mem(a) memset(a, 0, sizeof(a))
#define all(c) (c).begin(), (c).end()
... | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin >>
#define Z class
#define ll long long
#define ln cout << '\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n", a)
#define mem(a) memset(a, 0, sizeof(a))
#define all(c) (c).begin(), (c).end()
... | replace | 225 | 226 | 225 | 226 | TLE | |
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
char S[5555];
int n, m, k;
int main() {
int i, j;
scanf("%d%d%s", &n, &k, S);
for (i = 0; i < n; i++) {
S[n + i] = S[n - i - 1];
}
for (i = 0, m = 0; i <= n; i++) {
for (j = 0; j < n; j++) {
if (S[i + j] != S[m + j]) {
if (S[i + j] < S[... | #include <bits/stdc++.h>
using namespace std;
char S[10101];
int n, m, k;
int main() {
int i, j;
scanf("%d%d%s", &n, &k, S);
for (i = 0; i < n; i++) {
S[n + i] = S[n - i - 1];
}
for (i = 0, m = 0; i <= n; i++) {
for (j = 0; j < n; j++) {
if (S[i + j] != S[m + j]) {
if (S[i + j] < S... | replace | 4 | 5 | 4 | 5 | 0 | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
s.resize(2 * s.size());
for (int i = 0; i < n; i++) {
s[2 * n - 1 - i] = s[i];
}
string mi, m;
mi.resize(1e6);
m.resize(1e6);
for (int i = 0; i < 1e6; i++) {
mi[i] = 'z';
m[i] = '... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
s.resize(2 * s.size());
for (int i = 0; i < n; i++) {
s[2 * n - 1 - i] = s[i];
}
string mi, m;
mi.resize(1e6);
m.resize(1e6);
for (int i = 0; i < 1e6; i++) {
mi[i] = 'z';
m[i] = '... | replace | 39 | 40 | 39 | 40 | TLE | |
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 10;
char s[maxn], res[maxn];
char c;
int n, k, len[maxn], mx;
bool check(int p) {
for (int i = 1; i <= n; i++)
if (s[i + p - 1] > res[i])
return false;
else if (s[i + p - 1] < res[i])
return true;
return false;
}
int main() {
... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
char s[maxn], res[maxn];
char c;
int n, k, len[maxn], mx;
bool check(int p) {
for (int i = 1; i <= n; i++)
if (s[i + p - 1] > res[i])
return false;
else if (s[i + p - 1] < res[i])
return true;
return false;
}
int main() {
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02943 | C++ | Time Limit Exceeded | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author majk
*/
#ifndef MAJK_LIB
#define MAJK_LIB
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#includ... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author majk
*/
#ifndef MAJK_LIB
#define MAJK_LIB
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#includ... | replace | 344 | 345 | 344 | 345 | TLE | |
p02943 | C++ | Runtime Error | // minamoto
#include <bits/stdc++.h>
#define R register
#define fp(i, a, b) for (R int i = (a), I = (b) + 1; i < I; ++i)
#define fd(i, a, b) for (R int i = (a), I = (b)-1; i > I; --i)
#define go(u) for (int i = head[u], v = e[i].v; i; i = e[i].nx, v = e[i].v)
template <class T> inline bool cmax(T &a, const T &b) {
re... | // minamoto
#include <bits/stdc++.h>
#define R register
#define fp(i, a, b) for (R int i = (a), I = (b) + 1; i < I; ++i)
#define fd(i, a, b) for (R int i = (a), I = (b)-1; i > I; --i)
#define go(u) for (int i = head[u], v = e[i].v; i; i = e[i].nx, v = e[i].v)
template <class T> inline bool cmax(T &a, const T &b) {
re... | replace | 13 | 14 | 13 | 14 | 0 | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int N, K;
cin >> N >> K;
string S;
cin >> S;
string ans = S;
string T(S.rbegin(), S.rend());
string U = S + T;
char a = *min_element(S.begin(), S.end());
if (K == 1) {
for (int i ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int N, K;
cin >> N >> K;
string S;
cin >> S;
string ans = S;
string T(S.rbegin(), S.rend());
string U = S + T;
char a = *min_element(S.begin(), S.end());
if (K == 1) {
for (int i ... | insert | 29 | 29 | 29 | 31 | TLE | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, k;
cin >> n >> k;
string s;
cin >> s;
for (int i = 0; i < k; ++i) {
string t = s;
reverse(t.begin(), t.end());
string x = s + t;
vector<string> tmp;
for (int i = 0; i ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, k;
cin >> n >> k;
string s;
cin >> s;
for (int i = 0; i < k; ++i) {
if (*min_element(s.begin(), s.end()) == *max_element(s.begin(), s.end())) {
break;
}
string t = s;
... | insert | 15 | 15 | 15 | 18 | TLE | |
p02943 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
const int N = 5005;
int n, k;
string s;
int main() {
// freopen("data.in","r",stdin);
// freopen("data.out","w",stdout);
cin >> n >> k;
cin >> s;
char c = 'z' + 1;
int L = 0, R = 0;
string tmp;
for (int i = 0; i <= n; i++)
... | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
const int N = 5005;
int n, k;
string s;
int main() {
// freopen("data.in","r",stdin);
// freopen("data.out","w",stdout);
cin >> n >> k;
cin >> s;
char c = 'z' + 1;
int L = 0, R = 0;
string tmp;
for (int i = 0; i <= n; i++)
... | insert | 90 | 90 | 90 | 92 | TLE | |
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 5005;
char s[N];
int p[N];
signed main() {
int n, K;
long long res = 1;
cin >> n >> K;
for (int i = 2; i <= K; ++i) {
res *= 2;
if (res >= n) {
res = n;
break;
}
}
cin >> (s + 1);
for (int i = n + 1; i <= n + n; ++i)
s... | #include <bits/stdc++.h>
using namespace std;
const int N = 10005;
char s[N];
int p[N];
signed main() {
int n, K;
long long res = 1;
cin >> n >> K;
for (int i = 2; i <= K; ++i) {
res *= 2;
if (res >= n) {
res = n;
break;
}
}
cin >> (s + 1);
for (int i = n + 1; i <= n + n; ++i)
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int max_n = 5555, inf = 1000111222;
int n, k;
string s;
string getr(const string &s, int pos, int mx) {
if (mx + (mx << k) >= n) {
return "";
}
// cout << "$" << mx << endl;
return {s.rbegin() + s.length() - 1 - pos + mx,
s.rbegin() + s.lengt... | #include <bits/stdc++.h>
using namespace std;
const int max_n = 5555, inf = 1000111222;
int n, k;
string s;
string getr(const string &s, int pos, int mx) {
if (mx + (mx << k) >= n) {
return "";
}
// cout << "$" << mx << endl;
return {s.rbegin() + s.length() - 1 - pos + mx,
s.rbegin() + s.lengt... | replace | 30 | 31 | 30 | 31 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 1) > this->size() (which is 0)
|
p02943 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 10;
int n, k, L[N];
string s;
int main() {
cin >> n >> k >> s;
char mn = *min_element(s.begin(), s.end());
string t = s;
reverse(t.begin(), t.end());
t = s + t;
for (int i = 0; i < n + n; i++) {
if (i && t[i] == mn)
L[i] = L[i - 1... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
int n, k, L[N];
string s;
int main() {
cin >> n >> k >> s;
char mn = *min_element(s.begin(), s.end());
string t = s;
reverse(t.begin(), t.end());
t = s + t;
for (int i = 0; i < n + n; i++) {
if (i && t[i] == mn)
L[i] = L[i - 1... | replace | 2 | 3 | 2 | 3 | 0 | |
p02943 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | replace | 225 | 226 | 225 | 226 | TLE | |
p02943 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
#define ggr ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
#define ggr ... | replace | 146 | 147 | 146 | 147 | TLE | |
p02944 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pb emplace_back
#define X first
#define Y second
const int N = 2e5 + 5;
typedef pair<int, int> ii;
int a[N], t[N];
int f1[N], f2[N];
int s1[N], s2[N];
int pr... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pb emplace_back
#define X first
#define Y second
const int N = 5e6 + 5;
typedef pair<int, int> ii;
int a[N], t[N];
int f1[N], f2[N];
int s1[N], s2[N];
int pr... | replace | 14 | 15 | 14 | 15 | 0 | |
p02945 | Python | Runtime Error | A, B = int(input().split())
list = []
list.append(A + B)
list.append(A - B)
list.append(A * B)
print(max(list))
| A, B = map(int, input().split())
list = []
list.append(A + B)
list.append(A - B)
list.append(A * B)
print(max(list))
| replace | 0 | 1 | 0 | 1 | TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02945/Python/s147643407.py", line 1, in <module>
A, B = int(input().split())
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'
|
p02945 | Python | Runtime Error | a, b = input("").split("")
seki = int(a) * int(b)
sa = int(a) - int(b)
wa = int(a) + int(b)
if wa >= seki and wa >= sa:
print(wa)
elif sa >= wa and sa >= seki:
print(sa)
else:
print(seki)
| a, b = input().split()
seki = int(a) * int(b)
sa = int(a) - int(b)
wa = int(a) + int(b)
if wa >= seki and wa >= sa:
print(wa)
elif sa >= wa and sa >= seki:
print(sa)
else:
print(seki)
| replace | 0 | 1 | 0 | 1 | ValueError: empty separator | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02945/Python/s989854046.py", line 1, in <module>
a, b = input(""). split("")
ValueError: empty separator
|
p02945 | Python | Runtime Error | A = int(input())
B = int(input())
c = A + B
d = A - B
e = A * B
f = [c, d, e]
maxvalue = c
for i in range(len(f)):
if f[i] > maxvalue:
maxvalue = f[i]
print(maxvalue)
| A, B = map(int, input().split())
c = A + B
d = A - B
e = A * B
f = [c, d, e]
maxvalue = c
for i in range(len(f)):
if f[i] > maxvalue:
maxvalue = f[i]
print(maxvalue)
| replace | 0 | 2 | 0 | 1 | ValueError: invalid literal for int() with base 10: '-13 3' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02945/Python/s027556545.py", line 1, in <module>
A = int(input())
ValueError: invalid literal for int() with base 10: '-13 3'
|
p02945 | Python | Runtime Error | A = int(input())
B = input()
answer = max(
A + B,
A - B,
A * B,
)
print(answer)
| data = input()
data = data.split(" ")
A = int(data[0])
B = int(data[1])
answer = max(
A + B,
A - B,
A * B,
)
print(answer)
| replace | 0 | 2 | 0 | 5 | ValueError: invalid literal for int() with base 10: '-13 3' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02945/Python/s283924824.py", line 1, in <module>
A = int(input())
ValueError: invalid literal for int() with base 10: '-13 3'
|
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef int ll;
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define os... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef int ll;
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define os... | replace | 35 | 36 | 35 | 36 | 0 | |
p02945 | C++ | Runtime Error | // Garg's Code
#include <bits/stdc++.h>
using namespace std;
#define set set<ll>
#define ll long long
#define ldb long double;
#define pa pair<ll, ll>
#define map map<ll, ll>
#define vec vector<ll>
#define pb push_back
#define po pop_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#defi... | // Garg's Code
#include <bits/stdc++.h>
using namespace std;
#define set set<ll>
#define ll long long
#define ldb long double;
#define pa pair<ll, ll>
#define map map<ll, ll>
#define vec vector<ll>
#define pb push_back
#define po pop_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#defi... | replace | 36 | 40 | 36 | 40 | 0 | |
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fastIO \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define asc(... | #include <bits/stdc++.h>
using namespace std;
#define fastIO \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define asc(... | replace | 65 | 71 | 65 | 66 | 0 | |
p02945 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main(void) {
int A, B;
cin >> A >> B;
int max = -20000;
if (A + B > max)
max = A + B;
if (A - B > max)
max = A - B;
if (A * B > max)
max = A * B;
return max;
} | #include <iostream>
#include <vector>
using namespace std;
int main(void) {
int A, B;
cin >> A >> B;
int max = -20000;
if (A + B > max)
max = A + B;
if (A - B > max)
max = A - B;
if (A * B > max)
max = A * B;
cout << max << endl;
return 0;
} | replace | 15 | 16 | 15 | 18 | 246 | |
p02945 | C++ | Time Limit Exceeded | #include <stdio.h>
int sum(int x, int y) { return x + y; }
int sub(int x, int y) { return x - y; }
int mul(int x, int y) { return x * y; }
int main() {
int a, b, sm, sb, ml, gr;
scanf("%d %d", &a, &b);
sm = sum(a, b);
sb = sub(a, b);
ml = mul(a, b);
if (sm > sb && sm > ml)
gr = sm;
else if (sb > sm &&... | #include <stdio.h>
int sum(int x, int y) { return x + y; }
int sub(int x, int y) { return x - y; }
int mul(int x, int y) { return x * y; }
int main() {
int a, b, sm, sb, ml, gr;
scanf("%d %d", &a, &b);
sm = sum(a, b);
sb = sub(a, b);
ml = mul(a, b);
if (sm > sb && sm > ml)
gr = sm;
else if (sb > sm &&... | delete | 18 | 19 | 18 | 18 | TLE | |
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
freopen("INP.txt", "r", stdin);
freopen("OUT.txt", "w", stdout);
ll a, b;
cin >> a >> b;
cout << max(a + b, max(a - b, a * b)) << '\n';
return ... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("INP.txt", "r", stdin);
// freopen("OUT.txt", "w", stdout);
ll a, b;
cin >> a >> b;
cout << max(a + b, max(a - b, a * b)) << '\n';
r... | replace | 9 | 11 | 9 | 11 | 0 | |
p02945 | Python | Runtime Error | N = int(input())
s = [list(input()) for _ in range(N)]
S = []
for i in range(N):
S.append("".join(sorted(s[i])))
print(S)
cnt = 0
for i in range(N):
cnt += S.count(S[i]) - 1
print(int(cnt / 2))
| A, B = map(int, input().split())
print(max(A + B, A - B, A * B))
| replace | 0 | 11 | 0 | 2 | ValueError: invalid literal for int() with base 10: '-13 3' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02945/Python/s567458637.py", line 1, in <module>
N = int(input())
ValueError: invalid literal for int() with base 10: '-13 3'
|
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
vector<int> V;
V.at(0) = A + B;
V.at(1) = A - B;
V.at(2) = A * B;
sort(V.begin(), V.end());
cout << V.at(2) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
vector<int> V(3);
V.at(0) = A + B;
V.at(1) = A - B;
V.at(2) = A * B;
sort(V.begin(), V.end());
cout << V.at(2) << endl;
}
| replace | 6 | 7 | 6 | 7 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
|
p02945 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
int max(int x, int y) { return (x > y ? x : y); }
int main() {
int a, b;
cin >> a >> b;
int ans = max(a + b, a - b);
ans = max(ans, a * b);
return ans;
}
| #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
using namespace std;
int max(int x, int y) { return (x > y ? x : y); }
int main() {
int a, b;
cin >> a >> b;
int ans = max(a + b, a - b);
ans = max(ans, a * b);
cout << ans;
}
| replace | 12 | 13 | 12 | 13 | 246 | |
p02945 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int a, b;
void solve() {
cin >> a >> b;
cout << max(max(a + b, a - b), a * b) << endl;
}
signed main() {
while (1)
solve();
} | #include <bits/stdc++.h>
using namespace std;
int a, b;
void solve() {
cin >> a >> b;
cout << max(max(a + b, a - b), a * b) << endl;
}
signed main() {
// while(1)
solve();
} | replace | 11 | 13 | 11 | 13 | TLE | |
p02945 | C++ | Runtime Error |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int a, b;
cin >> a >> b;
cout << max(a - b, max(a + b, a * b));
}
|
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
// #ifndef ONLINE_JUDGE
// freopen("input.txt" , "r" , stdin);
// freopen("output.txt" , "w" , stdout);
// #endif
int a, b;
cin >> a >> b;
cout << max(a - b, m... | replace | 10 | 14 | 10 | 14 | 0 | |
p02945 | C++ | Time Limit Exceeded | // #pragma GCC optimize("O3", "unroll-loops")
// #pragma GCC target("avx2")
#include <bits/stdc++.h>
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | // #pragma GCC optimize("O3", "unroll-loops")
// #pragma GCC target("avx2")
#include <bits/stdc++.h>
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | delete | 97 | 101 | 97 | 97 | TLE | |
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define pb push_b... | #include <bits/stdc++.h>
using namespace std;
#define fastio() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define pb push_b... | replace | 36 | 41 | 36 | 42 | 0 | |
p02945 | C++ | Runtime Error | #include <stdio.h>
int main() {
int a, b;
scanf("%d%d", a, b);
int c, d, e;
c = a + b;
d = a - b;
e = a * b;
if (c >= d && c >= e) {
printf("%d", c);
} else if (d > c && d >= e) {
printf("%d", d);
} else {
printf("%d", e);
}
return 0;
} | #include <stdio.h>
int main() {
int a, b;
scanf("%d%d", &a, &b);
int c, d, e;
c = a + b;
d = a - b;
e = a * b;
if (c >= d && c >= e) {
printf("%d", c);
} else if (d > c && d >= e) {
printf("%d", d);
} else {
printf("%d", e);
}
return 0;
} | replace | 3 | 4 | 3 | 4 | -11 | |
p02945 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int A, B, sum, sub, mult;
cin >> A >> B;
while (A <= 100 && A >= -100) {
if (B <= 100 && B >= -100)
continue;
sum = A + B;
sub = A - B;
mult = A * B;
if (sum > sub && sum > mult) {
cout << sum;
break;
} else if (sub >... | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << max(a + b, max(a - b, a * b));
return 0;
} | replace | 4 | 23 | 4 | 8 | TLE | |
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
int X = A + B;
int Y = A - B;
int Z = A * B;
vector<int> vec;
vec = {X, Y, Z};
sort(vec.begin(), vec.end());
cout << vec.at(3) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
int X = A + B;
int Y = A - B;
int Z = A * B;
vector<int> vec;
vec = {X, Y, Z};
sort(vec.begin(), vec.end());
cout << vec.at(2) << endl;
} | replace | 16 | 17 | 16 | 17 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
|
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#define mod 1000000007
#define eps 1e-9
#define PI 3.14159265358979323846
#define F first
#define S second
#define ll long long
#define pb push_back
#define mp make_pair
#define Fr(i, a, b) for (int i = a; i <= b; i++)
#define RF(i, a, b) for (int i = a; i >= b; i--)
#define... | #include <bits/stdc++.h>
#include <iostream>
#define mod 1000000007
#define eps 1e-9
#define PI 3.14159265358979323846
#define F first
#define S second
#define ll long long
#define pb push_back
#define mp make_pair
#define Fr(i, a, b) for (int i = a; i <= b; i++)
#define RF(i, a, b) for (int i = a; i >= b; i--)
#define... | delete | 22 | 25 | 22 | 22 | 0 | |
p02945 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define all(x) (x).begin(), (x).end()
#define SZ(x) (x).size()
#define fir first
#define sec second
void scan() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
using namespace std;
const int maxn = 2e5 + 7;
int a[... | #include <bits/stdc++.h>
#define ll long long
#define all(x) (x).begin(), (x).end()
#define SZ(x) (x).size()
#define fir first
#define sec second
void scan() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
using namespace std;
const int maxn = 2e5 + 7;
int a[... | replace | 20 | 21 | 20 | 21 | 0 | |
p02946 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
// Your code here!
int K, X;
cin >> K >> X;
int c[K];
if (X + K <= 1000000 && X - K >= -1000000) {
for (int i = 0; i < K + K - 1; i++) {
c[i] = X - K + i + 1;
cout << c[i];
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main(void) {
// Your code here!
int K, X;
cin >> K >> X;
int c[100000];
for (int i = 0; i < 2 * K - 1; i++) {
c[i] = X - K + i + 1;
cout << c[i] << " ";
}
return 0;
}
| replace | 6 | 13 | 6 | 10 | 0 | |
p02946 | C++ | Runtime Error | #include <iostream>
using namespace std;
int k;
int x;
int main() {
cin >> k >> x;
int a[k];
for (int i = 0; i < (2 * k - 1); ++i) {
a[i] = x - k + 1 + i;
}
for (int j = 0; j < (2 * k - 1); ++j) {
cout << a[j] << " ";
}
cout << endl;
}
| #include <iostream>
using namespace std;
int k;
int x;
int main() {
cin >> k >> x;
int a[2 * k - 1];
for (int i = 0; i < (2 * k - 1); ++i) {
a[i] = x - k + 1 + i;
}
for (int j = 0; j < (2 * k - 1); ++j) {
cout << a[j] << " ";
}
cout << endl;
}
| replace | 9 | 10 | 9 | 10 | 0 | |
p02946 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, x;
while (cin >> k >> x) {
int s = 0;
if (x - k <= 0)
s = x + k;
int a[200] = {0};
for (int i = x - k + 1 + s; i <= k + s; i++)
a[i] = 1;
for (int i = k + 1 + s; i < k + x + s; i++)
a[i] = 1;
for (int i = x -... | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, x;
while (cin >> k >> x) {
int s = 0;
if (x - k + 1 < 0)
s = -(x - k + 1);
int a[200] = {0};
for (int i = x - k + 1 + s; i <= k + s; i++)
a[i] = 1;
for (int i = k + 1 + s; i < k + x + s; i++)
a[i] = 1;
for (i... | replace | 6 | 8 | 6 | 8 | 0 | |
p02946 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
int main() {
int K, X;
cin >> K >> X;
vec... | #include <bits/stdc++.h>
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
int main() {
int K, X;
cin >> K >> X;
vec... | replace | 13 | 17 | 13 | 16 | 0 | |
p02946 | Python | Runtime Error | import numpy as np
K, X = map(int, input().split())
tmp = X + K
tmp2 = X - K + 1
ans = np.arange(tmp2, tmp)
for i, v in enumerate(ans):
print(f" {v}", end="") if i > 0 else print(f"{v}", end="")
print("")
| import numpy as np
K, X = map(int, input().split())
tmp = X + K
tmp2 = X - K + 1
ans = np.arange(tmp2, tmp)
for i, v in enumerate(ans):
print(" {}".format(v), end="") if i > 0 else print("{}".format(v), end="")
print("")
| replace | 9 | 10 | 9 | 10 | TLE | |
p02946 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
void faster() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
const ll MAXN = 1e6 + 10;
const ll N = 4000 + 10;
const ll MN = 200 + 10;
const ll mod = 1e6;
ll a[M... | #include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
void faster() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
const ll MAXN = 1e6 + 10;
const ll N = 4000 + 10;
const ll MN = 200 + 10;
const ll mod = 1e6;
ll a[M... | delete | 26 | 30 | 26 | 26 | 0 | |
p02946 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, i, e[110];
cin >> a >> b;
c = b - a + 1;
d = b + a;
for (i = 0; i < 2 * a; i++) {
e[i] = c;
c++;
if (c >= d)
break;
}
for (i = 0; i < 2 * a - 1; i++) {
cout << e[i] << " ";
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int a, b, c, d, i, e[1000];
cin >> a >> b;
c = b - a + 1;
d = b + a;
for (i = 0; i < 2 * a; i++) {
e[i] = c;
c++;
if (c >= d)
break;
}
for (i = 0; i < 2 * a - 1; i++) {
cout << e[i] << " ";
}
return 0;
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02946 | C++ | Runtime Error | #include <iostream>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int k, x;
int m, p;
int ans[105];
cin >> k >> x;
m = x - k + 1;
rep(i, k * 2 - 1) {
ans[i] += m + i;
cout << ans[i] << " ";
}
cout << endl;
return 0;
} | #include <iostream>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
int k, x;
int m, p;
int ans[105];
cin >> k >> x;
m = x - k + 1;
rep(i, k * 2 - 1) {
ans[i] = m + i;
cout << ans[i] << " ";
}
cout << endl;
return 0;
} | replace | 12 | 13 | 12 | 13 | 0 | |
p02946 | Python | Runtime Error | k, x = map(int, input().split())
print(" ".join([x for x in range(x - k + 1, x + k)]))
| k, x = map(int, input().split())
print(" ".join([str(i) for i in range(x - k + 1, x + k)]))
| replace | 1 | 2 | 1 | 2 | TypeError: sequence item 0: expected str instance, int found | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02946/Python/s436123405.py", line 2, in <module>
print(' '.join([x for x in range(x - k + 1, x + k)]))
TypeError: sequence item 0: expected str instance, int found
|
p02946 | C++ | Runtime Error | #include <stdio.h>
int main() {
int k, x;
scanf("%d %d", k, x);
for (int i = x - k + 1; i <= x + k - 1; i++) {
printf("%d ", i);
}
printf("\n");
return 0;
} | #include <stdio.h>
int main() {
int k, x;
scanf("%d %d", &k, &x);
for (int i = x - k + 1; i <= x + k - 1; i++) {
printf("%d ", i);
}
printf("\n");
return 0;
} | replace | 4 | 5 | 4 | 5 | -11 | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N, count = 0;
cin >> N;
vector<string> s(N);
for (int i = 0; i < N; i++) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
for (int i = 0; i < N; i++) {
for (int j = i + 1; j < N; j++) {
if (s[i] == s[j]) {... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N, count = 0;
cin >> N;
vector<string> s(N);
for (int i = 0; i < N; i++) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
sort(s.begin(), s.end());
ll huga = 0;
for (int i = 0; i < N - 1; i++) {
if (s[i] == ... | replace | 12 | 17 | 12 | 20 | TLE | |
p02947 | C++ | Runtime Error | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<string> S(N + 1);
for (int i = 0; i < N; i++) {
cin >> S[i];
sort(S[i].begin(), S[i].end());
}
long long ans = 0;
S[N] = ("zzzzzzzzzzz");
sort(S.begin(), S.en... | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<string> S(N + 1);
for (int i = 0; i < N; i++) {
cin >> S[i];
sort(S[i].begin(), S[i].end());
}
long long ans = 0;
S[N] = ("zzzzzzzzzzz");
sort(S.begin(), S.en... | replace | 21 | 22 | 21 | 22 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
// #pragma GCC optimize "-O3"
typedef unsigned long long ull;
typedef unsigned int ui;
typedef unsigned short us;
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll infll = (1ull << 63) - 1, mod = 1e9... | #include <bits/stdc++.h>
// #pragma GCC optimize "-O3"
typedef unsigned long long ull;
typedef unsigned int ui;
typedef unsigned short us;
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll infll = (1ull << 63) - 1, mod = 1e9... | replace | 18 | 20 | 18 | 19 | 0 | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define FOR(i, a, b) for (ll(i) = a; (i) < (b); ++(i))
#define RFOR(i, a, b) for (ll(i) = a; (i) >= (b); --(i))
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define U... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define FOR(i, a, b) for (ll(i) = a; (i) < (b); ++(i))
#define RFOR(i, a, b) for (ll(i) = a; (i) >= (b); --(i))
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define U... | replace | 43 | 54 | 43 | 44 | TLE | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be(), (a).en()
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) // repeat n times
#define REP2(i, s, n) for (in... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be(), (a).en()
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) // repeat n times
#define REP2(i, s, n) for (in... | replace | 64 | 68 | 64 | 65 | 0 | |
p02947 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
const int MAX_N = 1e3 + 10;
int N;
string S[MAX_N];
cin >> N;
for (int i = 0; i < N; ++i) {
string s;
cin >> s;
int a[10];
for (int j = 0; j < 10; ++j) {
a[j] = s[j] - 0;
}
sort(a, a + 1... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
const int MAX_N = 1e5 + 10;
int N;
string S[MAX_N];
cin >> N;
for (int i = 0; i < N; ++i) {
string s;
cin >> s;
int a[10];
for (int j = 0; j < 10; ++j) {
a[j] = s[j] - 0;
}
sort(a, a + 1... | replace | 6 | 7 | 6 | 7 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | #include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | replace | 12 | 13 | 12 | 13 | 0 | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N;
cin >> N;
vector<string> S(N);
for (int i = 0; i < N; i++) {
cin >> S[i];
sort(S[i].begin(), S[i].end());
}
long long cnt = 0;
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j < N; j++) {
if (S[i] == S[j])
... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N;
cin >> N;
vector<string> S(N);
for (int i = 0; i < N; i++) {
cin >> S[i];
sort(S[i].begin(), S[i].end());
}
long long cnt = 0;
unordered_map<string, int> arr{
{"non", 0},
};
for (int i = 0; i < N; i++) {
if (arr... | replace | 13 | 18 | 13 | 23 | TLE | |
p02947 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
#define MX 1000000000
int main(void) {
... | #include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
#define MX 1000000000
int main(void) {
... | replace | 18 | 31 | 18 | 30 | TLE | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
// typedef long double ld;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<int> vi;
typedef vector<pair<int, int>> vii;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
// typedef long double ld;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<int> vi;
typedef vector<pair<int, int>> vii;
... | replace | 88 | 89 | 88 | 93 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init) \
... | #include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init) \
... | insert | 55 | 55 | 55 | 56 | 0 | |
p02947 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#pragma GCC target("avx2,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define __V vector
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define oit o... | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
// #pragma GCC target ("avx2,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define __V vector
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define o... | replace | 2 | 3 | 2 | 3 | 0 | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> s(n);
for (int i = 0; i < n; i++) {
cin >> s.at(i);
sort(s.at(i).begin(), s.at(i).end());
}
long long cnt = 0;
for (int i = 0; i < n - 1; i++)
for (int j = i + 1; j < n; j++)
if (s.at(i) == s.at(j... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> s(n);
for (int i = 0; i < n; i++) {
cin >> s.at(i);
sort(s.at(i).begin(), s.at(i).end());
}
sort(s.begin(), s.end());
long long cnt = 0, x;
for (long long i = 0; i < n - 1; i++) {
x = 1;
while (s.... | replace | 11 | 16 | 11 | 25 | TLE | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define fcin \
ios::sync_with_stdio(false); \
cin.tie(nullptr);
#define inf 0x3f3f3f3f
mt19937 ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define fcin \
ios::sync_with_stdio(false); \
cin.tie(nullptr);
#define inf 0x3f3f3f3f
mt19937 ... | replace | 32 | 37 | 32 | 33 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long
ll gcd(ll a, ll b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
// Function to return LCM of two numbers
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
int main() {
ll n;
cin >> n;
map<string, ll> hash;
string ... | #include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long
ll gcd(ll a, ll b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
// Function to return LCM of two numbers
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
int main() {
ll n;
cin >> n;
map<string, ll> hash;
string ... | replace | 26 | 27 | 26 | 27 | 0 | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, i, j, count = 0;
cin >> n;
string s[n];
for (i = 0; i < n; i++) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
sort(s, s + n);
for (i = 0; i < n; i++) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, i, j, count = 0;
cin >> n;
string s[n];
for (i = 0; i < n; i++) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
sort(s, s + n);
vector<ll> v;
ll temp ... | replace | 15 | 21 | 15 | 29 | TLE | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
vector<string> v;
string s;
int count = 0;
long long result = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s;
sort(s.begin(), s.end());
v.push_back(s);
}
sort(v.begin(), v.end());
for (int i = 0; i < n; i++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
vector<string> v;
string s;
int count = 0;
long long result = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s;
sort(s.begin(), s.end());
v.push_back(s);
}
sort(v.begin(), v.end());
for (int i = 1; i < n; i++) {
... | replace | 20 | 27 | 20 | 25 | TLE | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
int N;
cin >> N;
string s[100010];
for (int i = 0; i < N; i++)
cin >> s[i];
for (int i = 0; i < N; i++)
sort(s[i].begin(), s[i].end());
for (int i = 0; i < N; i++)
sort(s, s + N);
s[N] = "";
LL ans = 0, same =... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
int N;
cin >> N;
string s[100010];
for (int i = 0; i < N; i++)
cin >> s[i];
for (int i = 0; i < N; i++)
sort(s[i].begin(), s[i].end());
sort(s, s + N);
s[N] = "";
LL ans = 0, same = 0;
for (int i = 0; i < N; i++... | replace | 13 | 15 | 13 | 14 | TLE | |
p02947 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> s(n);
for (size_t i = 0; i < n; i++) {
cin >> s.at(i);
sort(s.at(i).begin(), s.at(i).end());
}
sort(s.begin(), s.end());
int64_t ans = 0;
int count = 0;
for (size_t i =... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> s(n);
for (size_t i = 0; i < n; i++) {
cin >> s.at(i);
sort(s.at(i).begin(), s.at(i).end());
}
sort(s.begin(), s.end());
int64_t ans = 0;
int count = 0;
for (size_t i =... | replace | 16 | 17 | 16 | 17 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
|
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
#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 Forr(i, m, n) for (int i = m; i > n; i--)
#de... | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
#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 Forr(i, m, n) for (int i = m; i > n; i--)
#de... | replace | 16 | 20 | 16 | 24 | TLE | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#define ll long long
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#define ll long long
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | replace | 50 | 51 | 50 | 51 | 0 | |
p02947 | C++ | Runtime Error | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
string a[100001];
int n;
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= n; i++) {
sort(a[i].begin(), a[i].end());
}
sort(a + 1, a + n + 1);
long long ans = 0;
long long length = ... | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
string a[500001];
int n;
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= n; i++) {
sort(a[i].begin(), a[i].end());
}
sort(a + 1, a + n + 1);
long long ans = 0;
long long length = ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02947 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <stack>
#include <vector>
#define maxn 200100
using namespace std;
int trie1[maxn][26];
int S1[26 * maxn];
int tot1 = 0;
int in(char *s) {
int root, len;
len = strlen(s);
root = 0;
for (int i =... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <stack>
#include <vector>
#define maxn 2001000
using namespace std;
int trie1[maxn][26];
int S1[26 * maxn];
int tot1 = 0;
int in(char *s) {
int root, len;
len = strlen(s);
root = 0;
for (int i ... | replace | 8 | 9 | 8 | 9 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい
// for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
int main() {
int n;
cin >> n;
vector<string> s(n);
rep(i, n) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
sort(s.begin... | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい
// for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
int main() {
int n;
cin >> n;
vector<string> s(n);
rep(i, n) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
sort(s.begin... | replace | 23 | 24 | 23 | 24 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long co(int x) {
long long y = 0;
for (int i = 1; i <= x - 1; i++) {
y += i;
}
return y;
}
int main() {
int n;
map<string, int> ma;
string s[10000];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
cin >> s[i];
getchar();
sort(s[i].begin... | #include <bits/stdc++.h>
using namespace std;
long long co(int x) {
long long y = 0;
for (int i = 1; i <= x - 1; i++) {
y += i;
}
return y;
}
int main() {
int n;
map<string, int> ma;
string s[100001];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
cin >> s[i];
getchar();
sort(s[i].begi... | replace | 12 | 13 | 12 | 13 | 0 | |
p02947 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <cmath> // 変数名にy1が使えなくなるかも…。
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#in... | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <cmath> // 変数名にy1が使えなくなるかも…。
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#in... | replace | 59 | 60 | 59 | 60 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
#define range 524289
#define mod 1000000007
#define eps 1e-9
#define PI 3.14159265358979323846
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define ALL(V) V.begin(), V.end()
#define _ << " " <<
using namespace std;
typedef long long ll;
t... | #include <bits/stdc++.h>
#define range 524289
#define mod 1000000007
#define eps 1e-9
#define PI 3.14159265358979323846
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define ALL(V) V.begin(), V.end()
#define _ << " " <<
using namespace std;
typedef long long ll;
t... | replace | 25 | 30 | 25 | 30 | TLE | |
p02947 | C++ | Runtime Error | #define _USE_MATH_DEFINES
//
#include <bits/stdc++.h>
//
using namespace std;
//
#define krep(i, k, n) for (int i = k; i < n; ++i)
#define rep(i, n) for (int i = 0; i < n; ++i)
#define toupp(s) transform(s.begin(), s.end(), s.begin(), ::toupper) // string
#define tolow(s) transform(s.begin(), s.end(), s.begin(), ::tolo... | #define _USE_MATH_DEFINES
//
#include <bits/stdc++.h>
//
using namespace std;
//
#define krep(i, k, n) for (int i = k; i < n; ++i)
#define rep(i, n) for (int i = 0; i < n; ++i)
#define toupp(s) transform(s.begin(), s.end(), s.begin(), ::toupper) // string
#define tolow(s) transform(s.begin(), s.end(), s.begin(), ::tolo... | replace | 105 | 106 | 105 | 106 | 0 | acinnorstt, abbemnoptu, acinnorstt,
abbemnoptu, acinnorstt, acinnorstt,
i = [0]
same_num = [0]
i = [1]
same_num = [2]
|
p02947 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll long long
using namespace std;
const int M = 1000000007;
... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll long long
using namespace std;
const int M = 1000000007;
... | replace | 38 | 39 | 38 | 39 | 0 | |
p02947 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
string s[50000 + 5];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
sort(s, s + n);
long long cnt = 1;
long long sum = 0;
for (long long i = 0; i < n; i++) {
if (s[i] !=... | #include <algorithm>
#include <iostream>
using namespace std;
string s[5000000 + 5];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s[i];
sort(s[i].begin(), s[i].end());
}
sort(s, s + n);
long long cnt = 1;
long long sum = 0;
for (long long i = 0; i < n; i++) {
if (s[i] ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define pii pair<int, int>
#define prec(n) fixed << setprecision(n)
#define MOD 1000000007
#define eps 1e-8
#define FASTER ... | #include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define pii pair<int, int>
#define prec(n) fixed << setprecision(n)
#define MOD 1000000007
#define eps 1e-8
#define FASTER ... | replace | 52 | 53 | 52 | 53 | 0 | |
p02947 | Python | Time Limit Exceeded | N = int(input())
L = [list(input()) for _ in range(N)]
dic = []
flag = {}
res = 0
for i in range(N):
L[i].sort()
if L[i] in dic:
flag[str(L[i])] += 1
res += flag[str(L[i])]
else:
dic.append(L[i])
flag[str(L[i])] = 0
print(res)
| N = int(input())
L = [list(input()) for _ in range(N)]
dic = []
flag = {}
res = 0
for i in range(N):
L[i].sort()
if str(L[i]) in flag:
flag[str(L[i])] += 1
res += flag[str(L[i])]
else:
dic.append(L[i])
flag[str(L[i])] = 0
print(res)
| replace | 10 | 11 | 10 | 11 | TLE | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
#define cases \
int t; \
cin >> t; \
while (t--)
#define pb pu... | #include <bits/stdc++.h>
#define ll long long int
#define cases \
int t; \
cin >> t; \
while (t--)
#define pb pu... | replace | 22 | 24 | 22 | 33 | TLE | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for (ll i{s}; i < (N); i++)
#define rem(i, N, s) for (ll i{N}; i > (s); i--)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
const int MOD = (int)1e9 + 7;
const... | #include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for (ll i{s}; i < (N); i++)
#define rem(i, N, s) for (ll i{N}; i > (s); i--)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
const int MOD = (int)1e9 + 7;
const... | replace | 175 | 180 | 175 | 183 | TLE | |
p02947 | C++ | Runtime Error | #pragma GCC optimize(3, "Ofast", "inline")
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#define ll long long
using namespace std;
int n, tmp[30];
map<string, int> ma;
ll ans = 0, sum = 0;
char c[15];
inline int read() {
int s = 0, t = 1;
char c = getchar();
while ((... | #pragma GCC optimize(3, "Ofast", "inline")
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#define ll long long
using namespace std;
int n, tmp[30];
map<string, int> ma;
ll ans = 0, sum = 0;
char c[15];
inline int read() {
int s = 0, t = 1;
char c = getchar();
while ((... | replace | 34 | 35 | 34 | 35 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
vector<string> s(n);
rep(i, n) cin >> s[i];
int i, j;
ll cnt = 1, ans = 0;
rep(i, n) sort(s[i].begin(), s[i].end());
sort(s.begin(), s.end());
for (i = 0; i <... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
map<string, int> mp;
rep(i, n) {
string s;
cin >> s;
sort(s.begin(), s.end());
mp[s]++;
}
ll ans = 0;
for (auto &p : mp) {
int s = p.second;
... | replace | 8 | 20 | 8 | 19 | 0 | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
const int mod = 1e9 + 7;
const int inf = 1e9;
int add(int x, int y) { return (1ll * x + 1ll * y) % mod; }
int del(int x, int y) { return ((1ll * x - 1ll * y) % mod... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
const int mod = 1e9 + 7;
const int inf = 1e9;
int add(int x, int y) { return (1ll * x + 1ll * y) % mod; }
int del(int x, int y) { return ((1ll * x - 1ll * y) % mod... | replace | 41 | 42 | 41 | 42 | 0 | |
p02947 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define leading \
zero str.erase(0, min(str.find_first_not_of('0'), str.size() - 1));
using namespace __gnu_pbds;
using namespace std;
typedef long long... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define leading \
zero str.erase(0, min(str.find_first_not_of('0'), str.size() - 1));
using namespace __gnu_pbds;
using namespace std;
typedef long long... | replace | 50 | 56 | 50 | 57 | TLE | |
p02947 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
int n, i, sum = 0;
long long int tot = 0;
cin >> n;
vector<string> vect;
for (i = 0; i < n; i++) {
cin >> str;
sort(str.begin(), str.end());
vect.push_back(str);
}
sort(vect.begin(), vect.end());
for (i = 0; i < vect... | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
int n, i, sum = 0;
long long int tot = 0;
cin >> n;
vector<string> vect;
for (i = 0; i < n; i++) {
cin >> str;
sort(str.begin(), str.end());
vect.push_back(str);
}
sort(vect.begin(), vect.end());
for (i = 0; i < vect... | replace | 17 | 18 | 17 | 18 | 0 | |
p02947 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <ccomplex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <unordered... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <ccomplex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <unordered... | replace | 76 | 77 | 76 | 77 | 0 | |
p02947 | Python | Runtime Error | from math import factorial
N = int(input())
d = {}
for _ in range(N):
s = input()
s_sorted = "".join(sorted(s))
if not d.get(s_sorted):
d[s_sorted] = 1
else:
d[s_sorted] += 1
ans = 0
for _, v in d.items():
if v == 1:
continue
x = factorial(v) / factorial(2) / factorial(... | from math import factorial
N = int(input())
d = {}
for _ in range(N):
s = input()
s_sorted = "".join(sorted(s))
if not d.get(s_sorted):
d[s_sorted] = 1
else:
d[s_sorted] += 1
ans = 0
for _, v in d.items():
if v == 1:
continue
ans += v * (v - 1) // 2
print(round(ans))
| replace | 16 | 18 | 16 | 17 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.