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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define N 1010
#define ll long long
const ll mod = 1e9 + 7;
int n, m, s1, s2, cnt;
int a[N], b[N], h[N], l[N];
ll ans = 1;
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
if (h[a[i]])
return puts("0"), 0;
h[a[i]... | #include <bits/stdc++.h>
using namespace std;
#define N 1010
#define ll long long
const ll mod = 1e9 + 7;
int n, m, s1, s2, cnt;
int a[N], b[N], h[N * N], l[N * N];
ll ans = 1;
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
if (h[a[i]])
return puts("0"), 0;
... | replace | 7 | 8 | 7 | 8 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1005, mod = 1e9 + 7;
ll r[N], c[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, m;
cin >> n >> m;
for (ll i = 1; i <= n; i++) {
ll x;
cin >> x;
if (r[x])
return cout << "0", 0;
r[x] =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e6 + 5, mod = 1e9 + 7;
int r[N], c[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, m;
cin >> n >> m;
for (ll i = 1; i <= n; i++) {
ll x;
cin >> x;
if (r[x])
return cout << "0", 0;
r[... | replace | 3 | 5 | 3 | 5 | 0 | |
p03152 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = x * 10 + c - '0';
c = getchar();
}
return x * f;
... | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = x * 10 + c - '0';
c = getchar();
}
return x * f;
... | replace | 21 | 22 | 21 | 22 | 0 | |
p03152 | C++ | Runtime Error | // :)
// "Khodaya, be man "Tagwaye setiz" biamooz ta
// dar anbuh masuliat nalaghzam ..." -Shariati
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define MP make_pair
using namespace std;
using namespace __gnu_pbds;
template <typ... | // :)
// "Khodaya, be man "Tagwaye setiz" biamooz ta
// dar anbuh masuliat nalaghzam ..." -Shariati
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define MP make_pair
using namespace std;
using namespace __gnu_pbds;
template <typ... | replace | 24 | 25 | 24 | 25 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define MAX_N 200010
long long inv[MAX_N];
long long factorial[MAX_N];
long long inv_factorial[MAX_N];
void getInv() {
for (int i = 1; i < MAX_N; i++) {
if (i == 1)
inv[i] = 1;
else {
inv[i] = (mod - (mod / i) * inv[mod % i]) % ... | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define MAX_N 1000010
long long inv[MAX_N];
long long factorial[MAX_N];
long long inv_factorial[MAX_N];
void getInv() {
for (int i = 1; i < MAX_N; i++) {
if (i == 1)
inv[i] = 1;
else {
inv[i] = (mod - (mod / i) * inv[mod % i]) %... | replace | 3 | 4 | 3 | 4 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {
ll i, j;
ll n, m;
cin >> n >> m;
vector<ll> a(n);
for (i = 0; i < n; ++i) {
cin >> a.at(i);
}
vector<ll> b(m);
for (i = 0; i < m; ++i) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {
ll i, j;
ll n, m;
cin >> n >> m;
vector<ll> a(n);
for (i = 0; i < n; ++i) {
cin >> a.at(i);
}
vector<ll> b(m);
for (i = 0; i < m; ++i) {
... | insert | 38 | 38 | 38 | 42 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
template <class T> inline bool chmax(T &a, T b) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
template <class T> inline bool chmax(T &a, T b) ... | replace | 144 | 145 | 144 | 145 | 0 | |
p03152 | C++ | Runtime Error |
#include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <vector>
long long mod = 1e9 + 7;
class Mint {
public:
long long x;
Mint(){}; // ... |
#include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <vector>
long long mod = 1e9 + 7;
class Mint {
public:
long long x;
Mint(){}; // ... | replace | 113 | 115 | 113 | 115 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 100 * 1000 + 10, mod = 1e9 + 7;
int r[N], c[N];
long long ans = 1, sr, sc, cnt;
int main() {
int n, m;
cin >> n >> m;
memset(r, -1, sizeof(r));
memset(c, -1, sizeof(c));
for (int i = 0; i < n; i++) {
int x;
cin >> x;
x--;
if (r[x] != ... | #include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 1000 + 10, mod = 1e9 + 7;
int r[N], c[N];
long long ans = 1, sr, sc, cnt;
int main() {
int n, m;
cin >> n >> m;
memset(r, -1, sizeof(r));
memset(c, -1, sizeof(c));
for (int i = 0; i < n; i++) {
int x;
cin >> x;
x--;
if (r[x] !=... | replace | 2 | 3 | 2 | 3 | 0 | |
p03152 | C++ | Runtime Error | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// #include <math.h>
#include <algorithm>
#include <vector>
typedef long long ll;
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
#define MOD 1000000007
int main(int argc, char *argv[]) {
long n, m;... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// #include <math.h>
#include <algorithm>
#include <vector>
typedef long long ll;
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
#define MOD 1000000007
int main(int argc, char *argv[]) {
long n, m;... | replace | 20 | 22 | 20 | 21 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
#define Int int64_t
using namespace std;
int main() {
const Int MOD = 1e9 + 7;
int N, M;
cin >> N >> M;
vector<int> a(N), b(M);
vector<Int> cnt_a(100010, 0), cnt_b(100010, 0);
bool ok = true;
for (int i = 0; i < N; ++i) {
cin >> a[i];
++cnt_a[a[i]];
if (cnt_a[a[i]] >... | #include <bits/stdc++.h>
#define Int int64_t
using namespace std;
int main() {
const Int MOD = 1e9 + 7;
int N, M;
cin >> N >> M;
vector<int> a(N), b(M);
vector<Int> cnt_a(1000010, 0), cnt_b(1000010, 0);
bool ok = true;
for (int i = 0; i < N; ++i) {
cin >> a[i];
++cnt_a[a[i]];
if (cnt_a[a[i]]... | replace | 10 | 11 | 10 | 11 | 0 | |
p03152 | C++ | Runtime Error | #ifdef __LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template <typename T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define... | #ifdef __LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template <typename T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define... | replace | 80 | 82 | 80 | 82 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N), B(N);
for (int i = 0; i < N; i++)
cin >> A[i];
for (int i = 0; i < M; i++)
cin >> B[i];
sort(A.begin(), A.end());
sort(B.begin(), B.end());
for (int i = 1; i < N; i++)
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N), B(M);
for (int i = 0; i < N; i++)
cin >> A[i];
for (int i = 0; i < M; i++)
cin >> B[i];
sort(A.begin(), A.end());
sort(B.begin(), B.end());
for (int i = 1; i < N; i++)
... | replace | 7 | 8 | 7 | 8 | 0 | |
p03152 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template <class T> constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template <class T> constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char> T_char TL(T_char cX) ... | #include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template <class T> constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template <class T> constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char> T_char TL(T_char cX) ... | replace | 58 | 59 | 58 | 59 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(a, n) for (ll a = 0; a < (n); ++a)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<vector<ll>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T ... | #include <bits/stdc++.h>
#define rep(a, n) for (ll a = 0; a < (n); ++a)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<vector<ll>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T ... | replace | 88 | 90 | 88 | 90 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n, m, sa[1010], sb[1010];
long long ans = 1;
bool a[1000010], b[1000010];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
int x;
scanf("%d", &x);
if (a[x]) {
puts("0");
return 0;
}
a[x]... | #include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n, m, sa[1000010], sb[1000010];
long long ans = 1;
bool a[1000010], b[1000010];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
int x;
scanf("%d", &x);
if (a[x]) {
puts("0");
return 0;
}
... | replace | 4 | 5 | 4 | 5 | 0 | |
p03152 | Python | Runtime Error | import bisect
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
A.sort()
B.sort()
if len(set(A)) != N or len(set(B)) != M:
print(0)
quit()
ans = 1
mod = 10**9 + 7
for i in reversed(range(1, N * M + 1)):
ai = bisect.bisect_left(A, i)
bi = bisect... | import bisect
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
A.sort()
B.sort()
if len(set(A)) != N or len(set(B)) != M:
print(0)
quit()
if A[-1] != N * M or B[-1] != N * M:
print(0)
quit()
ans = 1
mod = 10**9 + 7
for i in reversed(range(1, N... | insert | 8 | 8 | 8 | 11 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1e3 + 10;
const LL MOD = 1e9 + 7;
int n, m, px[N], py[N];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
int x;
scanf("%d", &x);
if (px[x]) {
puts("0");
return 0;
}
px[x] = 1;
}
... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1e3 + 10;
const LL MOD = 1e9 + 7;
int n, m, px[N * N], py[N * N];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
int x;
scanf("%d", &x);
if (px[x]) {
puts("0");
return 0;
}
px[x] = ... | replace | 5 | 6 | 5 | 6 | 0 | |
p03152 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | replace | 182 | 183 | 182 | 183 | 0 | |
p03152 | Python | Runtime Error | from bisect import bisect_left
MOD = 10**9 + 7
N, M = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
la = len(a)
sa = set(a)
lsa = len(sa)
if la != lsa:
print(0)
exit()
b = list(map(int, input().split()))
b = sorted(b)
lb = len(b)
sb = set(b)
lsb = len(sb)
if lb != lsb:
prin... | from bisect import bisect_left
MOD = 10**9 + 7
N, M = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
la = len(a)
sa = set(a)
lsa = len(sa)
if la != lsa:
print(0)
exit()
b = list(map(int, input().split()))
b = sorted(b)
lb = len(b)
sb = set(b)
lsb = len(sb)
if lb != lsb:
prin... | insert | 33 | 33 | 33 | 37 | 0 | |
p03152 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int M = 1e3 + 4;
const int MD = 1e9 + 7;
int a[M], b[M], c[M], d[M], cnt = 0, cnt1 = 0;
ll ans = 1;
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
a[i] = x;
c[x]++;
if (c[x] > 1) {
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int M = 1e3 + 4;
const int MD = 1e9 + 7;
int a[M], b[M], c[M * M], d[M * M], cnt = 0, cnt1 = 0;
ll ans = 1;
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
a[i] = x;
c[x]++;
if (c[x]... | replace | 5 | 6 | 5 | 6 | 0 | |
p03152 | Python | Runtime Error | from collections import Counter
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.sort()
B.sort()
A_cnt = Counter(A)
B_cnt = Counter(B)
if len(A) > 0:
if max(A_cnt.values()) > 1:
print(0)
exit()
if len(B) > 0:
if max(B_cnt.values()) > ... | from collections import Counter
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.sort()
B.sort()
A_cnt = Counter(A)
B_cnt = Counter(B)
if len(A) > 0:
if max(A_cnt.values()) > 1:
print(0)
exit()
if len(B) > 0:
if max(B_cnt.values()) > ... | replace | 20 | 21 | 20 | 21 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
#define F first
#define S second
#define RE register
#define random(x) (rand() % x)
#define LOG(a, b) (log(a) / log(b))
#define N 100005
#define mod 998244353
#define ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
#define F first
#define S second
#define RE register
#define random(x) (rand() % x)
#define LOG(a, b) (log(a) / log(b))
#define N 200005
#define mod 998244353
#define ... | replace | 11 | 12 | 11 | 12 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
typedef long long ll;
int n, tot, d, a[N], f[N];
struct node {
int u, v;
node(int u = 0, int v = 0, ll w = 0) : u(u), v(v), w(w) {}
ll w;
bool operator<(const node &o) const { return w < o.w; }
} e[N * 10];
void solve(int l, int r) {
if (l =... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
typedef long long ll;
int n, tot, d, a[N], f[N];
struct node {
int u, v;
node(int u = 0, int v = 0, ll w = 0) : u(u), v(v), w(w) {}
ll w;
bool operator<(const node &o) const { return w < o.w; }
} e[N * 20];
void solve(int l, int r) {
if (l =... | replace | 10 | 11 | 10 | 11 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, y) for (int i = (x); i < (y); ++i)
#define REP(i, x, y) for (int i = (x); i <= (y); ++i)
#define MP make_pair
#define PB push_back
#define PH push
#define fst first
#define snd second
typedef long long ll;
typedef unsigned long long ull;
typedef double d... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, y) for (int i = (x); i < (y); ++i)
#define REP(i, x, y) for (int i = (x); i <= (y); ++i)
#define MP make_pair
#define PB push_back
#define PH push
#define fst first
#define snd second
typedef long long ll;
typedef unsigned long long ull;
typedef double d... | replace | 17 | 18 | 17 | 18 | 0 | |
p03153 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
typedef long long llong;
constexpr int kMaxN = 1e5 + 10;
struct Edge {
int n1, n2;
llong cost;
};
int costa[kMaxN];
std::vector<Edge> edges;
Edge NewEdge(int n1, int n2, llong costd... | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
typedef long long llong;
constexpr int kMaxN = 2e5 + 10;
struct Edge {
int n1, n2;
llong cost;
};
int costa[kMaxN];
std::vector<Edge> edges;
Edge NewEdge(int n1, int n2, llong costd... | replace | 11 | 12 | 11 | 12 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define endl "\n"
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define rrep(i, a, b) for (auto i = (a); i > (b); --i)
#define ... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define endl "\n"
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define rrep(i, a, b) for (auto i = (a); i > (b); --i)
#define ... | replace | 609 | 610 | 609 | 610 | 0 | |
p03153 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <unorder... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <unorder... | insert | 85 | 85 | 85 | 86 | TLE | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ref(i, x, y) for (int i = x; i <= y; ++i)
#define mp make_pair
#define fi first
#define se second
typedef long long LL;
typedef pair<LL, int> PII;
const int N = 100010;
const LL inf = 1e18;
int n, D, s[N];
struct node {
int x, y;
PII p;
LL s;
PII s1[2], s2[2... | #include <bits/stdc++.h>
using namespace std;
#define ref(i, x, y) for (int i = x; i <= y; ++i)
#define mp make_pair
#define fi first
#define se second
typedef long long LL;
typedef pair<LL, int> PII;
const int N = 200010;
const LL inf = 1e18;
int n, D, s[N];
struct node {
int x, y;
PII p;
LL s;
PII s1[2], s2[2... | replace | 8 | 9 | 8 | 9 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
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;
}
template <typename T> struct Kruskal {
struct edge {
... | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
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;
}
template <typename T> struct Kruskal {
struct edge {
... | replace | 97 | 98 | 97 | 98 | 0 | |
p03153 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
// RMQ
template <class ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
// RMQ
template <class ... | replace | 137 | 139 | 137 | 141 | -6 | double free or corruption (out)
|
p03153 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
const i64 MOD = 1e9 + 7;
const i64 INF = 1e18 + 7;
struct UnionFind {
int n;
vector<int> par;
UnionFind(int n) : n(n), par(n, -1) {}
int Find(int x) { return par[x] < 0 ? x : Find(par[x]); }
bool Unite(int x, int y) {
x = Find(x), y = ... | #include <algorithm>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
using i64 = int64_t;
const i64 MOD = 1e9 + 7;
const i64 INF = 1e18 + 7;
struct UnionFind {
int n;
vector<int> par;
UnionFind(int n) : n(n), par(n, -1) {}
int Find(int x) { return par[x] < 0 ? x : Find(par[x... | replace | 0 | 1 | 0 | 4 | TLE | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAX_N = 100005;
LL A[MAX_N], dp1[MAX_N], dp2[MAX_N];
LL ans, D;
int n;
int main() {
cin >> n >> D;
ans += (n - 1) * D;
for (int i = 0; i < n; i++) {
cin >> A[i];
ans += A[i];
}
dp1[0] = A[0];
dp2[n - 1] = A[n - 1];
for (... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAX_N = 200005;
LL A[MAX_N], dp1[MAX_N], dp2[MAX_N];
LL ans, D;
int n;
int main() {
cin >> n >> D;
ans += (n - 1) * D;
for (int i = 0; i < n; i++) {
cin >> A[i];
ans += A[i];
}
dp1[0] = A[0];
dp2[n - 1] = A[n - 1];
for (... | replace | 3 | 4 | 3 | 4 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<long, long> P;
typedef pair<long, P> PP;
vector<PP> edge;
long long N, D;
vector<long long> A;
const long INF = (1L << 50);
class UF {
vector<int> par, rank;
public:
UF(int size) {
par.resize(size);
rank.resize(size);
for (int i = 0; i < size;... | #include <bits/stdc++.h>
using namespace std;
typedef pair<long, long> P;
typedef pair<long, P> PP;
vector<PP> edge;
long long N, D;
vector<long long> A;
const long INF = (1L << 50);
class UF {
vector<int> par, rank;
public:
UF(int size) {
par.resize(size);
rank.resize(size);
for (int i = 0; i < size;... | replace | 64 | 65 | 64 | 65 | 0 | |
p03153 | 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 | 94 | 95 | 94 | 95 | 0 | |
p03153 | C++ | Runtime Error | // Code by Denverjin.
#include <bits/stdc++.h>
using namespace std;
using ld = double;
using ll = long long;
using ull = unsigned long long;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int SZ = 1 << 13;
char buff[SZ], *pos = buff + SZ - 1;
#define getchar() ... | // Code by Denverjin.
#include <bits/stdc++.h>
using namespace std;
using ld = double;
using ll = long long;
using ull = unsigned long long;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int SZ = 1 << 13;
char buff[SZ], *pos = buff + SZ - 1;
#define getchar() ... | replace | 26 | 27 | 26 | 27 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 200010
#define INFLL 0x3f3f3f3f3f3f3f3f
int n, m;
ll d, a[N];
struct Edge {
int u, v;
ll w;
Edge() {}
Edge(int u, int v, ll w) : u(u), v(v), w(w) {}
bool operator<(const Edge &other) const { return w < other.w; }
} edge[N * 15];
vo... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 200010
#define INFLL 0x3f3f3f3f3f3f3f3f
int n, m;
ll d, a[N];
struct Edge {
int u, v;
ll w;
Edge() {}
Edge(int u, int v, ll w) : u(u), v(v), w(w) {}
bool operator<(const Edge &other) const { return w < other.w; }
} edge[N * 30];
vo... | replace | 14 | 15 | 14 | 15 | 0 | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// 標準ライブラリ関数の名前を変える
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
const int INF = 1e9 + 7;
const ll... | #include <bits/stdc++.h>
using namespace std;
// 標準ライブラリ関数の名前を変える
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
const int INF = 1e9 + 7;
const ll... | replace | 180 | 181 | 180 | 181 | -6 | double free or corruption (out)
|
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T = int> struct Rmq {
vector<T> raw;
static const int LOG = 17; // 20;
int k;
int n;
vector<int> st[LOG];
Rmq(vector<T> _v) { // pass in vec[0, n)
raw = _v;
n = raw.size();
k = 32 - __builtin_clz(n);
for ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T = int> struct Rmq {
vector<T> raw;
static const int LOG = 19; // 20;
int k;
int n;
vector<int> st[LOG];
Rmq(vector<T> _v) { // pass in vec[0, n)
raw = _v;
n = raw.size();
k = 32 - __builtin_clz(n);
for ... | replace | 6 | 7 | 6 | 7 | 0 | |
p03153 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_... | replace | 31 | 33 | 31 | 33 | TLE | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define printvector(v, n) \
for (int i = 1; i <= n; i++) \
cout << v[i] << " "; \
cout << ln;
#define printint(... | #include <bits/stdc++.h>
using namespace std;
#define printvector(v, n) \
for (int i = 1; i <= n; i++) \
cout << v[i] << " "; \
cout << ln;
#define printint(... | replace | 40 | 41 | 40 | 41 | 0 | |
p03153 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define re... | #include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define re... | replace | 92 | 94 | 92 | 93 | 0 | |
p03153 | C++ | Time Limit Exceeded | // MLEが動かない
// セグフォは関数内で要素のでかい配列を定義しているから
// todo idef DEBUGで、境界チェック付きのvectorを作りたい
// http://marycore.jp/prog/cpp/class-extension-methods/
// 現状ifdef DEBUG が何故か動かないので出来ない
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define double long double
struct initon {
initon() {
... | // MLEが動かない
// セグフォは関数内で要素のでかい配列を定義しているから
// todo idef DEBUGで、境界チェック付きのvectorを作りたい
// http://marycore.jp/prog/cpp/class-extension-methods/
// 現状ifdef DEBUG が何故か動かないので出来ない
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define double long double
struct initon {
initon() {
... | replace | 1,247 | 1,248 | 1,247 | 1,248 | TLE | |
p03153 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct node {
int u, v;
ll w;
bool operator<(const node &o) const { return w < o.w; }
} e[6000005];
int n, cot = 0, a[200005], fail[200005];
ll d;
void add(int l, int r) {
if (l >= r)
return;
int m = l + r >> 1;
ll mi = 1e18, pos;
for ... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct node {
int u, v;
ll w;
bool operator<(const node &o) const { return w < o.w; }
} e[6000005];
int n, cot = 0, a[200005], fail[200005];
ll d;
void add(int l, int r) {
if (l >= r)
return;
int m = l + r >> 1;
ll mi = 1e18, pos;
for ... | replace | 28 | 29 | 28 | 29 | 0 | |
p03154 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;
int main() {
const int maxSize = 2000001;
vector<long long> inv(maxSize);
vector<long long> fact(maxSize);
vector<long long> factInv(maxSize);
for (int i = 0; i < 2; i++)
inv[i] = fact[i] = factInv[i] = 1;
for (int... | #include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;
int main() {
const int maxSize = 20000001;
vector<long long> inv(maxSize);
vector<long long> fact(maxSize);
vector<long long> factInv(maxSize);
for (int i = 0; i < 2; i++)
inv[i] = fact[i] = factInv[i] = 1;
for (in... | replace | 8 | 9 | 8 | 9 | 0 | |
p03154 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | replace | 22 | 23 | 22 | 23 | 0 | |
p03154 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include ... | replace | 157 | 158 | 157 | 158 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03154 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define N 2200000
#define LL long long
const LL mod = 1000000007;
LL n, m, k, p, ans, fac[N], ifac[N];
LL inv(LL x) { return x == 1 ? 1 : (mod - mod / x) * inv(mod % x) % mod; }
int main() {
scanf("%lld%lld%lld", &n, &m, &k);
p = n + m;
fac[0] = 1;
for (LL i = ... | #include <bits/stdc++.h>
using namespace std;
#define N 22000000
#define LL long long
const LL mod = 1000000007;
LL n, m, k, p, ans, fac[N], ifac[N];
LL inv(LL x) { return x == 1 ? 1 : (mod - mod / x) * inv(mod % x) % mod; }
int main() {
scanf("%lld%lld%lld", &n, &m, &k);
p = n + m;
fac[0] = 1;
for (LL i =... | replace | 4 | 5 | 4 | 5 | 0 | |
p03154 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename T = int, T mod = 1'000'000'007, typename U = long long>
struct umod {
T val;
umod() : val(0) {}
umod(U x) {
x %= mod;
if (x < 0)
x += mod;
val = x;
}
umod &operator+=(umod oth) {
val += oth.val;
if (val >= mod)
va... | #include <bits/stdc++.h>
using namespace std;
template <typename T = int, T mod = 1'000'000'007, typename U = long long>
struct umod {
T val;
umod() : val(0) {}
umod(U x) {
x %= mod;
if (x < 0)
x += mod;
val = x;
}
umod &operator+=(umod oth) {
val += oth.val;
if (val >= mod)
va... | replace | 87 | 88 | 87 | 88 | 0 | |
p03154 | C++ | Runtime Error | #include <bits/stdc++.h>
#define maxn 2000050
using namespace std;
typedef long long ll;
const int M = 1000000007;
int f[maxn], nf[maxn], n, m, K;
long long ans;
int C(int x, int y) {
if (y < 0 || y > x)
return 0;
return 1ll * f[x] * nf[y] % M * nf[x - y] % M;
}
int main() {
f[0] = 1;
for (int i = 1; i <... | #include <bits/stdc++.h>
#define maxn 20000050
using namespace std;
typedef long long ll;
const int M = 1000000007;
int f[maxn], nf[maxn], n, m, K;
long long ans;
int C(int x, int y) {
if (y < 0 || y > x)
return 0;
return 1ll * f[x] * nf[y] % M * nf[x - y] % M;
}
int main() {
f[0] = 1;
for (int i = 1; i ... | replace | 1 | 2 | 1 | 2 | 0 | |
p03154 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <unorder... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <unorder... | replace | 83 | 85 | 83 | 86 | TLE | |
p03154 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <chrono>
#include <complex>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define REP(i, x, y) for (ll i = x; i <= y; i++)
#define SIZE(a) ll(a.s... | #include <algorithm>
#include <bitset>
#include <chrono>
#include <complex>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define REP(i, x, y) for (ll i = x; i <= y; i++)
#define SIZE(a) ll(a.s... | replace | 64 | 65 | 64 | 65 | 0 | |
p03154 | C++ | Runtime Error | // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#inc... | // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#inc... | replace | 43 | 44 | 43 | 44 | -11 | |
p03155 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int, int>, // change type
null_type, less<pair<int, int>>... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int, int>, // change type
null_type, less<pair<int, int>>... | replace | 28 | 32 | 28 | 32 | 0 | |
p03155 | 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 speed \
ios::sync_with_stdio(0); \
cin.tie(0);
int const N = 1e5 + 1;
... | #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 speed \
ios::sync_with_stdio(0); \
cin.tie(0);
int const N = 1e5 + 1;
... | delete | 10 | 13 | 10 | 10 | 0 | |
p03155 | C++ | Runtime Error | // Gaurav Aggarwal
/*
useful stl
array<ll,size> ar; //size(),front(),back(),fill(),empty()
deque<ll> d //push_back(),push_front(),pop_front(),pop_back()
vector<ll> v(size,val);
//push_back(),*max_element(v.begin(),v.end()),accumulate(v.begin(),v.end(),0)
stack<ll> g; //push(),pop()... | // Gaurav Aggarwal
/*
useful stl
array<ll,size> ar; //size(),front(),back(),fill(),empty()
deque<ll> d //push_back(),push_front(),pop_front(),pop_back()
vector<ll> v(size,val);
//push_back(),*max_element(v.begin(),v.end()),accumulate(v.begin(),v.end(),0)
stack<ll> g; //push(),pop()... | replace | 65 | 69 | 65 | 69 | 0 | |
p03155 | Python | Runtime Error | N, W, H = map(int, input().split())
print((N - W + 1) * (N - H + 1))
| N = int(input())
W = int(input())
H = int(input())
print((N - W + 1) * (N - H + 1))
| replace | 0 | 1 | 0 | 3 | ValueError: not enough values to unpack (expected 3, got 1) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03155/Python/s974033507.py", line 1, in <module>
N, W, H = map(int, input().split())
ValueError: not enough values to unpack (expected 3, got 1)
|
p03156 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, p[21], A, B, i, x = 0, y = 0, z = 0, min;
cin >> N >> A >> B;
for (i = 1; i <= N; i++) {
cin >> p[i];
if (p[i] <= A)
x++;
if (p[i] >= A + 1 && p[i] <= B)
y++;
if (p[i] >= B + 1)
z++;
}
if (x <= y && x <= z)
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, p[101], A, B, i, x = 0, y = 0, z = 0, min;
cin >> N >> A >> B;
for (i = 1; i <= N; i++) {
cin >> p[i];
if (p[i] <= A)
x++;
if (p[i] >= A + 1 && p[i] <= B)
y++;
if (p[i] >= B + 1)
z++;
}
if (x <= y && x <= z)... | replace | 5 | 6 | 5 | 6 | 0 | |
p03156 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i+... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i+... | replace | 39 | 40 | 39 | 40 | 0 | |
p03156 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
int N = 0;
int A = 0, B = 0;
int P[20];
int q1 = 0, q2 = 0, q3 = 0;
int ans = 0;
// 入力
cin >> N >> A >> B;
for (int i = 0; i < N; i++) {
cin >> P[i];
}
// 処理
for (int i = 0; i < N; i++) {
if (P[i] <= A) {
q1++;
}
}
... | #include <iostream>
using namespace std;
int main(void) {
int N = 0;
int A = 0, B = 0;
int P[100];
int q1 = 0, q2 = 0, q3 = 0;
int ans = 0;
// 入力
cin >> N >> A >> B;
for (int i = 0; i < N; i++) {
cin >> P[i];
}
// 処理
for (int i = 0; i < N; i++) {
if (P[i] <= A) {
q1++;
}
}
... | replace | 5 | 6 | 5 | 6 | 0 | |
p03156 | C++ | Runtime Error | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <str... | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <str... | replace | 80 | 81 | 80 | 81 | 0 | |
p03156 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define LL long long
const LL mod = 998244353;
#define mem(a, b) memset(a, b, sizeof(a))
int max(int a, int b) { return a > b ? a : b; }
int main() {
int n, a[50], A, B;
scanf("%d", &n);
scanf("%d%d", &A, &B);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
... | #include <bits/stdc++.h>
using namespace std;
#define LL long long
const LL mod = 998244353;
#define mem(a, b) memset(a, b, sizeof(a))
int max(int a, int b) { return a > b ? a : b; }
int main() {
int n, a[200], A, B;
scanf("%d", &n);
scanf("%d%d", &A, &B);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);... | replace | 8 | 9 | 8 | 9 | 0 | |
p03156 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
int main() {
int n, a, b;
cin >> n >> a >> b;
int x, y, z;
x = 0;
y = 0;
z = 0;
int p[25];
for (int i = 0; i < n; i++) {
cin >> p[i];
if (p[i] <= a) {
x++;
}
if (p[i] > a && p[i] <= b) {
y++;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
int main() {
int n, a, b;
cin >> n >> a >> b;
int x, y, z;
x = 0;
y = 0;
z = 0;
int p[10000];
for (int i = 0; i < n; i++) {
cin >> p[i];
if (p[i] <= a) {
x++;
}
if (p[i] > a && p[i] <= b) {
y++;... | replace | 11 | 12 | 11 | 12 | 0 | |
p03156 | C++ | Runtime Error | #include <algorithm>
#include <complex>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int main() {
int N;
int... | #include <algorithm>
#include <complex>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int main() {
int N;
int... | replace | 20 | 21 | 20 | 21 | 0 | |
p03156 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
int a, b;
cin >> a >> b;
int p[20];
int cnt1 = 0, cnt2 = 0, cnt3 = 0;
rep(i, n) { cin... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
int a, b;
cin >> a >> b;
int p[100];
int cnt1 = 0, cnt2 = 0, cnt3 = 0;
rep(i, n) { ci... | replace | 13 | 14 | 13 | 14 | 0 | |
p03157 | Python | Runtime Error | h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
dx = (0, 0, 1, -1)
dy = (1, -1, 0, 0)
seen = [[False] * w for _ in range(h)]
numb = 0
numw = 0
def dfs(x, y):
global numb, numw
seen[x][y] = True
if s[x][y] == "#":
numb += 1
else:
numw += 1
for di in range(4):... | import sys
sys.setrecursionlimit(10**6)
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
dx = (0, 0, 1, -1)
dy = (1, -1, 0, 0)
seen = [[False] * w for _ in range(h)]
numb = 0
numw = 0
def dfs(x, y):
global numb, numw
seen[x][y] = True
if s[x][y] == "#":
numb += 1
else:
... | insert | 0 | 0 | 0 | 3 | 0 | |
p03157 | Python | Runtime Error | def update(M, S, i, j, H, W, cluster):
for i_n in [i - 1, i, i + 1]:
for j_n in [j - 1, j, j + 1]:
if i_n >= H or i_n < 0:
continue
if j_n >= W or j_n < 0:
continue
if i_n == i and j_n == j:
continue
if abs(i - ... | import sys
sys.setrecursionlimit(2000000)
def update(M, S, i, j, H, W, cluster):
for i_n in [i - 1, i, i + 1]:
for j_n in [j - 1, j, j + 1]:
if i_n >= H or i_n < 0:
continue
if j_n >= W or j_n < 0:
continue
if i_n == i and j_n == j:
... | insert | 0 | 0 | 0 | 5 | 0 | |
p03157 | Python | Runtime Error | #!/usr/bin/env python3
from itertools import product
H, W = map(int, input().split())
S = [input() for _ in range(H)]
color = [[None] * W for _ in range(H)]
memo = [[0, 0] for _ in range(H * W + 1)]
cnt = 1
def dfs(p, c):
x, y = p
color[x][y] = c
memo[cnt][c] += 1
for dx, dy in [[1, 0], [0, 1], [-1, ... | #!/usr/bin/env python3
from itertools import product
import sys
sys.setrecursionlimit(200000)
H, W = map(int, input().split())
S = [input() for _ in range(H)]
color = [[None] * W for _ in range(H)]
memo = [[0, 0] for _ in range(H * W + 1)]
cnt = 1
def dfs(p, c):
x, y = p
color[x][y] = c
memo[cnt][c] += ... | insert | 2 | 2 | 2 | 5 | 0 | |
p03157 | Python | Runtime Error | h, w = map(int, input().split())
s = [input() for _ in range(h)]
is_used = [[False] * w for _ in range(h)]
di = [+1, 0, -1, 0]
dj = [0, +1, 0, -1]
def dfs(i, j):
if s[i][j] == "#":
cnt_w, cnt_b = 0, 1
else:
cnt_w, cnt_b = 1, 0
for k in range(4):
ni = i + di[k]
nj = j + d... | import sys
sys.setrecursionlimit(10**6)
h, w = map(int, input().split())
s = [input() for _ in range(h)]
is_used = [[False] * w for _ in range(h)]
di = [+1, 0, -1, 0]
dj = [0, +1, 0, -1]
def dfs(i, j):
if s[i][j] == "#":
cnt_w, cnt_b = 0, 1
else:
cnt_w, cnt_b = 1, 0
for k in range(4):... | insert | 0 | 0 | 0 | 4 | 0 | |
p03157 | Python | Runtime Error | def dfs(x, y, matrix, visited, isWhite):
global black, white
dxy = [[1, 0], [-1, 0], [0, -1], [0, 1]]
visited[y][x] = True
w = len(matrix[0])
h = len(matrix)
for dx, dy in dxy:
nx = x + dx
ny = y + dy
if nx < 0 or w <= nx or ny < 0 or h <= ny:
continue
... | import sys
sys.setrecursionlimit(10**6)
def dfs(x, y, matrix, visited, isWhite):
global black, white
dxy = [[1, 0], [-1, 0], [0, -1], [0, 1]]
visited[y][x] = True
w = len(matrix[0])
h = len(matrix)
for dx, dy in dxy:
nx = x + dx
ny = y + dy
if nx < 0 or w <= nx or ny... | insert | 0 | 0 | 0 | 5 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FLASH \
cin.tie(0); \
cout.tie(0); \
ios_base::sync_with_stdio(false);
#define pb push_... | #include <bits/stdc++.h>
#define FLASH \
cin.tie(0); \
cout.tie(0); \
ios_base::sync_with_stdio(false);
#define pb push_... | replace | 40 | 43 | 40 | 41 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #define int long long
pair<int, int> kk(int t[][500], int s[][500], int i, int j, int h, int w) {
pair<int, int> d = make_pair(0, 0);
pair<int, int> addd;
t[i][j] = 0;
if (i > 0 && s[i][j] != s[i - 1][j] && t[i - 1][j] == -1) {
addd = kk(t, s, i - 1, j, h, ... | #include <bits/stdc++.h>
using namespace std;
// #define int long long
pair<int, int> kk(int t[][500], int s[][500], int i, int j, int h, int w) {
pair<int, int> d = make_pair(0, 0);
pair<int, int> addd;
t[i][j] = 0;
if (i > 0 && s[i][j] != s[i - 1][j] && t[i - 1][j] == -1) {
addd = kk(t, s, i - 1, j, h, ... | replace | 56 | 57 | 56 | 57 | 0 | |
p03157 | C++ | Time Limit Exceeded | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | replace | 312 | 322 | 312 | 319 | TLE | |
p03157 | C++ | Runtime Error | #include <cstdio>
using ll = long long;
int x[4] = {-1, 0, 1, 0};
int y[4] = {0, 1, 0, -1};
int H, W;
bool S[400][400];
bool has_been_discovered[400][400];
int members[400][2];
void DepthFirstSearch(int row, int column, int group_number) {
has_been_discovered[row][column] = true;
members[group_number][S[row][column... | #include <cstdio>
using ll = long long;
int x[4] = {-1, 0, 1, 0};
int y[4] = {0, 1, 0, -1};
int H, W;
bool S[400][400];
bool has_been_discovered[400][400];
ll members[160000][2];
void DepthFirstSearch(int row, int column, int group_number) {
has_been_discovered[row][column] = true;
members[group_number][S[row][colu... | replace | 7 | 8 | 7 | 8 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
inline ll _() {
ll x = 0, f = 1;
char ch = getchar();
for (; ch < '0' || ch > '9'; ch = getchar())
if (ch == '-')
f = -f;
for (; ch >= '0' && ch <= '9'; ch = getchar())
x = x * 10 + ch - '0';
return x * f;
}
#define _ _()
int n,... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
inline ll _() {
ll x = 0, f = 1;
char ch = getchar();
for (; ch < '0' || ch > '9'; ch = getchar())
if (ch == '-')
f = -f;
for (; ch >= '0' && ch <= '9'; ch = getchar())
x = x * 10 + ch - '0';
return x * f;
}
#define _ _()
int n,... | replace | 34 | 35 | 34 | 35 | 0 | |
p03157 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> iint;
typedef pair<ll, ll> llll;
#define ALL(x) (x).begin(), (x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; // 10^18
const int inINF = 1000000000; // 10^9
const ll MOD = 1000000007; // 10^9+7
cons... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> iint;
typedef pair<ll, ll> llll;
#define ALL(x) (x).begin(), (x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; // 10^18
const int inINF = 1000000000; // 10^9
const ll MOD = 1000000007; // 10^9+7
cons... | replace | 12 | 14 | 12 | 14 | TLE | |
p03157 | C++ | Runtime Error |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#defin... |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#defin... | replace | 84 | 86 | 84 | 86 | 0 | |
p03157 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | replace | 107 | 108 | 107 | 108 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int dy[4] = {-1, 0, 1, 0};
int dx[4] = {0, 1, 0, -1};
char board[401][401];
int h, w;
int visited[401][401];
int arr[16005][2];
int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> h >> w;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++... | #include <bits/stdc++.h>
using namespace std;
int dy[4] = {-1, 0, 1, 0};
int dx[4] = {0, 1, 0, -1};
char board[401][401];
int h, w;
int visited[401][401];
long long int arr[160005][2];
int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> h >> w;
for (int i = 0; i < h; i++) {
for (int j = 0;... | replace | 9 | 10 | 9 | 10 | 0 | |
p03157 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++)
#define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(), (a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<i... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++)
#define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(), (a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<i... | replace | 41 | 42 | 41 | 43 | TLE | |
p03157 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <vector>
#define N 405
using namespace std;
typedef long long ll;
ll n, m, num, cnt[N], s[N], z[N][N];
ll dr[4] = {-1, 0, 0, 1}, dc[4] = {0, -1, 1, 0};
bool v[N][N];
char a[N][N];
// vector<ll> x, y;
void f(ll p, ll q) {
ll i, j, x, y;
if (p < 1 || p > n || q < 1 || q... | #include <cstdio>
#include <iostream>
#include <vector>
#define N 405
using namespace std;
typedef long long ll;
ll n, m, num, cnt[160005], s[160005], z[N][N];
ll dr[4] = {-1, 0, 0, 1}, dc[4] = {0, -1, 1, 0};
bool v[N][N];
char a[N][N];
// vector<ll> x, y;
void f(ll p, ll q) {
ll i, j, x, y;
if (p < 1 || p > n || ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03157 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fast_cin() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define MAX... | #include <bits/stdc++.h>
using namespace std;
#define fast_cin() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define MAX... | replace | 71 | 72 | 71 | 72 | TLE | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m, cnt, fa[404 * 404], sh[404], sb[404], id[404][404], vis[404][404];
ll ans;
char mp[404][404];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
scanf("%s", mp[i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m, cnt, fa[404 * 404], sh[404 * 404], sb[404 * 404], id[404][404],
vis[404][404];
ll ans;
char mp[404][404];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
... | replace | 3 | 4 | 3 | 5 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using plll = pair<ll, pll>;
using graph = vector<vector<int>>;
const ll MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll abs1(ll a) {
if (a >= 0)
return a;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using plll = pair<ll, pll>;
using graph = vector<vector<int>>;
const ll MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll abs1(ll a) {
if (a >= 0)
return a;
... | replace | 201 | 203 | 201 | 203 | 0 | |
p03157 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = INF; // disable
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 ll INF = 1LL << 60;
const ll MOD = INF; // disable
template <class T> bool chmax(T &a, const T &b... | replace | 112 | 124 | 112 | 128 | TLE | |
p03157 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void file() {
#ifndef ONLINE_JUDGE
freopen("a_input.txt", "r", stdin);
freopen("a_output.txt", "w", stdout);
#endif
}
void fast() {
std::ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
}
ll gcd(ll a... | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void file() {
#ifndef ONLINE_JUDGE
freopen("a_input.txt", "r", stdin);
freopen("a_output.txt", "w", stdout);
#endif
}
void fast() {
std::ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
}
ll gcd(ll a... | replace | 40 | 41 | 40 | 41 | 0 | |
p03157 | C++ | Time Limit Exceeded | #include <cstdio>
#include <vector>
typedef long long llong;
constexpr int kMaxN = 400;
constexpr int kMaxNN = kMaxN * kMaxN;
char maze[kMaxN + 3][kMaxN + 3];
int union_set_id[kMaxNN + 3];
int union_set_count0[kMaxNN + 3];
int union_set_count1[kMaxNN + 3];
bool tmp[kMaxNN + 3];
int GetRoot(int i) {
if (union_set_... | #include <cstdio>
#include <vector>
typedef long long llong;
constexpr int kMaxN = 400;
constexpr int kMaxNN = kMaxN * kMaxN;
char maze[kMaxN + 3][kMaxN + 3];
int union_set_id[kMaxNN + 3];
int union_set_count0[kMaxNN + 3];
int union_set_count1[kMaxNN + 3];
bool tmp[kMaxNN + 3];
int GetRoot(int i) {
if (union_set_... | replace | 16 | 17 | 16 | 17 | TLE | |
p03157 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
usin... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
usin... | replace | 135 | 137 | 135 | 137 | 0 | |
p03157 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
typedef char SINT8;
typedef short SINT16;
typedef int SINT32;
typedef long long SINT64;
typedef double DOUBLE;
#define MAX(a, b) ((a) > (b) ? ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
typedef char SINT8;
typedef short SINT16;
typedef int SINT32;
typedef long long SINT64;
typedef double DOUBLE;
#define MAX(a, b) ((a) > (b) ? ... | replace | 145 | 146 | 145 | 146 | TLE | |
p03157 | C++ | Runtime Error |
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int... |
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int... | replace | 36 | 37 | 36 | 37 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i <= n; ++i)
using namespace std;
typedef long long ll;
const int maxn = 430;
int n, m, col[maxn], vis[maxn], black, white;
char s[maxn][maxn];
inline int code(int x, int y) { return x * m + y + 1; }
vector<int> G[160010];
void dfs(int u) {
if (col[u])
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i <= n; ++i)
using namespace std;
typedef long long ll;
const int maxn = 430;
int n, m, col[160010], vis[160010], black, white;
char s[maxn][maxn];
inline int code(int x, int y) { return x * m + y + 1; }
vector<int> G[160010];
void dfs(int u) {
if (col[u])
... | replace | 6 | 7 | 6 | 7 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> 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 ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> 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 ... | replace | 24 | 25 | 24 | 25 | 0 | |
p03157 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
class unionfind {
vector<int> p;
public:
void init(int n) {
for (int i = 0; i < n; i++) {
p.push_back(i);
}
}
void merge(int m, int n) {
if (find(m) == find(n))
return;
p.at(find(m)) = find(n);
}
int find(int n) {
if (p.at(n) ... | #include <bits/stdc++.h>
using namespace std;
class unionfind {
vector<int> p;
public:
void init(int n) {
for (int i = 0; i < n; i++) {
p.push_back(i);
}
}
void merge(int m, int n) {
if (find(m) == find(n))
return;
p.at(find(m)) = find(n);
}
int find(int n) {
if (p.at(n) ... | replace | 44 | 45 | 44 | 45 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 8) >= this->size() (which is 0)
|
p03158 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip> // << fixed << precision(10)
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, s, t) for (int i = s; i < t; i++)
#define REP(i, n) FOR(i, 0, n)
#define PRINT(s) cout << s << "\n"
#define SOR... | #include <algorithm>
#include <cmath>
#include <iomanip> // << fixed << precision(10)
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, s, t) for (int i = s; i < t; i++)
#define REP(i, n) FOR(i, 0, n)
#define PRINT(s) cout << s << "\n"
#define SOR... | replace | 66 | 67 | 66 | 67 | 0 | |
p03158 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
using namespace std;
long long int n, q, m, p[20000] = {}, a[300000] = {}, b, lef[200000], h, w,
tab[500][500] = {}, same = 0, qu[300000],
rui[300000] = {}, giza[... | #include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
using namespace std;
long long int n, q, m, p[20000] = {}, a[300000] = {}, b, lef[200000], h, w,
tab[500][500] = {}, same = 0, qu[300000],
rui[300000] = {}, giza[... | replace | 58 | 60 | 58 | 63 | TLE | |
p03158 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define ll long long
#define mod 1000000007
#define maxn 410
inline ll read() {
ll x = 0;
char c = getchar(), f = 1;
for (; c < '0' || '9' < c; c = getchar())
if (c == '-')
f = -1;
for (; '0' <= c && c <= '9'... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define ll long long
#define mod 1000000007
#define maxn 100010
inline ll read() {
ll x = 0;
char c = getchar(), f = 1;
for (; c < '0' || '9' < c; c = getchar())
if (c == '-')
f = -1;
for (; '0' <= c && c <= ... | replace | 7 | 8 | 7 | 8 | 0 | |
p03158 | C++ | Time Limit Exceeded | /* <ik:include(base.hpp)> */
/* subset of bits/stdc++.h */
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define int LL
#define times(n, i) uptil(0, n, i)
#defi... | /* <ik:include(base.hpp)> */
/* subset of bits/stdc++.h */
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define int LL
#define times(n, i) uptil(0, n, i)
#defi... | replace | 279 | 280 | 279 | 280 | TLE | |
p03158 | C++ | Runtime Error | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <... | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <... | replace | 103 | 104 | 103 | 104 | 0 | |
p03158 | 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 INF = 1e9;
const int maxN = 1e3 + 5;
int n, Q;
int a[maxN];
int X[maxN];
bool check(int x, int m) {
int z = a[n - m + 1];
if (z <... | #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 INF = 1e9;
const int maxN = 1e5 + 5;
int n, Q;
int a[maxN];
int X[maxN];
bool check(int x, int m) {
int z = a[n - m + 1];
if (z <... | replace | 10 | 11 | 10 | 11 | 0 | |
p03158 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr ll mod = static_cast<ll>(1e9 + 7);
int n, q;
ll a[100005];
ll sum[100005], sum2[100005];
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_st... | #include <bits/stdc++.h>
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr ll mod = static_cast<ll>(1e9 + 7);
int n, q;
ll a[100005];
ll sum[100005], sum2[100005];
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_st... | replace | 39 | 40 | 39 | 43 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.