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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03221 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
using Graph = vector<vector<int>>;
using Graphl = vector<vector<ll>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i+... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
using Graph = vector<vector<int>>;
using Graphl = vector<vector<ll>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i+... | replace | 56 | 58 | 56 | 60 | TLE | |
p03222 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <vector>
// https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae
using namespace std;
typedef long long ll;
const ll M = pow(10, 9) + 7;
vector<ll> fac(300001); // n!(mod M)
vector<ll> ifac(300001); // k!^{M-2} (mod M)
// k^{M-2} == k^{-1}
// a,bの範囲的にこれだけ配列を用意していけば十... | #include <cmath>
#include <iostream>
#include <vector>
// https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae
using namespace std;
typedef long long ll;
const ll M = pow(10, 9) + 7;
vector<ll> fac(300001); // n!(mod M)
vector<ll> ifac(300001); // k!^{M-2} (mod M)
// k^{M-2} == k^{-1}
// a,bの範囲的にこれだけ配列を用意していけば十... | delete | 99 | 103 | 99 | 99 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for (... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for (... | replace | 63 | 64 | 63 | 64 | 0 | |
p03222 | C++ | Runtime Error | #include <iostream>
using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;
ll dp[10][10];
ll fib[20];
int main() {
ll h, w, k;
cin >> h >> w >> k;
fib[0] = 0, fib[1] = 1;
for (int i = 2; i < 20; i++) {
fib[i] = fib[i - 1] + fib[i - 2];
}
dp[0][1] = 1;
for (int i = 2; i <= w; i++)
dp[0][i]... | #include <iostream>
using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;
ll dp[110][10];
ll fib[20];
int main() {
ll h, w, k;
cin >> h >> w >> k;
fib[0] = 0, fib[1] = 1;
for (int i = 2; i < 20; i++) {
fib[i] = fib[i - 1] + fib[i - 2];
}
dp[0][1] = 1;
for (int i = 2; i <= w; i++)
dp[0][i... | replace | 6 | 7 | 6 | 7 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
ll dp[16][9];
// dp[i][j]:上からiの高さまでの1から出発した時の数
ll h, w, k;
bool invalid(ll bit) {
for (ll i = 0; i < w - 1; ++i) {
if ((bit) & (1 << i) && (bit) & (1 << (i + 1))) {
// cout<<bit<<endl;
return true;
}
}
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
ll dp[101][9];
// dp[i][j]:上からiの高さまでの1から出発した時の数
ll h, w, k;
bool invalid(ll bit) {
for (ll i = 0; i < w - 1; ++i) {
if ((bit) & (1 << i) && (bit) & (1 << (i + 1))) {
// cout<<bit<<endl;
return true;
}
}... | replace | 5 | 6 | 5 | 6 | 0 | |
p03222 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <list>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int h, w, k;
cin >> h;
cin >> w;
cin >> k;
const int mod = 1000000007;
vector<vector<uint64_t>> num(w, vector<uint64_t>... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <list>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int h, w, k;
cin >> h;
cin >> w;
cin >> k;
const int mod = 1000000007;
vector<vector<uint64_t>> num(w, vector<uint64_t>... | replace | 19 | 20 | 19 | 20 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define endl '\n'
#define fo(i, a, b) for (int i = a; i <= b; i++)
#define rf(i, a, b) for (int i = a; i >= b; i--)
#define fast_io ios_base::sync_with_stdio(0);
#define show(x) cout << x << endl;
#define pret(x) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define endl '\n'
#define fo(i, a, b) for (int i = a; i <= b; i++)
#define rf(i, a, b) for (int i = a; i >= b; i--)
#define fast_io ios_base::sync_with_stdio(0);
#define show(x) cout << x << endl;
#define pret(x) ... | replace | 17 | 18 | 17 | 18 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, a, b) for (ll i = a; i < b; ++i)
const ll MOD = 1000000007;
string alp = "abcdefghijklmnopqrstuvwxyz";
int main() {
int H, W, K;
cin... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, a, b) for (ll i = a; i < b; ++i)
const ll MOD = 1000000007;
string alp = "abcdefghijklmnopqrstuvwxyz";
int main() {
int H, W, K;
cin... | replace | 38 | 41 | 38 | 43 | -6 | free(): invalid pointer
|
p03222 | C++ | Runtime Error |
#include <bits/stdc++.h>
using ll = long long;
using Int = int;
#define int ll
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define erep(e, v) for (auto &&e : v)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? (int)1e9 : (int)... |
#include <bits/stdc++.h>
using ll = long long;
using Int = int;
#define int ll
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define erep(e, v) for (auto &&e : v)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? (int)1e9 : (int)... | replace | 81 | 82 | 81 | 82 | 0 | |
p03222 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <sstream>
#include <string.h>
#include <string>
#include <unistd.h>
#include <vector>
#define ALL(a) (a).begin(), (a).end()
const long long INF = 1LL << 58;
const long long MOD = 1e9 ... | #include <algorithm>
#include <array>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <sstream>
#include <string.h>
#include <string>
#include <unistd.h>
#include <vector>
#define ALL(a) (a).begin(), (a).end()
const long long INF = 1LL << 58;
const long long MOD = 1e9 ... | replace | 142 | 143 | 142 | 143 | 0 | |
p03222 | C++ | Runtime Error | // #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("tree-vectorize","openmp","predic... | // #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("tree-vectorize","openmp","predic... | replace | 8 | 10 | 8 | 10 | 0 | |
p03222 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
long long int dp[100][10] = {};
long long int P = 1e9 + 7;
int Fib[8] = {1, 1, 2, 3, 5, 8, 13, 21};
if (W == 1) {
cout << 1 << endl;
} else {
dp[0][1] = 1;
for (in... | #include <algorithm>
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
long long int dp[110][10] = {};
long long int P = 1e9 + 7;
int Fib[8] = {1, 1, 2, 3, 5, 8, 13, 21};
if (W == 1) {
cout << 1 << endl;
} else {
dp[0][1] = 1;
for (in... | replace | 7 | 8 | 7 | 8 | -6 | *** stack smashing detected ***: terminated
|
p03222 | C++ | Runtime Error | #include <iostream>
using namespace std;
#define ll long long
const ll mod = 1000000007;
int H, W, K;
ll dp[100][10];
ll sub(int n) {
if (n <= 0) {
return 1;
} else if (n == 1) {
return 2;
} else {
return sub(n - 1) + sub(n - 2);
}
}
int solve() {
if (W == 1) {
cout << 1 << endl;
retur... | #include <iostream>
using namespace std;
#define ll long long
const ll mod = 1000000007;
int H, W, K;
ll dp[110][15];
ll sub(int n) {
if (n <= 0) {
return 1;
} else if (n == 1) {
return 2;
} else {
return sub(n - 1) + sub(n - 2);
}
}
int solve() {
if (W == 1) {
cout << 1 << endl;
retur... | replace | 7 | 8 | 7 | 8 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long mod = 1000000007;
long dp[101][8] = {};
int H, W;
vector<vector<int>> v; // 横棒のパターン
int bit[8] = {};
void addBit() {
int l = W - 1;
for (int i = 1; i < l; i++) {
if (bit[i - 1] == 1 && bit[i] == 1)
return;
}
vector<int> tmp(l);
for (int i = 0; i <... | #include <bits/stdc++.h>
using namespace std;
long mod = 1000000007;
long dp[101][8] = {};
int H, W;
vector<vector<int>> v; // 横棒のパターン
int bit[8] = {};
void addBit() {
int l = W - 1;
for (int i = 1; i < l; i++) {
if (bit[i - 1] == 1 && bit[i] == 1)
return;
}
vector<int> tmp(l);
for (int i = 0; i <... | replace | 74 | 75 | 74 | 78 | -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)
|
p03222 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define MOD 1000000007
#define INF 1000000001
using namespace std;
typedef unsigned long long ull;
typedef long long ll... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define MOD 1000000007
#define INF 1000000001
using namespace std;
typedef unsigned long long ull;
typedef long long ll... | replace | 72 | 73 | 72 | 73 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const int MOD = 1e9 + 7;
int H, W, K;
vector<int> fib;
ll ans;
void input() { cin >> H >> W >> K; }
int solve(int n) {
if (n < 0)
return 1;
return fib[n];
}
int main() {
input();
fib ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const int MOD = 1e9 + 7;
int H, W, K;
vector<int> fib;
ll ans;
void input() { cin >> H >> W >> K; }
int solve(int n) {
if (n < 0)
return 1;
return fib[n];
}
int main() {
input();
fib ... | replace | 34 | 35 | 34 | 35 | 0 | |
p03222 | C++ | Runtime Error | #include <iostream>
using namespace std;
const int MOD = 1000 * 1000 * 1000 + 7;
int subcount(int n) {
if (n <= 0) {
return 1;
}
int c = 0;
for (int i = 0; i < (1 << n); ++i) {
bool ok = true;
for (int k = 0; k + 1 < n; ++k) {
if ((i & (1 << k)) && (i & (1 << (k + 1)))) {
ok = false... | #include <iostream>
using namespace std;
const int MOD = 1000 * 1000 * 1000 + 7;
int subcount(int n) {
if (n <= 0) {
return 1;
}
int c = 0;
for (int i = 0; i < (1 << n); ++i) {
bool ok = true;
for (int k = 0; k + 1 < n; ++k) {
if ((i & (1 << k)) && (i & (1 << (k + 1)))) {
ok = false... | replace | 30 | 31 | 30 | 31 | 0 | |
p03222 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
int H, W, K;
cin >> H >> W >> K;
// 1*N のところに好きに線を引く (1-index)
vector<long long> fr = {1, 1, 2, 3, 5, 8, 13, 21, 34};
// N*W で K で終了する DP
vector<vector<long long>> dp(H + 1, vector<long long>(W + 1));... | #include <iostream>
#include <vector>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
int H, W, K;
cin >> H >> W >> K;
// 1*N のところに好きに線を引く (1-index)
vector<long long> fr = {1, 1, 2, 3, 5, 8, 13, 21, 34};
// N*W で K で終了する DP
vector<vector<long long>> dp(H + 1, vector<long long>(W + 1));... | 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)
|
p03222 | C++ | Runtime Error | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <utility>
using namespace std;
int bi(int n, int k) {
if (k == 1 && n % 2 == 0) {
return 0;
}
if (k == 1 && n % 2 == 1) {
return 1;
}
if (k >= 2) {
return bi(n / 2, k - 1);
}
}
int power(int n) {
if (n ==... | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <utility>
using namespace std;
int bi(int n, int k) {
if (k == 1 && n % 2 == 0) {
return 0;
}
if (k == 1 && n % 2 == 1) {
return 1;
}
if (k >= 2) {
return bi(n / 2, k - 1);
}
}
int power(int n) {
if (n ==... | replace | 36 | 37 | 36 | 37 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using ll = long long;
const int H = 100, W = 8;
const ll MOD = 1e9 + 7;
int h, w, k;
ll dp[H][W], fib[10];
void pre() {
fib[0] = 0, fib[1] = 1;
for (int i = 2; i < 10; ++i)
fib[i] = fib[i - 1] + fib[i ... | #include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using ll = long long;
const int H = 105, W = 8;
const ll MOD = 1e9 + 7;
int h, w, k;
ll dp[H][W], fib[10];
void pre() {
fib[0] = 0, fib[1] = 1;
for (int i = 2; i < 10; ++i)
fib[i] = fib[i - 1] + fib[i ... | replace | 6 | 7 | 6 | 7 | 0 | |
p03222 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <vector>
// https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae
using namespace std;
typedef long long ll;
const ll M = pow(10, 9) + 7;
vector<ll> fac(300001); // n!(mod M)
vector<ll> ifac(300001); // k!^{M-2} (mod M)
// k^{M-2} == k^{-1}
// a,bの範囲的にこれだけ配列を用意していけば十... | #include <cmath>
#include <iostream>
#include <vector>
// https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae
using namespace std;
typedef long long ll;
const ll M = pow(10, 9) + 7;
vector<ll> fac(300001); // n!(mod M)
vector<ll> ifac(300001); // k!^{M-2} (mod M)
// k^{M-2} == k^{-1}
// a,bの範囲的にこれだけ配列を用意していけば十... | replace | 99 | 102 | 99 | 102 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long int
#define MOD(x) ((x % MOD_N) + MOD_N) % MOD_N
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORE(i, a, b) for (int i = (a); i <= (b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define RFORE(i, a, b) for (int i = (b); i >= (a); --i)
#de... | #include <bits/stdc++.h>
#define int long long int
#define MOD(x) ((x % MOD_N) + MOD_N) % MOD_N
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORE(i, a, b) for (int i = (a); i <= (b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define RFORE(i, a, b) for (int i = (b); i >= (a); --i)
#de... | replace | 157 | 160 | 157 | 163 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typed... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typed... | replace | 106 | 107 | 106 | 107 | 0 | |
p03222 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#in... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#in... | replace | 43 | 44 | 43 | 44 | 0 | |
p03222 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9 + 7;
int h, w, k;
vector<int> r;
int dp[100][8];
int nextPos(int cur, int row) {
int l, r;
l = cur > 0 ? (row >> cur - 1) % 2 : 0;
r = (row >> cur) % 2;
if (cur > 0 && l)
return cur - 1;
else if (cur < w - 1 && r)
retur... | #include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9 + 7;
int h, w, k;
vector<int> r;
int dp[101][8];
int nextPos(int cur, int row) {
int l, r;
l = cur > 0 ? (row >> cur - 1) % 2 : 0;
r = (row >> cur) % 2;
if (cur > 0 && l)
return cur - 1;
else if (cur < w - 1 && r)
retur... | replace | 6 | 7 | 6 | 7 | 0 | |
p03222 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <map>
#include <queue>
#include <random>
#include <vector>
using namespace std;
int main() {
long long MOD = 1000000007;
long long H, W, K;
long long num[100][10];
long long hor_f[10];
scanf("%lld %lld ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <map>
#include <queue>
#include <random>
#include <vector>
using namespace std;
int main() {
long long MOD = 1000000007;
long long H, W, K;
long long num[101][10];
long long hor_f[10];
scanf("%lld %lld ... | replace | 14 | 15 | 14 | 15 | 0 | |
p03222 | C++ | Runtime Error | // #include "stdafx.h"
#include <algorithm>
#include <assert.h>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#i... | // #include "stdafx.h"
#include <algorithm>
#include <assert.h>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#i... | replace | 75 | 77 | 75 | 77 | 0 | |
p03222 | Python | Runtime Error | def count(length, on):
"""Count of possible amida patterns"""
if length < 0:
return 1
if length == 0:
return 1
ret = count(length - 1, False)
if not on:
ret += count(length - 1, True)
return ret
# for i in range(1, 9):
# print(count(i, True) + count(i, False))
if ... | def count(length, on):
"""Count of possible amida patterns"""
if length < 0:
return 1
if length == 0:
return 1
ret = count(length - 1, False)
if not on:
ret += count(length - 1, True)
return ret
# for i in range(1, 9):
# print(count(i, True) + count(i, False))
if ... | replace | 43 | 44 | 43 | 45 | 0 | |
p03222 | C++ | Runtime Error | #include <iostream>
#include <map>
#include <tuple>
#include <vector>
using ull = unsigned long long;
static ull const Mod = 1000000007;
std::vector<ull> Fib;
std::map<std::tuple<int, int, int>, int> Memo;
ull Amida1(int W, int J, int K) {
if (J < 1 || K < 1 || J > W || K > W || std::abs(J - K) > 1) {
return 0... | #include <iostream>
#include <map>
#include <tuple>
#include <vector>
using ull = unsigned long long;
static ull const Mod = 1000000007;
std::vector<ull> Fib;
std::map<std::tuple<int, int, int>, int> Memo;
ull Amida1(int W, int J, int K) {
if (J < 1 || K < 1 || J > W || K > W || std::abs(J - K) > 1) {
return 0... | replace | 54 | 55 | 54 | 55 | -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)
|
p03222 | C++ | Runtime Error | #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>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1'000'000'007;
template <class T> bool chmax(T &a, const T &b) ... | #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>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1'000'000'007;
template <class T> bool chmax(T &a, const T &b) ... | replace | 23 | 24 | 23 | 24 | 0 | |
p03222 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) \
{ \
if (a < b) \
a = b; ... | #include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) \
{ \
if (a < b) \
a = b; ... | insert | 34 | 34 | 34 | 36 | TLE | |
p03223 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define Maxn 100005
#define LL long long
#define R register
int n, a[Maxn];
LL ans;
int main() {
scanf("%d", &n);
for (R int i = 1; i <= n; ++i)
scanf("%d", &a[i]), a[n + i] = a[i];
sort(a + 1, a + n * 2 + 1);
// for (R int i... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
#define Maxn 200005
#define LL long long
#define R register
int n, a[Maxn];
LL ans;
int main() {
scanf("%d", &n);
for (R int i = 1; i <= n; ++i)
scanf("%d", &a[i]), a[n + i] = a[i];
sort(a + 1, a + n * 2 + 1);
// for (R int i... | replace | 6 | 7 | 6 | 7 | 0 | |
p03223 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
const int MAX = 10000;
int main() {
int N;
int A[MAX];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> A[i];
}
sort(A, A ... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
const int MAX = 100000;
int main() {
int N;
int A[MAX];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> A[i];
}
sort(A, A... | replace | 11 | 12 | 11 | 12 | 0 | |
p03223 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
vector<int> doit(const vector<int> &A) {
int N = A.size();
vector<int> B(N);
for (int i = 0; i < N / 2; i++) {
B[N / 2 - 1 - i] = A[i];
... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
vector<int> doit(const vector<int> &A) {
int N = A.size();
vector<int> B(N);
for (int i = 0; i < N / 2; i++) {
B[N / 2 - 1 - i] = A[i];
... | replace | 16 | 17 | 16 | 17 | 0 | |
p03223 | C++ | Runtime Error | #include <bits/stdc++.h>
#define maxn 500005
#define int long long
using namespace std;
inline int read() {
char x = getchar();
int lin = 0, f = 1;
while (x < '0' || x > '9') {
if (x == '-')
f = -1;
x = getchar();
}
while (x >= '0' && x <= '9') {
lin = (lin << 1) + (lin << 3) + x - '0';
... | #include <bits/stdc++.h>
#define maxn 500005
#define int long long
using namespace std;
inline int read() {
char x = getchar();
int lin = 0, f = 1;
while (x < '0' || x > '9') {
if (x == '-')
f = -1;
x = getchar();
}
while (x >= '0' && x <= '9') {
lin = (lin << 1) + (lin << 3) + x - '0';
... | insert | 54 | 54 | 54 | 58 | 0 | |
p03223 | C++ | Time Limit Exceeded |
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#inclu... |
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#inclu... | replace | 92 | 93 | 92 | 93 | TLE | |
p03223 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
int main(void) {
int n, a[10000], b[10000];
long long c = 0, d = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a, a + n);
if (n % 2 == 0) {
b[0] = a[n / 2];
for (int i = 1; i < n; i++) {
if (i % 2 == 0) {
... | #include <algorithm>
#include <iostream>
using namespace std;
int main(void) {
int n, a[100000], b[100000];
long long c = 0, d = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a, a + n);
if (n % 2 == 0) {
b[0] = a[n / 2];
for (int i = 1; i < n; i++) {
if (i % 2 == 0) {
... | replace | 4 | 5 | 4 | 5 | 0 | |
p03224 | C++ | Runtime Error | #include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i, N) for (int i = 0; i < N; ++i)
typedef long long int LL;
int main() {
LL N;
in >> N;
if (N * 2 != (LL)sqrt(N * 2) * ((LL)sqrt(N * 2) + 1)) {
out << "No" << std::endl;
return 0;
}
LL size = sqrt(N * 2);
std::vector<s... | #include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i, N) for (int i = 0; i < N; ++i)
typedef long long int LL;
int main() {
LL N;
in >> N;
if (N * 2 != (LL)sqrt(N * 2) * ((LL)sqrt(N * 2) + 1)) {
out << "No" << std::endl;
return 0;
}
if (N == 1) {
out << "Yes" << std::... | insert | 12 | 12 | 12 | 19 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long LL;
int N;
vector<int> G[401];
void answer(int... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long LL;
int N;
vector<int> G[701];
void answer(int... | replace | 8 | 9 | 8 | 9 | 0 | |
p03224 | C++ | Runtime Error | //----------------------------おまじない
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
//----------------------------
#define FOR(i, j, n) for (int i = (j); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPN(i, n) for (int i = (n); i > 0; i--)
#define I(n) sca... | //----------------------------おまじない
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
//----------------------------
#define FOR(i, j, n) for (int i = (j); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPN(i, n) for (int i = (n); i > 0; i--)
#define I(n) sca... | replace | 44 | 45 | 44 | 45 | 0 | |
p03224 | C++ | Runtime Error | #include <iostream>
using namespace std;
int ans[350][350];
int main() {
int n, k = 1;
scanf("%d", &n);
while (k * (k - 1) / 2 < n)
k++;
if (k * (k - 1) / 2 == n) {
printf("Yes\n%d\n", k);
int cur = 1;
for (int i = 0; i < k - 1; i++) {
for (int j = i; j < k - 1; j++)
ans[i][j] = cu... | #include <iostream>
using namespace std;
int ans[500][500];
int main() {
int n, k = 1;
scanf("%d", &n);
while (k * (k - 1) / 2 < n)
k++;
if (k * (k - 1) / 2 == n) {
printf("Yes\n%d\n", k);
int cur = 1;
for (int i = 0; i < k - 1; i++) {
for (int j = i; j < k - 1; j++)
ans[i][j] = cu... | replace | 2 | 3 | 2 | 3 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
const int inf = 0x3f3f3f3f, oo = inf;
#define pi 3.14159265358979323846
#define IL inline
#define RG register
#define rep(i, a, b) for (RG int i = (a); i < int(b); ++i)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
const int inf = 0x3f3f3f3f, oo = inf;
#define pi 3.14159265358979323846
#define IL inline
#define RG register
#define rep(i, a, b) for (RG int i = (a); i < int(b); ++i)... | replace | 62 | 63 | 62 | 63 | -11 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
#define rep(i, x, y) \
for (i64 i = i64(x), i##_max_for_repmacro = i64(y); \
i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#de... | #include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
#define rep(i, x, y) \
for (i64 i = i64(x), i##_max_for_repmacro = i64(y); \
i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#de... | replace | 67 | 68 | 67 | 68 | -11 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, Ans[400][400], cnt[400];
int main() {
cin >> n;
int k = 0;
for (int i = 1; i * (i - 1) / 2 <= n; i++)
if (i * (i - 1) / 2 == n)
k = i;
if (!k)
return puts("No"), 0;
printf("Yes\n%d\n", k);
for (int i = 1, id = 1; i <= k; i++)
for (int j... | #include <bits/stdc++.h>
using namespace std;
int n, Ans[1000][1000], cnt[1000];
int main() {
cin >> n;
int k = 0;
for (int i = 1; i * (i - 1) / 2 <= n; i++)
if (i * (i - 1) / 2 == n)
k = i;
if (!k)
return puts("No"), 0;
printf("Yes\n%d\n", k);
for (int i = 1, id = 1; i <= k; i++)
for (in... | replace | 2 | 3 | 2 | 3 | 0 | |
p03224 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = ... | replace | 26 | 28 | 26 | 28 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef int sign;
typedef long long ll;
#define For(i, a, b) for (register sign i = (sign)(a); i <= (sign)(b); ++i)
#define Fordown(i, a, b) for (register sign i = (sign)(a); i >= (sign)(b); --i)
const int N = 320 + 5;
template <typename T> bool cmax(T &a, T b) { return (a ... | #include <bits/stdc++.h>
using namespace std;
typedef int sign;
typedef long long ll;
#define For(i, a, b) for (register sign i = (sign)(a); i <= (sign)(b); ++i)
#define Fordown(i, a, b) for (register sign i = (sign)(a); i >= (sign)(b); --i)
const int N = 1e3 + 5;
template <typename T> bool cmax(T &a, T b) { return (a ... | replace | 6 | 7 | 6 | 7 | 0 | |
p03224 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
template <typename Tp> inline void getint(Tp &num) {
register int ch, neg = 0;
while (!isdigit(ch = getchar()))
if (ch == '-')
neg = 1;
num = ch & 15;... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
template <typename Tp> inline void getint(Tp &num) {
register int ch, neg = 0;
while (!isdigit(ch = getchar()))
if (ch == '-')
neg = 1;
num = ch & 15;... | replace | 22 | 23 | 22 | 23 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P2;
#define fi first
#define sese cond
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
map<int, int> st;
signed main() {
int x = 1;
for (int i = 2; i <... | #include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P2;
#define fi first
#define sese cond
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
map<int, int> st;
signed main() {
int x = 1;
for (int i = 2; i <... | replace | 33 | 34 | 33 | 34 | 0 | |
p03224 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
int a[400][400];
int main() {
int n;
scanf("%d", &n);
int id = -1;
for (int i = 1; i * (i + 1) / 2 <= n; i++) {
if (n == i * (i + 1) / 2) {
id = i;
break;
}
}
if (id == -1)
return 0 * puts("No");
puts("Yes");
printf("%d\n", id + 1);
int s ... | #include <cstdio>
#include <cstring>
int a[1000][1000];
int main() {
int n;
scanf("%d", &n);
int id = -1;
for (int i = 1; i * (i + 1) / 2 <= n; i++) {
if (n == i * (i + 1) / 2) {
id = i;
break;
}
}
if (id == -1)
return 0 * puts("No");
puts("Yes");
printf("%d\n", id + 1);
int ... | replace | 3 | 4 | 3 | 4 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
int n, m, i, j, x;
std::vector<int> v[999];
int main() {
scanf("%d", &n);
m = (1 + sqrt(1 + 8 * n)) / 2;
if (m * (m - 1) / 2 != n)
return puts("No");
for (i = 1; i < m; ++i)
for (j = i + 1; j <= m; ++j)
++x, v[i].push_back(x), v[j].push_back(x);
printf("Yes\n%d\n", m);
... | #include <bits/stdc++.h>
int n, m, i, j, x;
std::vector<int> v[999];
int main() {
scanf("%d", &n);
m = (1 + sqrt(1 + 8 * n)) / 2;
if (m * (m - 1) / 2 != n)
return puts("No"), 0;
for (i = 1; i < m; ++i)
for (j = i + 1; j <= m; ++j)
++x, v[i].push_back(x), v[j].push_back(x);
printf("Yes\n%d\n", m)... | replace | 7 | 8 | 7 | 8 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int d[350][350];
void solve() {
int n;
cin >> n;
int k = 1;
auto c2 = [](int x) { return x * (x - 1) / 2; };
while (c2(k) < n) {
k++;
}
if (c2(k) != n) {
cout << "No";
return;
}
int edge_cnt = 1;
for (int i = 0; i < k; i++) {
for (int ... | #include <bits/stdc++.h>
using namespace std;
int d[450][450];
void solve() {
int n;
cin >> n;
int k = 1;
auto c2 = [](int x) { return x * (x - 1) / 2; };
while (c2(k) < n) {
k++;
}
if (c2(k) != n) {
cout << "No";
return;
}
int edge_cnt = 1;
for (int i = 0; i < k; i++) {
for (int ... | replace | 4 | 5 | 4 | 5 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
/* */ // #undef int
#define INF 1000000009ll
#define INFL 1000000000000000018ll
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define mk make_pair
typedef pair<int, int> PA;
typedef priority_queue<... | #include <bits/stdc++.h>
using namespace std;
#define int long long
/* */ // #undef int
#define INF 1000000009ll
#define INFL 1000000000000000018ll
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define mk make_pair
typedef pair<int, int> PA;
typedef priority_queue<... | replace | 23 | 25 | 23 | 27 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
const int maxN = 1e5 + 10;
int a[maxN];
int b[maxN];
int c[maxN];
vector<int> w[maxN];
int n;
int main() {
scanf("%d", &n);
for (int i = 2; ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
const int maxN = 1e5 + 10;
int a[maxN];
int b[10 * maxN];
int c[10 * maxN];
vector<int> w[maxN];
int n;
int main() {
scanf("%d", &n);
for (i... | replace | 11 | 13 | 11 | 13 | -11 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define int ll
#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(), x.end()
#ifdef LOCAL
#define cerr (cerr << "-- line " << __LINE__ << " -- ")
#e... | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define int ll
#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(), x.end()
#ifdef LOCAL
#define cerr (cerr << "-- line " << __LINE__ << " -- ")
#e... | replace | 143 | 144 | 143 | 144 | 0 | |
p03224 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
typedef long double ld;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define F first
#define S second
const int mx = 2000... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
typedef long double ld;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define F first
#define S second
const int mx = 2000... | replace | 26 | 27 | 26 | 27 | 0 | |
p03224 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int MAX_K = 1e3;
int main() {
int N;
scanf("%d", &N);
int k = 0;
for (int res = 1; res <= MAX_K; res++) {
if ((res * (res + 1)) / 2 == N) {
k = res;
break;
}
}
if (k == 0) {
... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int MAX_K = 1e3;
int main() {
int N;
scanf("%d", &N);
if (N == 1) {
printf("%s\n", "Yes");
printf("%d\n", 2);
printf("%d %d\n", 1, 1);
printf("%d %d\n", 1, 1);
return 0;
}
int k ... | insert | 11 | 11 | 11 | 20 | 0 | |
p03225 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long... | replace | 338 | 339 | 338 | 339 | 0 | |
p03225 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template <class T = int> using V = vector<T>;
template <class T = int> using VV = V<V<T>>;
template <class T> void assign(V<T> &v, int n, const T &a = T()) {
v.assign(n, a);
}
template <class T, class... Args>
void assign(V<T> &v, int n, const ... | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template <class T = int> using V = vector<T>;
template <class T = int> using VV = V<V<T>>;
template <class T> void assign(V<T> &v, int n, const T &a = T()) {
v.assign(n, a);
}
template <class T, class... Args>
void assign(V<T> &v, int n, const ... | replace | 23 | 50 | 23 | 76 | TLE | |
p03225 | C++ | Runtime Error | /**
* author: otera
**/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <se... | /**
* author: otera
**/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <se... | replace | 82 | 83 | 82 | 83 | 0 | |
p03225 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
int H, W, N, p[609][609], q[609][609];
int vals(int px, int py) {
px = min(px, 2 * N);
py = min(py, 2 * N);
if (px < 0 || py < 0)
return 0;
return p[px][py];
}
int valm(int px, int py) {
if (px < 0 || py < 0 || px > 2 * N || py > 2 * N)
... | #include <algorithm>
#include <iostream>
using namespace std;
int H, W, N, p[609][609], q[609][609];
int vals(int px, int py) {
px = min(px, 2 * N);
py = min(py, 2 * N);
if (px < 0 || py < 0)
return 0;
return p[px][py];
}
int valm(int px, int py) {
if (px < 0 || py < 0 || px > 2 * N || py > 2 * N)
... | replace | 50 | 51 | 50 | 52 | TLE | |
p03225 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef pair<int, int> ii;
const int MAXN = 305;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
int n, m, diagCount;
int d1[2 * MAXN][2 * MAXN];
int d2[2 * MA... | // #include <bits/stdc++.h>
#include <cstdio>
#include <iostream>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef pair<int, int> ii;
const int MAXN = 305;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
int n, m, diagCount;
... | replace | 0 | 1 | 0 | 3 | TLE | |
p03225 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
vector<string> rotate(int h, int w, vector<string> &grid) {
vector<string> ngrid(w);
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
ngrid[w - 1 - j].push_back(grid[i][j]);
}
}
return ngrid;
}
/**
..............
#
.......
.... | #include <bits/stdc++.h>
using namespace std;
vector<string> rotate(int h, int w, vector<string> &grid) {
vector<string> ngrid(w);
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
ngrid[w - 1 - j].push_back(grid[i][j]);
}
}
return ngrid;
}
/**
..............
#
.......
.... | replace | 72 | 73 | 72 | 73 | TLE | |
p03225 | C++ | Runtime Error | /*
:>
*/
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
random_device(rd);
mt19937 rng(rd());
const long long FI... | /*
:>
*/
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
random_device(rd);
mt19937 rng(rd());
const long long FI... | replace | 112 | 113 | 112 | 113 | 0 | |
p03225 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define NMAX 310
#define BMAX (NMAX * 3 + 6)
typedef long long i64;
static int n, m;
static char map[NMAX + 10][NMAX + 10];
static int pre[3 * NMAX + 10][3 * NMAX + 10];
#define S(i, j) pre[NMAX + (i)][NMAX + (j)]
void show() {
for ... | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define NMAX 600
#define BMAX (NMAX * 3 + 6)
typedef long long i64;
static int n, m;
static char map[NMAX + 10][NMAX + 10];
static int pre[3 * NMAX + 10][3 * NMAX + 10];
#define S(i, j) pre[NMAX + (i)][NMAX + (j)]
void show() {
for ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03225 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define repi(i, a, b) \
for (long long i = (long long)(a); i < (long long)(b); i++)
#define pb push_back
#define all(x) (x).beg... | #include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define repi(i, a, b) \
for (long long i = (long long)(a); i < (long long)(b); i++)
#define pb push_back
#define all(x) (x).beg... | replace | 196 | 197 | 196 | 197 | 0 | |
p03225 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
char s[200][200];
int pre1[3000][3000] = {0}, pre2[3000][3000] = {0};
const int shift = 1000;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
auto inside = [](int x, int n) { return x >= 0 and x < n; };
... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
char s[500][500];
int pre1[3000][3000] = {0}, pre2[3000][3000] = {0};
const int shift = 1000;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
auto inside = [](int x, int n) { return x >= 0 and x < n; };
... | replace | 4 | 5 | 4 | 5 | 0 | |
p03226 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, a) FOR(i, 0, a)
using namespace std;
int N;
const int MAX_N = 3e5;
const ll MOD = 998244353;
typedef pair<int, int> P;
vector<P> org;
int psm[MAX_N + 1];
int main() {
cin >> N;
REP(i, N) {
int a;
... | #include <bits/stdc++.h>
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, a) FOR(i, 0, a)
using namespace std;
int N;
const int MAX_N = 3e5;
const ll MOD = 998244353;
typedef pair<int, int> P;
vector<P> org;
int psm[MAX_N + 1];
int main() {
cin >> N;
REP(i, N) {
int a;
... | insert | 127 | 127 | 127 | 128 | 0 | |
p03226 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <time.h>
#include <vector>
#define dibs reserv... | #include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <time.h>
#include <vector>
#define dibs reserv... | insert | 81 | 81 | 81 | 88 | TLE | |
p03226 | C++ | Runtime Error |
// pantyhose(black) + glasses = infinity
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << " = " << x << '\n';
#define BP() cerr << "OK!\n";
#define PR(A, n) \
{ ... |
// pantyhose(black) + glasses = infinity
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << " = " << x << '\n';
#define BP() cerr << "OK!\n";
#define PR(A, n) \
{ ... | replace | 115 | 116 | 115 | 118 | 0 | |
p03227 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
if (s.size() == 2) {
cout << s << endl;
} else {
cout << s.at(2) << s.at(1) << s.at(0) << endl;
}
} | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if (s.size() == 2) {
cout << s << endl;
} else {
cout << s.at(2) << s.at(1) << s.at(0) << endl;
}
} | insert | 6 | 6 | 6 | 7 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 2) >= this->size() (which is 0)
|
p03227 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define start_routine() int begtime = clock();
#define end_routine() \
int endtime = clock(); \
cerr << endl ... | #include <bits/stdc++.h>
using namespace std;
#define start_routine() int begtime = clock();
#define end_routine() \
int endtime = clock(); \
cerr << endl ... | replace | 63 | 64 | 63 | 64 | 0 |
Time elapsed: 0 ms |
p03227 | C++ | Runtime Error | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define rep2(i, n) for (int i = 0; i <= n; i++)
#define repr(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#de... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define rep2(i, n) for (int i = 0; i <= n; i++)
#define repr(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#de... | insert | 91 | 91 | 91 | 92 | -6 | /usr/include/c++/12/bits/basic_string.h:1221: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]:... |
p03227 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e9)
#define PI (acos(-1))
// const double PI = acos(-1);
// const double EPS = 1e-15;
// long lon... | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e9)
#define PI (acos(-1))
// const double PI = acos(-1);
// const double EPS = 1e-15;
// long lon... | replace | 57 | 58 | 57 | 58 | -11 | |
p03227 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
freopen("input.txt", "r", stdin);
string s;
cin >> s;
if (s.size() == 3) {
reverse(s.begin(), s.end());
}
cout << s << "\n";
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
// freopen("input.txt", "r", stdin);
string s;
cin >> s;
if (s.size() == 3) {
reverse(s.begin(), s.end());
}
cout << s << "\n";
return 0;
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p03227 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
string A;
char B, C;
if (A.size() == 2) {
cout << A << endl;
} else {
B = A.at(0);
C = A.at(2);
A.at(0)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
string A;
cin >> A;
char B, C;
if (A.size() == 2) {
cout << A << endl;
} else {
B = A.at(0);
C = A.at(2);... | insert | 7 | 7 | 7 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p03228 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)
#define mod 1000000007
#define speed \
ios::sync_with_stdio(0); \
cin.tie(0);
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)
#define mod 1000000007
#define speed \
ios::sync_with_stdio(0); \
cin.tie(0);
... | delete | 13 | 16 | 13 | 13 | 0 | |
p03229 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(void) {
int n;
cin >> n;
vector<ll> v(n);
rep(i, n) cin >> v[i];
sort(v.begin(), v.end());
/*小さい奴を真ん中にする場合*/
deque<ll> que1;
rep(i, n) que1.push_back(v[i]);
ll ans1 = 0;
ll l... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(void) {
int n;
cin >> n;
vector<ll> v(n);
rep(i, n) cin >> v[i];
sort(v.begin(), v.end());
/*小さい奴を真ん中にする場合*/
deque<ll> que1;
rep(i, n) que1.push_back(v[i]);
ll ans1 = 0;
ll l... | replace | 71 | 75 | 71 | 75 | 0 | |
p03229 | C++ | Runtime Error | #include <algorithm>
#include <fstream>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; (i) < (n); ++(i))
#define int long long
using namespa... | #include <algorithm>
#include <fstream>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; (i) < (n); ++(i))
#define int long long
using namespa... | replace | 26 | 27 | 26 | 28 | 0 | |
p03229 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll ABS(ll a, ll b) {
if (a - b >= 0)
return a - b;
else
return b - a;
}
int main() {
ios_base::... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll ABS(ll a, ll b) {
if (a - b >= 0)
return a - b;
else
return b - a;
}
int main() {
ios_base::... | replace | 34 | 35 | 34 | 35 | -11 | |
p03229 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <chrono>
#include <deque>
#include <iostream>
#include <map>
#include <vector>
#define vint vector<int>
#define vint2 vector<vint>
#define vchar vector<char>
#define vchar2 vector<vchar>
#define vchar3 vector<vchar2>
#define pr pair<int, int>
#define vpr vector<pr>
#defi... | #include <algorithm>
#include <bitset>
#include <chrono>
#include <deque>
#include <iostream>
#include <map>
#include <vector>
#define vint vector<int>
#define vint2 vector<vint>
#define vchar vector<char>
#define vchar2 vector<vchar>
#define vchar3 vector<vchar2>
#define pr pair<int, int>
#define vpr vector<pr>
#defi... | replace | 91 | 93 | 91 | 92 | TLE | |
p03229 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
const int maxn = 10003;
int n, a[maxn], b[maxn];
ll ans;
int read() {
char ch = getchar();
int num = 0;
bool fl = 0;
for (; !isdigit(ch); ch = getchar())
if (ch == '-')
fl = 1;
for (; isdigit(ch); ch = getchar())
num = (num << 1) + (num << 3) + ch... | #include <bits/stdc++.h>
typedef long long ll;
const int maxn = 100003;
int n, a[maxn], b[maxn];
ll ans;
int read() {
char ch = getchar();
int num = 0;
bool fl = 0;
for (; !isdigit(ch); ch = getchar())
if (ch == '-')
fl = 1;
for (; isdigit(ch); ch = getchar())
num = (num << 1) + (num << 3) + c... | replace | 2 | 3 | 2 | 3 | 0 | |
p03229 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), _end_ = (b); i < _end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define X first
#define Y second
#define mp make_pair
#define eb emplace_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (... | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), _end_ = (b); i < _end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define X first
#define Y second
#define mp make_pair
#define eb emplace_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (... | replace | 40 | 42 | 40 | 41 | 0 | |
p03229 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
ifstream cin("tst.in");
int n;
cin >> n;
long long x;
vector<long long> a;
for (int i = 1; i <= n; i++) {
cin >> x;
a.push_back(x);
}
sort(a.begin(), a.end());
int l = a[a.size() - 1]; // left
int r = l; // right
in... | #include <bits/stdc++.h>
using namespace std;
int main() {
// ifstream cin("tst.in");
int n;
cin >> n;
long long x;
vector<long long> a;
for (int i = 1; i <= n; i++) {
cin >> x;
a.push_back(x);
}
sort(a.begin(), a.end());
int l = a[a.size() - 1]; // left
int r = l; // right
... | replace | 5 | 6 | 5 | 6 | -11 | |
p03229 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> IP;
typedef vector<ll> V;
typedef vector<V> V2;
typedef vector<vector<P>> G;
void g_dir(G &graph, ll a, ll b, ll w = 1) { graph[a].push_back(P(b, w)); }
void g_undir(G &graph, ll a, ll b, ll w = 1) {
g_dir(... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> IP;
typedef vector<ll> V;
typedef vector<V> V2;
typedef vector<vector<P>> G;
void g_dir(G &graph, ll a, ll b, ll w = 1) { graph[a].push_back(P(b, w)); }
void g_undir(G &graph, ll a, ll b, ll w = 1) {
g_dir(... | replace | 39 | 40 | 39 | 56 | 1 | |
p03230 | Python | Runtime Error | n = int(input())
for i in range(n**0.5 + 1):
if 2 * n == i**2 - i:
k = i
break
elif 2 * n < i**2 - i:
print("No")
exit()
k = int(k)
print("Yes")
print(k)
num, ans = 1, [[] for _ in range(k)]
for i in range(k):
for j in range(i + 1, k):
ans[i].append(num)
ans... | n = int(input())
for i in range(10**5):
if 2 * n == i**2 - i:
k = i
break
elif 2 * n < i**2 - i:
print("No")
exit()
k = int(k)
print("Yes")
print(k)
num, ans = 1, [[] for _ in range(k)]
for i in range(k):
for j in range(i + 1, k):
ans[i].append(num)
ans[j].a... | replace | 2 | 3 | 2 | 3 | TypeError: 'float' object cannot be interpreted as an integer | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03230/Python/s851921325.py", line 3, in <module>
for i in range(n ** 0.5 + 1):
TypeError: 'float' object cannot be interpreted as an integer
|
p03230 | Python | Runtime Error | def main():
from collections import deque
from decimal import Decimal, getcontext
getcontext().prec = 1000
N = int(input())
# {1,...,N}*2を分割
# k個の集合があって
# 各集合は他のk-1個の集合に対し共通要素を1個ずつ合わせてk-1個の要素をもつ
sq = Decimal(N * 8 + 1).sqrt()
cond = sq % 2 == 1 # 奇数か
if not cond:
pr... | def main():
from collections import deque
from decimal import Decimal, getcontext
getcontext().prec = 1000
N = int(input())
# {1,...,N}*2を分割
# k個の集合があって
# 各集合は他のk-1個の集合に対し共通要素を1個ずつ合わせてk-1個の要素をもつ
sq = Decimal(N * 8 + 1).sqrt()
cond = sq % 2 == 1 # 奇数か
if not cond:
pr... | replace | 34 | 35 | 34 | 36 | 0 | |
p03230 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop ... | #include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop ... | insert | 127 | 127 | 127 | 134 | 0 | |
p03230 | Python | Runtime Error | def solve(n):
k = 1
while k * (k + 1) < 2 * n:
k += 1
if k * (k + 1) != 2 * n:
return False, []
ans = [[] for _ in range(1000)]
add_num = 1
ans[1].append(add_num)
ans[0].append(add_num)
for i in range(2, k + 1):
for j in range(i):
add_num += 1
... | def solve(n):
k = 1
while k * (k + 1) < 2 * n:
k += 1
if k * (k + 1) != 2 * n:
return False, [], -1
ans = [[] for _ in range(1000)]
add_num = 1
ans[1].append(add_num)
ans[0].append(add_num)
for i in range(2, k + 1):
for j in range(i):
add_num += 1
... | replace | 5 | 6 | 5 | 6 | 0 | |
p03230 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i, n) for (ll i = 0; i < n; ++i)
#de... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i, n) for (ll i = 0; i < n; ++i)
#de... | replace | 29 | 30 | 29 | 30 | 0 | |
p03230 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int k = 2;
while (k * (k - 1) / 2 < n)
k++;
if (k * (k - 1) / 2 != n) {
cout << "No" << endl;
return 0;
}
int a[400][400];
int b[400];
for (int i = 1; i <= k; i++)
b[i] = 0;
int x = 1;
for (int i = 1; i ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int k = 2;
while (k * (k - 1) / 2 < n)
k++;
if (k * (k - 1) / 2 != n) {
cout << "No" << endl;
return 0;
}
int a[500][500];
int b[500];
for (int i = 1; i <= k; i++)
b[i] = 0;
int x = 1;
for (int i = 1; i ... | replace | 15 | 17 | 15 | 17 | 0 | |
p03230 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define all(a) (a).begin(), (a).end()
#define lol 1000000007
#define rep(i, a, b) for (int i = a; i < b; i++)
#define SIZE 1000005
#define debug(x) cerr << #x... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define all(a) (a).begin(), (a).end()
#define lol 1000000007
#define rep(i, a, b) for (int i = a; i < b; i++)
#define SIZE 1000005
#define debug(x) cerr << #x... | replace | 34 | 35 | 34 | 35 | 0 | |
p03230 | C++ | Runtime Error | // #includes {{{
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end... | // #includes {{{
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end... | replace | 187 | 188 | 187 | 188 | 0 | |
p03230 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
int N;
vector<int> s[200];
int main() {
int k;
while (cin >> N) {
k = 1;
while ((k * k - k) < 2 * N)
k++;
if ((k * k - k) == 2 * N) {
for (int i = 0; i < k; i++)
s[i... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
int N;
vector<int> s[1000];
int main() {
int k;
while (cin >> N) {
k = 1;
while ((k * k - k) < 2 * N)
k++;
if ((k * k - k) == 2 * N) {
for (int i = 0; i < k; i++)
s[... | replace | 8 | 9 | 8 | 9 | 0 | |
p03230 | C++ | Runtime Error | /*
Author:zeke
pass System Test!
GET AC!!
*/
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll... | /*
Author:zeke
pass System Test!
GET AC!!
*/
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll... | replace | 79 | 80 | 79 | 80 | 0 | |
p03230 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define reps(i, A, n) for (int(i) = (A); (i) < (n); (i)++)
#define pb emplace_back
using LL = long long;
const LL MOD = 1e9 + 7;
int N;
int K;
vector<int> S[114514];
int main() {
scanf("%d", &N);
reps(k, 1, N + 1)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define reps(i, A, n) for (int(i) = (A); (i) < (n); (i)++)
#define pb emplace_back
using LL = long long;
const LL MOD = 1e9 + 7;
int N;
int K;
vector<int> S[114514];
int main() {
scanf("%d", &N);
reps(k, 1, N + 11... | replace | 16 | 17 | 16 | 17 | 0 | |
p03230 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), _end_ = (b); i < _end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define X first
#define Y second
#define mp make_pair
#define eb emplace_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (... | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), _end_ = (b); i < _end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define X first
#define Y second
#define mp make_pair
#define eb emplace_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (... | replace | 63 | 64 | 63 | 64 | 0 | |
p03230 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
int A = 1;
while (A * (A - 1) / 2 < N)
++A;
if (A * (A - 1) / 2 > N) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
vector<vector<int>> G(N);
int cnt = 0;
for (int i = 0; i < A; ++i) {
... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
int A = 1;
while (A * (A - 1) / 2 < N)
++A;
if (A * (A - 1) / 2 > N) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
vector<vector<int>> G(A);
int cnt = 0;
for (int i = 0; i < A; ++i) {
... | replace | 13 | 14 | 13 | 14 | 0 | |
p03230 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
int N;
cin >> N;
if (N == 1) {
cout << "Yes" << endl;
cout << 2 << endl;
cout << "1 1" << endl;
cout << "1 1" << endl;
... | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
int N;
cin >> N;
if (N == 1) {
cout << "Yes" << endl;
cout << 2 << endl;
cout << "1 1" << endl;
cout << "1 1" << endl;
... | replace | 25 | 26 | 25 | 26 | 0 | |
p03230 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ld long double
int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } // 最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } // 最小公倍数
using Graph = vector<vector<ll>>;
l... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define ld long double
int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } // 最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } // 最小公倍数
using Graph = vector<vector<ll>>;
l... | replace | 28 | 29 | 28 | 29 | 0 | |
p03230 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#in... | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#in... | replace | 72 | 73 | 72 | 73 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.