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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02820 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int N, K;
ll R, S, P;
string T;
ll dp[100000 + 100][3]; // j -> 0->r 1->s 2->p
int main() {
cin >> N >> K >> R >> S >> P >> T;
ll ans = 0;
for (int i = 0; i < K; i++) {
if (T[i] == 'r') {
dp[i][2] ... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int N, K;
ll R, S, P;
string T;
ll dp[100000 + 100][3]; // j -> 0->r 1->s 2->p
int main() {
cin >> N >> K >> R >> S >> P >> T;
ll ans = 0;
for (int i = 0; i < K; i++) {
if (T[i] == 'r') {
dp[i][2] ... | replace | 26 | 27 | 26 | 27 | TLE | |
p02820 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define all(vr) vr.begin(), vr.end()
typedef long long ll;
ll x, n;
ll r, s, p, k, ans, dem;
string t;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
freopen("input.... | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define all(vr) vr.begin(), vr.end()
typedef long long ll;
ll x, n;
ll r, s, p, k, ans, dem;
string t;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// freopen("inp... | replace | 18 | 19 | 18 | 19 | 0 | |
p02820 | C++ | Runtime Error | #define LOCAL
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <ran... | #define LOCAL
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <ran... | replace | 134 | 135 | 134 | 135 | 0 | |
p02821 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9 + 7)
#define inf (int)(3e18)
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i < n; i++)
#define P std::pair<int, int>
#define PiP std::pair<int, std::pair<int, int>>
#define all(v) v.begin(), v.end()
#define mkp std::m... | #include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9 + 7)
#define inf (int)(3e18)
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i < n; i++)
#define P std::pair<int, int>
#define PiP std::pair<int, std::pair<int, int>>
#define all(v) v.begin(), v.end()
#define mkp std::m... | replace | 96 | 97 | 96 | 97 | 0 | |
p02821 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int64;
const int MAX = 1e5 + 5;
int n, a[MAX];
int64 m, t[MAX], sum[MAX];
pair<int64, int64> f(int x) {
int64 cnt = 0, tot_sum = 0;
for (int i = 1; i <= n; i++) {
int64 c = t[max(1, x - a[i])];
int64 s = sum[max(1, x - a[i])];
cnt += c;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int64;
const int MAX = 2e5 + 5;
int n, a[MAX];
int64 m, t[MAX], sum[MAX];
pair<int64, int64> f(int x) {
int64 cnt = 0, tot_sum = 0;
for (int i = 1; i <= n; i++) {
int64 c = t[max(1, x - a[i])];
int64 s = sum[max(1, x - a[i])];
cnt += c;
... | replace | 4 | 5 | 4 | 5 | 0 | |
p02821 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, m) for (long long i = 0; i < m; i++)
#define per(i, m) for (long long i = m - 1; i >= 0; i--)
#define FOR(i, n, m) for (long long i = n; i < m; i++)
#define ROF(i, n, m) for (long long i = m - 1; i >= n; i--)
#define SORT(v, n) ... | #include <bits/stdc++.h>
#define rep(i, m) for (long long i = 0; i < m; i++)
#define per(i, m) for (long long i = m - 1; i >= 0; i--)
#define FOR(i, n, m) for (long long i = n; i < m; i++)
#define ROF(i, n, m) for (long long i = m - 1; i >= n; i--)
#define SORT(v, n) ... | replace | 340 | 341 | 340 | 341 | 0 | |
p02821 | C++ | Runtime Error |
// Problem : E - Handshake
// Contest : AtCoder Beginner Contest 149
// URL : https://atcoder.jp/contests/abc149/tasks/abc149_e
// Memory Limit : 1024.000000 MB
// Time Limit : 2000.000000 milisec
// Powered by CP Editor (https://github.com/coder3101/cp-editor)
#include <bits/stdc++.h>
using namespace std;
using ll =... |
// Problem : E - Handshake
// Contest : AtCoder Beginner Contest 149
// URL : https://atcoder.jp/contests/abc149/tasks/abc149_e
// Memory Limit : 1024.000000 MB
// Time Limit : 2000.000000 milisec
// Powered by CP Editor (https://github.com/coder3101/cp-editor)
#include <bits/stdc++.h>
using namespace std;
using ll =... | replace | 62 | 64 | 62 | 64 | 0 | |
p02821 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#define ll long long
using namespace std;
ll n, suff[100100], cnt[100100], suffval[100100], a[100100];
int main() {
ll m;
cin >> n >> m;
for (ll i = 0; i < n; i++)
cin >> a[i], cnt[a[i]]++;
sort(a, a + n);
for (ll i = 1e5; i >= 0; i--)
suff[i] = cnt[i] + ... | #include <bits/stdc++.h>
#include <iostream>
#define ll long long
using namespace std;
ll n, suff[200100], cnt[200100], suffval[200100], a[200100];
int main() {
ll m;
cin >> n >> m;
for (ll i = 0; i < n; i++)
cin >> a[i], cnt[a[i]]++;
sort(a, a + n);
for (ll i = 1e5; i >= 0; i--)
suff[i] = cnt[i] + ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02821 | Python | Runtime Error | n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
s = a[0]
t = 0
j = 1
ret = 0
for i in range(n):
s -= a[i]
ret += a[i] * 2
m -= 1
while j < n and (i >= n - 1 or a[i + 1] + a[i + 1] <= a[i] + a[j]):
if m < i * 2:
for k in range(i):
... | n, m = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
s = [0]
for ai in a:
s.append(ai + s[-1])
def count(x, accum=False):
ret = 0
for ai in a:
lo, hi = -1, n
while hi - lo > 1:
mid = (lo + hi) // 2
if ai + a[mid] >= x:
... | replace | 2 | 39 | 2 | 30 | 0 | |
p02821 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#define SIZE 2010
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define ll long lon... | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#define SIZE 200010
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define ll long l... | replace | 6 | 7 | 6 | 7 | 0 | |
p02821 | C++ | Runtime Error | //{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a, b, c, x, ...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__, rep3, rep2, loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__, rrep3, rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, be... | //{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a, b, c, x, ...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__, rep3, rep2, loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__, rrep3, rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, be... | replace | 218 | 219 | 218 | 219 | 0 | |
p02821 | C++ | Time Limit Exceeded | #pragma target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + ... | #pragma target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + ... | replace | 119 | 120 | 119 | 120 | TLE | |
p02821 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
using namespace std;
int n = 0, m = 0;
int arr[100000];
int suf[100010];
int get(int l, int r) {
int res = suf[l];
res -= suf[r + 1];
return res;
}
bool check(int mm) {
int res = 0;
for (int i = 0; i < n; i++) {
auto it = lower_bound(arr, arr + n, mm - ar... | #include <bits/stdc++.h>
#define int long long
using namespace std;
int n = 0, m = 0;
int arr[100000];
int suf[100010];
int get(int l, int r) {
int res = suf[l];
res -= suf[r + 1];
return res;
}
bool check(int mm) {
int res = 0;
for (int i = 0; i < n; i++) {
auto it = lower_bound(arr, arr + n, mm - ar... | replace | 34 | 38 | 34 | 35 | 0 | |
p02821 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (l... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (l... | replace | 34 | 35 | 34 | 35 | -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)
|
p02821 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
/// source: https://atcoder.jp/contests/abc149/submissions/9237911
long long n, m;
vector<long long> a, sum;
long long solve();
long long check(long long x);
int main() {
cin >> n >> m;
a.resize(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
sort(a.begin(), a.en... | #include <bits/stdc++.h>
using namespace std;
/// source: https://atcoder.jp/contests/abc149/submissions/9237911
long long n, m;
vector<long long> a, sum;
long long solve();
long long check(long long x);
int main() {
cin >> n >> m;
a.resize(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
sort(a.begin(), a.en... | replace | 21 | 22 | 21 | 24 | TLE | |
p02821 | C++ | Runtime Error | /* -*- coding: utf-8 -*-
*
* e.cc: E - Handshake
*/
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include ... | /* -*- coding: utf-8 -*-
*
* e.cc: E - Handshake
*/
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include ... | replace | 77 | 78 | 77 | 78 | 0 | |
p02821 | C++ | Runtime Error | // clang-format off
#include <bits/stdc++.h>
#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (size_t i = 0; i < size_t(n); i++)
#define forn1(i,n) for (size_t i = 1; i <= size_t(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __... | // clang-format off
#include <bits/stdc++.h>
#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (size_t i = 0; i < size_t(n); i++)
#define forn1(i,n) for (size_t i = 1; i <= size_t(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __... | replace | 46 | 47 | 46 | 52 | 0 | |
p02821 | C++ | Runtime Error | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
namespace {
template <int n, typename T>
void mult(const T *__restrict a, const T *__restrict b, T *__restrict res) {
if (n <= 64) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
res[i +... | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx")
#include <bits/stdc++.h>
namespace {
template <int n, typename T>
void mult(const T *__restrict a, const T *__restrict b, T *__restrict res) {
if (n <= 64) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
res[i + j] +... | replace | 1 | 2 | 1 | 2 | 0 | |
p02821 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
template <typename T>
constexpr T inf =
numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity()
: numeric_limits<T>::max() / 4;
#define REP(i, stop) FOR(i, 0, sto... | #include <bits/stdc++.h>
using namespace std;
using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
template <typename T>
constexpr T inf =
numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity()
: numeric_limits<T>::max() / 4;
#define REP(i, stop) FOR(i, 0, sto... | replace | 97 | 98 | 97 | 98 | 0 | |
p02821 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pa pair<int, int>
#define pal pair<long long, long long>
#define pali pair<long long, int>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define COUT(v) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pa pair<int, int>
#define pal pair<long long, long long>
#define pali pair<long long, int>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define COUT(v) ... | replace | 154 | 156 | 154 | 155 | TLE | |
p02822 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>... | replace | 257 | 258 | 257 | 258 | TLE | |
p02822 | C++ | Runtime Error | // warm heart, wagging tail,and a smile just for you!
// ███████████
// ███╬╬╬╬╬╬╬╬╬╬███
// ███╬╬╬╬╬████╬╬╬╬╬╬███
// ... | // warm heart, wagging tail,and a smile just for you!
// ███████████
// ███╬╬╬╬╬╬╬╬╬╬███
// ███╬╬╬╬╬████╬╬╬╬╬╬███
// ... | replace | 107 | 108 | 107 | 108 | 0 | |
p02822 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename t> void myMemset(t *arr, t val, unsigned int size) {
size /= sizeof(t);
t *ptr = arr;
while (size--) {
*ptr = val;
ptr++;
}
}
const int mod = 1e9 + 7;
int add(int a, int b) { return (a + b... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename t> void myMemset(t *arr, t val, unsigned int size) {
size /= sizeof(t);
t *ptr = arr;
while (size--) {
*ptr = val;
ptr++;
}
}
const int mod = 1e9 + 7;
int add(int a, int b) { return (a + b... | replace | 66 | 67 | 66 | 67 | TLE | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inv2 = 500000004;
const int MAXN = 200005;
int n, ans, pw2[MAXN];
int fir[MAXN], to[MAXN << 1], nxt[MAXN], cnt;
inline void link(int u, int v) {
to[++cnt] = v;
nxt[cnt] = fir[u];
fir[u] = cnt;
to[++cnt] = u;
nxt[cnt] = fir[v];
... | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inv2 = 500000004;
const int MAXN = 200005;
int n, ans, pw2[MAXN];
int fir[MAXN], to[MAXN << 1], nxt[MAXN << 1], cnt;
inline void link(int u, int v) {
to[++cnt] = v;
nxt[cnt] = fir[u];
fir[u] = cnt;
to[++cnt] = u;
nxt[cnt] = fir[v... | replace | 6 | 7 | 6 | 7 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define HALF ((MOD + 1) / 2)
int n;
vector<int> v[100005];
int dp[100005];
long long ans;
long long po(long long b, int p) {
long long re = 1;
while (p) {
if (p % 2)
re = re * b % MOD;
b = b * b % MOD;
p /= 2;
}
return re... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define HALF ((MOD + 1) / 2)
int n;
vector<int> v[200005];
int dp[200005];
long long ans;
long long po(long long b, int p) {
long long re = 1;
while (p) {
if (p % 2)
re = re * b % MOD;
b = b * b % MOD;
p /= 2;
}
return re... | replace | 8 | 10 | 8 | 10 | 0 | |
p02822 | C++ | Runtime Error | //
// Created by 陈基彤 on 2020-01-09.
//
#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int maxn = 1e5 + 5;
const LL mod = 1e9 + 7;
vector<int> edge[maxn];
int n;
LL sum[maxn], num[maxn];
LL tt;
void dfs(int x, int fa) {
LL nows = 0, nown = 0, tot = 0;
for (auto i : edge[x])
if (i != fa)... | //
// Created by 陈基彤 on 2020-01-09.
//
#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int maxn = 2e5 + 5;
const LL mod = 1e9 + 7;
vector<int> edge[maxn];
int n;
LL sum[maxn], num[maxn];
LL tt;
void dfs(int x, int fa) {
LL nows = 0, nown = 0, tot = 0;
for (auto i : edge[x])
if (i != fa)... | replace | 6 | 7 | 6 | 7 | 0 | |
p02822 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define f first
#define s second
#define pb push_back
#define reset(a, b) memset(a, b, sizeof a);
#define ALL(x) x.begin(), x.end()
template <typename T> void cetak(T t) { cout << t << ')' << endl; }
template <typename T, typename... V> void cetak(T t, V... v) {
cout << ... | #include "bits/stdc++.h"
using namespace std;
#define f first
#define s second
#define pb push_back
#define reset(a, b) memset(a, b, sizeof a);
#define ALL(x) x.begin(), x.end()
template <typename T> void cetak(T t) { cout << t << ')' << endl; }
template <typename T, typename... V> void cetak(T t, V... v) {
cout << ... | replace | 38 | 39 | 38 | 39 | 0 | |
p02822 | C++ | Runtime Error | //----------------------------templates
#pragma GCC optimize("Ofast")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
//----------------------------
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
#define FOR(i, j, n) for (int i = (int)(j)... | //----------------------------templates
#pragma GCC optimize("Ofast")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
//----------------------------
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
#define FOR(i, j, n) for (int i = (int)(j)... | insert | 87 | 87 | 87 | 91 | 0 | 1.0 |
p02822 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include... | #include <algorithm>
#include <array>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include... | replace | 48 | 57 | 48 | 52 | TLE | |
p02822 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include... | #include <algorithm>
#include <array>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include... | replace | 35 | 44 | 35 | 39 | TLE | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using P = pair<int, int>;
using namespace std;
const ll mod = 1e9 + 7;
ll mod_pow(ll x, ll n) {
ll ret = 1;
while (n) {
if (n & 1) {
ret = ret * x % mod;
x = x * x % mod;... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i))
using ll = long long;
using P = pair<int, int>;
using namespace std;
const ll mod = 1e9 + 7;
ll mod_pow(ll x, ll n) {
ll ret = 1;
while (n) {
if (n & 1) {
ret = ret * x % mod;
x = x * x % mod;... | replace | 25 | 26 | 25 | 26 | 0 | |
p02822 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const int MAX_N = 200000;
map<pair<int, int>, int> mp;
// mp[make_pair(i, j)] iから見てjの先にあるnodeの数
vector<int> edge[MAX_N];
int N;
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
wh... | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const int MAX_N = 200000;
map<pair<int, int>, int> mp;
// mp[make_pair(i, j)] iから見てjの先にあるnodeの数
vector<int> edge[MAX_N];
int N;
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
wh... | insert | 40 | 40 | 40 | 41 | TLE | |
p02822 | C++ | Time Limit Exceeded | // https://atcoder.jp/contests/abc149/tasks/abc149_f
#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i... | // https://atcoder.jp/contests/abc149/tasks/abc149_f
#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i... | insert | 112 | 112 | 112 | 114 | TLE | |
p02822 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | delete | 1,861 | 1,862 | 1,861 | 1,861 | 0 | |
p02822 | C++ | Runtime Error | // Words are flowing out like endless rain into a paper cup
// They slither while they pass they slip away across the universe
// Pools of sorrow, waves of joy are drifting through my open mind
// Possessing and caressing me
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
namespace _buff {
const... | // Words are flowing out like endless rain into a paper cup
// They slither while they pass they slip away across the universe
// Pools of sorrow, waves of joy are drifting through my open mind
// Possessing and caressing me
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
namespace _buff {
const... | replace | 42 | 43 | 42 | 43 | 0 | |
p02822 | 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;
using P = pair<int, int>;
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 100000... | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 100000... | replace | 52 | 53 | 52 | 53 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define int long long
int n;
vector<int> graph[100010];
int dp1[200010];
int dp2[200010];
int zi[200010];
int pow_mod(int i, int j) {
int ans = 1;
while (j > 0) {
if (j & 1)
ans = (ans * i) % MOD;
i = (i * i) % MOD;
j >>= 1... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define int long long
int n;
vector<int> graph[200010];
int dp1[200010];
int dp2[200010];
int zi[200010];
int pow_mod(int i, int j) {
int ans = 1;
while (j > 0) {
if (j & 1)
ans = (ans * i) % MOD;
i = (i * i) % MOD;
j >>= 1... | replace | 8 | 9 | 8 | 9 | 0 | |
p02822 | C++ | Runtime Error | /*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define printa(x, n) ... | /*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define printa(x, n) ... | replace | 18 | 19 | 18 | 19 | 0 | |
p02822 | Python | Time Limit Exceeded | import sys
from collections import deque
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
def main():
MOD = 1000000007
N, *AB = map(int, read().split())
G = [[] for _ in range(N)]
for a, b in zip(AB[::2], AB[1::2]):
... | import sys
from collections import deque
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
def main():
MOD = 1000000007
N, *AB = map(int, read().split())
G = [[] for _ in range(N)]
for a, b in zip(AB[::2], AB[1::2]):
... | replace | 33 | 34 | 33 | 34 | TLE | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%lld", &x)
#define p... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%lld", &x)
#define p... | replace | 38 | 39 | 38 | 39 | 0 | |
p02822 | C++ | Runtime Error | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define For(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define rFor(i, a, b) for (int(i) = (a)-1; (i) >= (b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define For(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define rFor(i, a, b) for (int(i) = (a)-1; (i) >= (b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
... | replace | 32 | 33 | 32 | 33 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;
using lli = long long int;
template <signed M, unsigned T> struct mod_int {
constexpr static signed MODULO = M;
constexpr static unsigned TABLE_SIZE = T;
signed x;
... | #include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;
using lli = long long int;
template <signed M, unsigned T> struct mod_int {
constexpr static signed MODULO = M;
constexpr static unsigned TABLE_SIZE = T;
signed x;
... | replace | 166 | 167 | 166 | 167 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
co... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
co... | replace | 18 | 21 | 18 | 21 | 0 | |
p02822 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
#define mod 1000000007
using name... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
#define mod 1000000007
using name... | replace | 28 | 37 | 28 | 36 | TLE | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> Childnum(100000, -1);
vector<vector<int>> Child(100000, vector<int>(0));
// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
... | #include <bits/stdc++.h>
using namespace std;
vector<int> Childnum(200005, -1);
vector<vector<int>> Child(200005, vector<int>(0));
// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
... | replace | 2 | 4 | 2 | 4 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> boo... | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> boo... | replace | 46 | 47 | 46 | 47 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5 + 10, inf = 1e9, MOD = 1e9 + 7;
int a[N], sz[N], n, ans, X;
vector<int> g[N];
int Pow(int a, int m) {
if (m == 0)
return 1;
int x = Pow(a, m / 2);
return (((x * x) % MOD) * (m % 2 ? a : 1)) % MOD;
}
int dfs(int v, int p =... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 10, inf = 1e9, MOD = 1e9 + 7;
int a[N], sz[N], n, ans, X;
vector<int> g[N];
int Pow(int a, int m) {
if (m == 0)
return 1;
int x = Pow(a, m / 2);
return (((x * x) % MOD) * (m % 2 ? a : 1)) % MOD;
}
int dfs(int v, int p =... | replace | 4 | 5 | 4 | 5 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
const ll mod = 1e9 + 7;
ll mu(ll a, ll b) { return (ll)a * b % mod; }
ll ad(ll a, ll b) {
if ((a += b) >= ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
const ll mod = 1e9 + 7;
ll mu(ll a, ll b) { return (ll)a * b % mod; }
ll ad(ll a, ll b) {
if ((a += b) >= ... | replace | 24 | 25 | 24 | 25 | 0 | |
p02822 | C++ | Runtime Error | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>... | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>... | replace | 853 | 854 | 853 | 854 | 0 | |
p02822 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
class ModInt {
public:
static int _BM;
long long int m_value;
ModInt() { m_value = 0; }
ModInt(int v) { m_value = (long long int)v; }
ModInt(const ModInt &t) { m_value = t.getint(); }
int operator+(const ModInt &t) {
return ModInt::mo... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
class ModInt {
public:
static int _BM;
long long int m_value;
ModInt() { m_value = 0; }
ModInt(int v) { m_value = (long long int)v; }
ModInt(const ModInt &t) { m_value = t.getint(); }
int operator+(const ModInt &t) {
return ModInt::mo... | replace | 136 | 138 | 136 | 138 | 0 | |
p02822 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long LL;
const int M = 1e5 + 5;
const int MO = 1e9 + 7;
int add(int x, int y) {
x += y;
if (x >= MO)
x -= MO;
return x;
}
int sub(int x, int y) {
x -= y;
if (x < 0)
x += MO;
return x;
}
... | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long LL;
const int M = 2e5 + 5;
const int MO = 1e9 + 7;
int add(int x, int y) {
x += y;
if (x >= MO)
x -= MO;
return x;
}
int sub(int x, int y) {
x -= y;
if (x < 0)
x += MO;
return x;
}
... | replace | 7 | 8 | 7 | 8 | 0 | |
p02823 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(), (x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(), (x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a... | replace | 34 | 35 | 34 | 52 | 0 | |
p02823 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll ans = 0;
if ((b - a) % 2 == 0) {
ans = (b - a) / 2... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll ans = 0;
if ((b - a) % 2 == 0) {
ans = (b - a) / 2... | replace | 20 | 28 | 20 | 21 | TLE | |
p02823 | C++ | Time Limit Exceeded | /********************************************************************************
Code by a weak man who named CYJian, and he hope the code can get more
points.
Algorithm:
********************************************************************************/
#include <bits/stdc++.h>
using namespace st... | /********************************************************************************
Code by a weak man who named CYJian, and he hope the code can get more
points.
Algorithm:
********************************************************************************/
#include <bits/stdc++.h>
using namespace st... | delete | 47 | 50 | 47 | 47 | TLE | |
p02823 | Python | Runtime Error | def main():
N, A, B = [int(i) for i in input().split()]
diff = B - A
if diff % 2 == 0:
ans = diff // 2
else:
ans = min(
B - 1, N - A, (A - 1) + 1 + (diff - 1) // 2, (N - B) + 1(diff - 1) // 2
)
print(ans)
if __name__ == "__main__":
main()
| def main():
N, A, B = [int(i) for i in input().split()]
diff = B - A
if diff % 2 == 0:
ans = diff // 2
else:
ans = min(
B - 1, N - A, (A - 1) + 1 + (diff - 1) // 2, (N - B) + 1 + (diff - 1) // 2
)
print(ans)
if __name__ == "__main__":
main()
| replace | 7 | 8 | 7 | 8 | 0 | /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02823/Python/s158682603.py:7: SyntaxWarning: 'int' object is not callable; perhaps you missed a comma?
ans = min(B - 1, N - A, (A - 1) + 1 + (diff - 1) // 2, (N - B) + 1 (diff - 1) // 2)
|
p02823 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long int64;
int64 solve(int64 N, int64 A, int64 B) {
if ((B - A) % 2 == 0)
return (B - A) / 2;
int64 ret = min(B - 1, N - A);
ret = min(ret, solve(N, 1, N - A) + A);
ret = min(ret, solve(N, A + (N - B) + 1, N) + (N -... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long int64;
int64 solve(int64 N, int64 A, int64 B) {
if ((B - A) % 2 == 0)
return (B - A) / 2;
int64 ret = min(B - 1, N - A);
ret = min(ret, solve(N, 1, B - A) + A);
ret = min(ret, solve(N, A + (N - B) + 1, N) + (N -... | replace | 9 | 10 | 9 | 10 | 0 | |
p02823 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const ll N = 5e5 + 5;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n, a, b;
cin >> n >> a >> b;
ll ans = min(b - 1, n - a);
if (a % 2 == b % 2)
ans = min(ans, (b - a) / 2);
if (a % 2 !=... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const ll N = 5e5 + 5;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n, a, b;
cin >> n >> a >> b;
ll ans = min(b - 1, n - a);
if (a % 2 == b % 2)
ans = min(ans, (b - a) / 2);
else {
ll... | replace | 14 | 19 | 14 | 19 | TLE | |
p02823 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
#define REP(i, n) for (int i = 0; i < n; ++i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
#define REP(i, n) for (int i = 0; i < n; ++i... | replace | 44 | 46 | 44 | 62 | 0 | |
p02823 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int N, A, B;
cin >> N >> A >> B;
assert(A != B);
if (A > B)
swap(A, B);
assert(A < B);
if (A % 2 == B % 2) {
cout << (B - A) / 2 << '\n';
} else {
cout << min((N - B) + 1 + (N -... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
long long N, A, B;
cin >> N >> A >> B;
assert(A != B);
if (A > B)
swap(A, B);
assert(A < B);
if (A % 2 == B % 2) {
cout << (B - A) / 2 << '\n';
} else {
cout << min((N - B) + 1 ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02823 | C++ | Time Limit Exceeded | // include
//------------------------------------------
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list... | // include
//------------------------------------------
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list... | replace | 110 | 137 | 110 | 111 | TLE | |
p02823 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define rgi register int
#define rgl register ll
#define int ll
#define maxn 1000005
#define mod 10007LL
#define inf 1000000007LL
namespace lib {
using namespace std;
class fastio {
private:
#define _NUMLEN 111
char _num[_NUMLEN], _ch;
int _f, _head;
bool _useSTD;
pu... | #include <bits/stdc++.h>
#define ll long long
#define rgi register int
#define rgl register ll
#define int ll
#define maxn 1000005
#define mod 10007LL
#define inf 1000000007LL
namespace lib {
using namespace std;
class fastio {
private:
#define _NUMLEN 111
char _num[_NUMLEN], _ch;
int _f, _head;
bool _useSTD;
pu... | replace | 98 | 99 | 98 | 99 | 1 | |
p02823 | C++ | Runtime Error | // BUGSBUNNY
// IIT ROORKEE
// _,add8ba,
// ,d888888888b,
// d8888888888888b _,ad8ba,_
// d888888888888888) ,d888888888b,
// I88888888888888... | // BUGSBUNNY
// IIT ROORKEE
// _,add8ba,
// ,d888888888b,
// d8888888888888b _,ad8ba,_
// d888888888888888) ,d888888888b,
// I88888888888888... | replace | 97 | 101 | 97 | 101 | 0 | |
p02823 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <map>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ll N, A, B;
cin >> N >> A >> B;
ll ans;
if ((B - A) % 2 == 0)
ans... | #include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <map>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ll N, A, B;
cin >> N >> A >> B;
ll ans;
if ((B - A) % 2 == 0)
ans... | replace | 21 | 24 | 21 | 22 | TLE | |
p02824 | C++ | Runtime Error | #define STOPIT
#include <bits/stdc++.h>
#define loop(n) \
for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); \
ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(... | #define STOPIT
#include <bits/stdc++.h>
#define loop(n) \
for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); \
ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(... | replace | 112 | 113 | 112 | 113 | 0 | |
p02824 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <time.h>
using namespace std;
typedef long long ll;
int n, m, v, p, a[100005], b[100005], ans, pth_min;
bool judge(int pth) {
ll res = 0;
int i;
for (i = 1; i <= n; i++)
b[i] = min(m, pth - a[i]);
sort(b + 1, b + n + 1);
... | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <time.h>
using namespace std;
typedef long long ll;
int n, m, v, p, a[100005], b[100005], ans, pth_min;
bool judge(int pth) {
ll res = 0;
int i;
for (i = 1; i <= n; i++)
b[i] = min(m, pth - a[i]);
sort(b + 1, b + n + 1);
... | replace | 23 | 24 | 23 | 24 | TLE | |
p02824 | 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;
using P = pair<int, int>;
int n, m, v, p, a[100010];
bool calc(int mid, ll cnt = 0) {
int x = a[mid] + m;
if (a[p - 1] > x)
return false;
cnt += (ll)(p - 1) * m;
cnt += (ll)(n - mid) * m;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int n, m, v, p, a[100010];
bool calc(int mid, ll cnt = 0) {
int x = a[mid] + m;
if (a[p - 1] > x)
return false;
cnt += (ll)(p - 1) * m;
cnt += (ll)(n - mid) * m;
... | replace | 14 | 15 | 14 | 15 | 0 | |
p02824 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;
template <class T> void debug(T itr1, T itr2) {
auto now = itr1;
while (now < itr2) {
cout << *now << " ";
now++;
}
cout << endl;
}
#define repr(i, from, to) for (int i = (int)from; i < (int)to; i++)
#define... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;
template <class T> void debug(T itr1, T itr2) {
auto now = itr1;
while (now < itr2) {
cout << *now << " ";
now++;
}
cout << endl;
}
#define repr(i, from, to) for (int i = (int)from; i < (int)to; i++)
#define... | insert | 33 | 33 | 33 | 34 | TLE | |
p02824 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair<int, int>
#define F first
#define S second
#define int long long int
#define sync \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair<int, int>
#define F first
#define S second
#define int long long int
#define sync \
ios_base::sync_with_stdio(false); ... | insert | 70 | 70 | 70 | 73 | 0 | |
p02824 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, int> pdi;
const ll INF = 2e18;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;
... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, int> pdi;
const ll INF = 2e18;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;
... | delete | 35 | 37 | 35 | 35 | 0 | |
p02824 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 10005;
inline int read() {
int ret, f = 1;
char c;
while ((c = getchar()) && (c < '0' || c > '9'))
if (c == '-')
f = -1;
ret = c - '0';
while ((c = getchar()) &&... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 100005;
inline int read() {
int ret, f = 1;
char c;
while ((c = getchar()) && (c < '0' || c > '9'))
if (c == '-')
f = -1;
ret = c - '0';
while ((c = getchar()) &... | replace | 6 | 7 | 6 | 7 | 0 | |
p02824 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vb vector<b... | #include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vb vector<b... | replace | 133 | 135 | 133 | 137 | 5 | |
p02824 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#define mxn 10010
#define pii pair<int, int>
#define fr first
#define sc second
#define mp make_pair
#define LL long long
using namespace std;
const int mod = 1e9 + 7;
int n, m, K, N, sl, fh, ans, a[mxn];
LL s[mxn];
int rd() {
sl = 0;
fh = 1;
char ch = getchar();
while (ch... | #include <algorithm>
#include <cstdio>
#define mxn 1000010
#define pii pair<int, int>
#define fr first
#define sc second
#define mp make_pair
#define LL long long
using namespace std;
const int mod = 1e9 + 7;
int n, m, K, N, sl, fh, ans, a[mxn];
LL s[mxn];
int rd() {
sl = 0;
fh = 1;
char ch = getchar();
while (... | replace | 2 | 3 | 2 | 3 | 0 | |
p02824 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 100005;
int n, m, v, p, a[maxn], ans;
ll b[maxn];
inline int cmp1(int x, int y) { return x > y; }
inline int read() {
int res = 0, f_f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
f_f = -1;
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 100005;
int n, m, v, p, a[maxn], ans;
ll b[maxn];
inline int cmp1(int x, int y) { return x > y; }
inline int read() {
int res = 0, f_f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
f_f = -1;
... | delete | 20 | 22 | 20 | 20 | TLE | |
p02824 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const double PI = 3.14159265358979;
const ll INF = pow(10, 18);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, n) FOR(i, 0, n)
string abc ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const double PI = 3.14159265358979;
const ll INF = pow(10, 18);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, n) FOR(i, 0, n)
string abc ... | replace | 20 | 21 | 20 | 21 | TLE | |
p02824 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, m, v, p;
cin >> n >> m >> v >> p;
vector<ll> a(n);
vector<ll> ruiseki(n);
ll tmp; // cin >> tmp;
// a.at(0) = tmp;
// ruiseki.at(0) = tmp;
for (ll i = 0; i < n; i++) {
cin >> tmp;
a.at(i) = tmp;
// ruisek... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, m, v, p;
cin >> n >> m >> v >> p;
vector<ll> a(n);
vector<ll> ruiseki(n);
ll tmp; // cin >> tmp;
// a.at(0) = tmp;
// ruiseki.at(0) = tmp;
for (ll i = 0; i < n; i++) {
cin >> tmp;
a.at(i) = tmp;
// ruisek... | replace | 25 | 29 | 25 | 38 | 0 | |
p02824 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define uint unsigned int
#if 0
const int MOD = (int) ;
inline int lgput(int a, int b) {
int ans = 1;
while(b > 0) {
if(b & 1) ans = (1LL * ans * a) % MOD;
b >>= 1;
a = (1LL * a * a) ... | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define uint unsigned int
#if 0
const int MOD = (int) ;
inline int lgput(int a, int b) {
int ans = 1;
while(b > 0) {
if(b & 1) ans = (1LL * ans * a) % MOD;
b >>= 1;
a = (1LL * a * a) ... | replace | 131 | 132 | 131 | 136 | TLE | |
p02824 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;
int main() {
ll n, m, v, p;
cin >> n >> m >> v >> p;
vector<ll> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
sort(a.begin(), a.end(), greater<ll... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;
int main() {
ll n, m, v, p;
cin >> n >> m >> v >> p;
vector<ll> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
sort(a.begin(), a.end(), greater<ll... | replace | 39 | 40 | 39 | 42 | 0 | |
p02824 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
long long Sum[100005], A[100005];
long long extra(int poz, int len, int init) {
return (Sum[poz] - Sum[poz - len]) - 1LL * len * init;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m, v, p;
cin >> n >> m >> v >>... | #include <algorithm>
#include <iostream>
using namespace std;
long long Sum[100005], A[100005];
long long extra(int poz, int len, int init) {
return (Sum[poz] - Sum[poz - len]) - 1LL * len * init;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m, v, p;
cin >> n >> m >> v >>... | replace | 29 | 30 | 29 | 30 | -11 | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fst first
#define sec second
#define MAX_N (1 << 20)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rer(i, a, b) for (int i = a - 1; i >= b; i--)
#define sz(a) int(a.size())
using namespace std;
typedef vector<int> vi;
typedef long long int ll;
const ll linf = (1ll << 60);
i... | #include <bits/stdc++.h>
#define fst first
#define sec second
#define MAX_N (1 << 20)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rer(i, a, b) for (int i = a - 1; i >= b; i--)
#define sz(a) int(a.size())
using namespace std;
typedef vector<int> vi;
typedef long long int ll;
const ll linf = (1ll << 60);
i... | replace | 66 | 67 | 66 | 67 | 0 | |
p02825 | C++ | Runtime Error | #include <algorithm>
#include <chrono>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
using namespace std;
int n;
using TField = vector<string>;
TField GetFi... | #include <algorithm>
#include <chrono>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
using namespace std;
int n;
using TField = vector<string>;
TField GetFi... | replace | 53 | 54 | 53 | 54 | -11 | |
p02825 | C++ | Runtime Error | #include <iostream>
#include <string>
int n, k;
std::string s[4][7] = {
{"aacd", "bbcd", "cdaa", "cdbb"},
{"aa.ab", ".bbab", "a.cca", "a.a.a", "bbabb"},
{"aacd..", "bbcd..", "cd..aa", "cd..bb", "..aacd", "..bbcd"},
{"aacd...", "bbcd...", "cd.aa..", "cd...bb", "..a.baa", "..a.b.b",
"..bbaab"}};
int ... | #include <iostream>
#include <string>
int n, k;
std::string s[4][7] = {
{"aacd", "bbcd", "cdaa", "cdbb"},
{"aa.ab", ".bbab", "a.cca", "a.a.a", "bbabb"},
{"aacd..", "bbcd..", "cd..aa", "cd..bb", "..aacd", "..bbcd"},
{"aacd...", "bbcd...", "cd.aa..", "cd...bb", "..a.baa", "..a.b.b",
"..bbaab"}};
int ... | replace | 16 | 17 | 16 | 17 | 0 | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using uint = unsigned int;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rep1(i, n) for (int i = 1; i <= int(n); i++)
#define per(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define per1(i, n) for (int i = int(n); i > 0; i--)
#define all(c... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using uint = unsigned int;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rep1(i, n) for (int i = 1; i <= int(n); i++)
#define per(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define per1(i, n) for (int i = int(n); i > 0; i--)
#define all(c... | replace | 70 | 72 | 70 | 116 | -6 | 0005cd30-2319-43d2-84bf-696125f62b3b.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02825/C++/s218399334.cpp:53: int main(): Assertion `N == 5' failed.
|
p02825 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define Inf 1000000000
#define nmax_def 110000
#define mod 1000000007
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace s... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define Inf 1000000000
#define nmax_def 110000
#define mod 1000000007
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace s... | insert | 36 | 36 | 36 | 46 | 0 | |
p02825 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;
vector<string> three = {"a..", "a..", ".bb"};
vector<string> four = {"ahff", "ahgg", "bbde", "ccde"};
vector<string> five = {"ahhgg", "ai..f", "bi..f", "b.jje", "ccdde"}... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;
vector<string> three = {"a..", "a..", ".bb"};
vector<string> four = {"ahff", "ahgg", "bbde", "ccde"};
vector<string> five = {"ahhgg", "ai..f", "bi..f", "b.jje", "ccdde"}... | insert | 64 | 64 | 64 | 65 | TLE | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a) for (int i = 0; i < (a); i++)
#define ALL(a) (a).begin(), (a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
signed main() {
int n;
cin >> n;
if (n < 3) {
co... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a) for (int i = 0; i < (a); i++)
#define ALL(a) (a).begin(), (a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
signed main() {
int n;
cin >> n;
if (n < 3) {
co... | replace | 17 | 33 | 17 | 22 | 0 | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
if (n == 2) {
puts("-1");
return 0;
}
if (n == 3) {
puts("aa.");
puts("..b");
puts("..b");
return 0;
}
vector<vector<int>> p(n, vector<int>(n, -1));
vector<int> col(n), row(n);
function<void(i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
if (n == 2) {
puts("-1");
return 0;
}
if (n == 3) {
puts("aa.");
puts("..b");
puts("..b");
return 0;
}
vector<vector<int>> p(n, vector<int>(n, -1));
vector<int> col(n), row(n);
function<void(i... | replace | 78 | 79 | 78 | 79 | 0 | |
p02825 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
int main() {
int N;
cin >> N;
if (N == 2) {
cout << -1 << endl;
return 0;
}
if (N == 3) {
cout << "aa.\n..b\n..b\n";
return 0;
}
if (N == 6) {
cout << "aa....\n..b...\n..b...\n...aa.\n.....b\n.....b\n";
return 0;
}
if (N == 7) {
... | #include "bits/stdc++.h"
using namespace std;
int main() {
int N;
cin >> N;
if (N == 2) {
cout << -1 << endl;
return 0;
}
if (N == 3) {
cout << "aa.\n..b\n..b\n";
return 0;
}
if (N == 6) {
cout << "aa....\n..b...\n..b...\n...aa.\n.....b\n.....b\n";
return 0;
}
if (N == 7) {
... | insert | 26 | 26 | 26 | 27 | 0 | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) {
string sep = " ";
if (v.size())
os << v[0];
for (int i = 1; i < v.size(); i++)
os << sep << v[i];
return os;
}
template <typename T> istream &operator>>(istream &i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) {
string sep = " ";
if (v.size())
os << v[0];
for (int i = 1; i < v.size(); i++)
os << sep << v[i];
return os;
}
template <typename T> istream &operator>>(istream &i... | insert | 155 | 155 | 155 | 156 | 0 | |
p02825 | C++ | Runtime Error | #include <stdio.h>
char board[30][30];
int main() {
bool f;
int n;
scanf("%d", &n);
if (n < 3)
printf("-1\n");
else if (n == 4) {
printf("aabd\nccbd\nbdaa\nbdcc\n");
} else if (n % 3 == 0) {
for (int i = 1; i <= n; i += 3) {
for (int j = 1; j <= n; j += 3)
printf("a..");
pr... | #include <stdio.h>
char board[1010][1010];
int main() {
bool f;
int n;
scanf("%d", &n);
if (n < 3)
printf("-1\n");
else if (n == 4) {
printf("aabd\nccbd\nbdaa\nbdcc\n");
} else if (n % 3 == 0) {
for (int i = 1; i <= n; i += 3) {
for (int j = 1; j <= n; j += 3)
printf("a..");
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define all(x) begin(x), end(x)
typedef long long ll;
const int MAX_N = 1024;
char ans[MAX_N][MAX_N];
char for4[][5] = {"aacd", "bbcd", "efgg", "efhh"};
char for5[][6] = {"aabbc", "hii.c", "h..jd", "g..jd", "gffee"};
signed main() {
i... | #include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define all(x) begin(x), end(x)
typedef long long ll;
const int MAX_N = 1024;
char ans[MAX_N][MAX_N];
char for4[][5] = {"aacd", "bbcd", "efgg", "efhh"};
char for5[][6] = {"aabbc", "hii.c", "h..jd", "g..jd", "gffee"};
signed main() {
i... | replace | 26 | 28 | 26 | 49 | 0 | |
p02825 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
char ans[1000][1000];
vector<vector<char>> b3 = {{'.', 'a', 'a'}, {'b', '.', '.'}, {'b', '.', '.'}};
vector<vector<char>> b4 = {{'a', 'a', 'c', 'd'}... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
char ans[1000][1000];
vector<vector<char>> b3 = {{'.', 'a', 'a'}, {'b', '.', '.'}, {'b', '.', '.'}};
vector<vector<char>> b4 = {{'a', 'a', 'c', 'd'}... | replace | 105 | 106 | 105 | 106 | 0 | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
#define For(i, x, y) for (register int i = (x); i <= (y); i++)
#define FOR(i, x, y) for (register int i = (x); i < (y); i++)
#define Dow(i, x, y) for (register int i = (x); i >= (y); i--)
#define Debug(v) \
for (auto i : v) ... | #include <bits/stdc++.h>
#define For(i, x, y) for (register int i = (x); i <= (y); i++)
#define FOR(i, x, y) for (register int i = (x); i < (y); i++)
#define Dow(i, x, y) for (register int i = (x); i >= (y); i--)
#define Debug(v) \
for (auto i : v) ... | replace | 77 | 78 | 77 | 78 | 0 | |
p02825 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(long long N) {
if (N == 7 || N == 11) {
abort();
}
}
int main() {
long long N;
scanf("%lld", &N);
solve(N);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(long long N) {
if (N == 7) {
cout << "a..aabb" << endl;
cout << "abb..d." << endl;
cout << "c...cd." << endl;
cout << "c...c.a" << endl;
cout << ".abb..a" << endl;
cout << ".a..eeb" << endl;
cout << "eeff..b" <... | replace | 5 | 7 | 5 | 123 | 0 | |
p02826 | Python | Time Limit Exceeded | import numpy as np
n, m = map(int, input().split())
coef = np.minimum(np.arange(n, 1, -1), np.arange(1, n))
dp = np.zeros(n, dtype=np.int64)
dp[0] = 1
for c in coef:
w = np.zeros(n, dtype=np.int64)
w[::c] = 1
dp = np.convolve(dp, w, mode="full")[:n] % m
print((dp * np.arange(n, 0, -1) % m).sum() % m)
| import numpy as np
n, m = map(int, input().split())
coef = np.minimum(np.arange(n, 1, -1), np.arange(1, n))
dp = np.zeros(n, dtype=np.int64)
dp[0] = 1
for c in coef:
ndp = np.zeros(n, dtype=np.int64)
for i in range(0, n, c):
ndp[i:] += dp[: n - i]
dp = ndp % m
print((dp * np.arange(n, 0, -1) % m)... | replace | 8 | 11 | 8 | 12 | TLE | |
p02826 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), ... | #include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), ... | replace | 54 | 55 | 54 | 55 | 0 | Time: 0.033507 s.
|
p02826 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
#define INF (1 << 29)
#define LINF (1LL << 60)
#define EPS (1e-10)
typedef long long Int;
typedef pa... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
#define INF (1 << 29)
#define LINF (1LL << 60)
#define EPS (1e-10)
typedef long long Int;
typedef pa... | replace | 32 | 37 | 32 | 35 | TLE | |
p02826 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mod 998244353
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3fll
typedef long long ll;
typedef pair<int, int> pii;
typedef unsigned long long ull;
int n;
int M;
int dp[2][5005][5005];
inline void add(int &a, int b) {
a += b;
if (a >=... | #include <bits/stdc++.h>
using namespace std;
#define mod 998244353
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3fll
typedef long long ll;
typedef pair<int, int> pii;
typedef unsigned long long ull;
int n;
int M;
int dp[2][5005][5005];
inline void add(int &a, int b) {
a += b;
if (a >=... | replace | 26 | 27 | 26 | 27 | -11 | |
p02827 | C++ | Runtime Error | #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 | 93 | 94 | 93 | 94 | 0 | |
p02827 | C++ | Runtime Error | // #include"stdafx.h"
#include <algorithm>
#include <bitset>
#include <cassert>
#include <fstream>
#include <iostream>
#include <map>
#include <random>
#include <set>
#include <string>
#include <vector>
using namespace std;
// int mod = 998244353;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int... | // #include"stdafx.h"
#include <algorithm>
#include <bitset>
#include <cassert>
#include <fstream>
#include <iostream>
#include <map>
#include <random>
#include <set>
#include <string>
#include <vector>
using namespace std;
// int mod = 998244353;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int... | replace | 122 | 123 | 122 | 123 | 0 | |
p02827 | C++ | Runtime Error | #include <bits/stdc++.h>
#define Tp template <typename Ty>
#define Ts template <typename Ty, typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int &
#define I inline
#define W while
#define N 50000
#define M 100000
using namespace std;
int n, m, op, a[M + 5], b[M + 5];
char ans[N ... | #include <bits/stdc++.h>
#define Tp template <typename Ty>
#define Ts template <typename Ty, typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int &
#define I inline
#define W while
#define N 50000
#define M 100000
using namespace std;
int n, m, op, a[M + 5], b[M + 5];
char ans[M ... | replace | 13 | 14 | 13 | 14 | -11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.