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
p02948
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VRSORT(v) sort(...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()); #define VRSORT(v) sort(...
replace
138
140
138
142
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define endl "\n" #define pb push_back #define PI 3.1415926535897932384626433832795l #define F first #define S second #define mp make_pair #define f(i, n) for (int i = 0; i < n; ++i) #define loop(i, a, b) for (int i = a; i < ...
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define endl "\n" #define pb push_back #define PI 3.1415926535897932384626433832795l #define F first #define S second #define mp make_pair #define f(i, n) for (int i = 0; i < n; ++i) #define loop(i, a, b) for (int i = a; i < ...
replace
32
33
32
33
-11
p02948
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; const int maxn = 1e5 + 10; int read() { int x = 0, f = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = -1...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; const int maxn = 1e5 + 10; int read() { int x = 0, f = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = -1...
replace
48
49
48
49
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using LL = long long; using PII = pair<int, int>; #define FI(i, a, b) for (int i = (a); i <= (b); ++i) #define FD(i, b, a) for (int i = (b); i >= (a); --i) #define DEBUG(x) cerr << #x << ": " << (x) << endl; const int N = 1e5 + 5; int n, m, a[N], b[N]; vector<int> g[N]; i...
#include <bits/stdc++.h> using namespace std; using LL = long long; using PII = pair<int, int>; #define FI(i, a, b) for (int i = (a); i <= (b); ++i) #define FD(i, b, a) for (int i = (b); i >= (a); --i) #define DEBUG(x) cerr << #x << ": " << (x) << endl; const int N = 1e5 + 5; int n, m, a[N], b[N]; vector<int> g[N]; i...
replace
15
16
15
20
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int NN = 1e6 + 10; typedef long long ll; int N, M; vector<int> ve[NN]; priority_queue<int> q; int main() { // freopen("test.in","r",stdin); cin >> N >> M; for (int i = 1; i <= N; i++) { int a, b; scanf("%d%d", &a, &b); ve[M - a + 1].push_back( ...
#include <bits/stdc++.h> using namespace std; const int NN = 1e6 + 10; typedef long long ll; int N, M; vector<int> ve[NN]; priority_queue<int> q; int main() { // freopen("test.in","r",stdin); cin >> N >> M; for (int i = 1; i <= N; i++) { int a, b; scanf("%d%d", &a, &b); if (a > M) continue; ...
insert
14
14
14
16
0
p02948
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define mod 1000000007 typedef long long ll; using namespace st...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define mod 1000000007 typedef long long ll; using namespace st...
replace
28
29
28
39
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
replace
31
32
31
32
-11
p02948
C++
Runtime Error
// For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 // a.cpp -o a.exe in cmd #include <bits/stdc++.h> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #define ll long long #define ld long double #define vi vector<int> #define vll vector<ll> #define vvi v...
// For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 // a.cpp -o a.exe in cmd #include <bits/stdc++.h> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #define ll long long #define ld long double #define vi vector<int> #define vll vector<ll> #define vvi v...
insert
41
41
41
43
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (int i = 0, i##__ = (n); i < i##__; ++i) #define ALL(o) (o).begin(), (o).end() #define PUT(a) cout << a << "\n" #define VEC2D(v, y, x, s) vector<vector<int>> v(y, vector<int>(x, s)) // ここまでテンプレ int main() { priority_queue<int> p...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (int i = 0, i##__ = (n); i < i##__; ++i) #define ALL(o) (o).begin(), (o).end() #define PUT(a) cout << a << "\n" #define VEC2D(v, y, x, s) vector<vector<int>> v(y, vector<int>(x, s)) // ここまでテンプレ int main() { priority_queue<int> p...
replace
12
13
12
13
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, M; cin >> N >> M; // Reward[n] : n日後に報酬が得られるバイトの報酬をVectorにしたやつ vector<int> Reward[100001]; int a, b; for (int n = 0; n < N; n++) { cin >> a >> b; Reward[a].emplace_back(b); } long a...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, M; cin >> N >> M; // Reward[n] : n日後に報酬が得られるバイトの報酬をVectorにしたやつ vector<int> Reward[100001]; int a, b; for (int n = 0; n < N; n++) { cin >> a >> b; Reward[a].emplace_back(b); } long a...
replace
24
26
24
28
-11
p02948
C++
Runtime Error
#pragma region #define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cmath> #include <cstdint> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef ...
#pragma region #define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cmath> #include <cstdint> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef ...
replace
88
89
88
89
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; map<int, priority_queue<int>> jobs; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; jobs[a].push(b); } int64_t gurantee = 0; auto j = jobs.begin(), je = jobs.end(); priority_queue<pair<int, int>> w...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; map<int, priority_queue<int>> jobs; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; jobs[a].push(b); } int64_t gurantee = 0; auto j = jobs.begin(), je = jobs.end(); priority_queue<pair<int, int>> w...
replace
24
30
24
32
-11
p02948
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<vector<int>> v(m); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; v[m - a].push_back(b); } long long ans = 0; priority_queue<int> q; for (int i = m - 1; i >= ...
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<vector<int>> v(m); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; if (a > m) { continue; } v[m - a].push_back(b); } long long ans = 0; priority_q...
insert
13
13
13
17
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<vector<int>> A(n); rep(i, n) { int a, b; cin >> a >> b; if (a > m) continue; A[m - a].push_back(b); } ll ans = 0; priority...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<vector<int>> A(m); rep(i, n) { int a, b; cin >> a >> b; if (a > m) continue; A[m - a].push_back(b); } ll ans = 0; priority...
replace
8
9
8
9
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> #define fo(i, w, n) for (int i = (int)w; i < (int)n; i++) #define qi queue<int> #define vi vector<int> #define ll long long #define pb push_back #define lb lower_bound #define ub upper_bound #define pii pair<int, int> #define mp make_pair #define all(a) (a).begin(), (a).end() #define fi first #...
#include <bits/stdc++.h> #define fo(i, w, n) for (int i = (int)w; i < (int)n; i++) #define qi queue<int> #define vi vector<int> #define ll long long #define pb push_back #define lb lower_bound #define ub upper_bound #define pii pair<int, int> #define mp make_pair #define all(a) (a).begin(), (a).end() #define fi first #...
replace
44
45
44
45
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<vector<int>> v(m); REP(i, n) { int a, b; cin >> a >> b; v[m - a].push_back(b); } priority_queue<int> q; ll ans = 0; for (...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<vector<int>> v(m); REP(i, n) { int a, b; cin >> a >> b; if (a > m) continue; v[m - a].push_back(b); } priority_queue...
replace
14
15
14
16
0
p02948
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define MAX_A 100000 using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A[MAX_A]; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; A[a].emplace_back(b); } priority_queue<int> que; int an...
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define MAX_A 100001 using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A[MAX_A]; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; A[a].emplace_back(b); } priority_queue<int> que; int an...
replace
5
6
5
6
0
p02948
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define ll long long #define repp(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define repm(i, a, b) for (int i = (int)(a); i > (int)(b); --i) using nam...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define ll long long #define repp(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define repm(i, a, b) for (int i = (int)(a); i > (int)(b); --i) using nam...
replace
19
20
19
20
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MAX = 5100000; ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); } long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMin...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MAX = 5100000; ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); } long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMin...
replace
48
49
48
49
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; int main() { int N, M; cin >> N >> M; int a[N], b[N]; vector<P> ab; for (int i = 0; i < N; i++) { cin >> a[i] >> b[i]; ab.push_back(P(a[i], b[i])); } sort(ab.begin(), ab.end()); int num = 0; int ans = 0; priority_queue...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; int main() { int N, M; cin >> N >> M; int a[N], b[N]; vector<P> ab; for (int i = 0; i < N; i++) { cin >> a[i] >> b[i]; ab.push_back(P(a[i], b[i])); } sort(ab.begin(), ab.end()); int num = 0; int ans = 0; priority_queue...
replace
20
21
20
21
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> ev[10010]; for (int i = 0; i < N; i++) { int x, y; cin >> x >> y; if (M - x >= 0) ev[M - x].emplace_back(y); } long long ret = 0; priority_queue<int> que; for (int i = M; i >= 0; i--) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> ev[100100]; for (int i = 0; i < N; i++) { int x, y; cin >> x >> y; if (M - x >= 0) ev[M - x].emplace_back(y); } long long ret = 0; priority_queue<int> que; for (int i = M; i >= 0; i--) { ...
replace
7
8
7
8
0
p02948
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, M; cin >> N >> M; vector<pair<int, int>> AB(N); for (auto &ab : AB) cin >> ab.first >> ab.second; sort(AB.begin(), AB.end(), [](const pair<int, int> &_a, const pair<int, int> &_b) { ...
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, M; cin >> N >> M; vector<pair<int, int>> AB(N); for (auto &ab : AB) cin >> ab.first >> ab.second; sort(AB.begin(), AB.end()); priority_queue<int> Q; int ans = 0, j = 0; for (int i = 1...
replace
10
28
10
22
TLE
p02948
C++
Time Limit Exceeded
#ifdef DEBUG_IS_VALID #define DEB 1 #define _LIBCPP_DEBUG 0 #else #define DEB 0 #define NDEBUG #endif #include <bits/stdc++.h> using namespace std; #define ALL(g) (g).begin(), (g).end() #define REP(i, x, n) for (int i = x; i < n; i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, x, n) for (int i = x; i >= n; i--) #...
#ifdef DEBUG_IS_VALID #define DEB 1 #define _LIBCPP_DEBUG 0 #else #define DEB 0 #define NDEBUG #endif #include <bits/stdc++.h> using namespace std; #define ALL(g) (g).begin(), (g).end() #define REP(i, x, n) for (int i = x; i < n; i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, x, n) for (int i = x; i >= n; i--) #...
replace
109
110
109
110
TLE
p02948
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; const auto MOD = 1000000007; const int INF = 1e9; const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); i++) ...
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; const auto MOD = 1000000007; const int INF = 1e9; const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); i++) ...
delete
80
81
80
80
TLE
p02948
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <cassert> typedef long long int ll; using namespace std; #if defined(DEBUG) #include <sys/fcntl.h> #include <unistd.h> #define DLOG(...) cerr << dbgFormat(__VA_ARGS__) << endl #define DCALL(func, ...) func(__VA_ARGS__) template <class... Args> string dbgFormat(const char *fmt, Args....
#include <bits/stdc++.h> #include <cassert> typedef long long int ll; using namespace std; #if defined(DEBUG) #include <sys/fcntl.h> #include <unistd.h> #define DLOG(...) cerr << dbgFormat(__VA_ARGS__) << endl #define DCALL(func, ...) func(__VA_ARGS__) template <class... Args> string dbgFormat(const char *fmt, Args....
replace
46
48
46
47
TLE
p02948
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define scn(n) scanf("%d", &n) #define lscn(n) scanf("%lld", &n) #define lpri(n) printf("%lld", n) #define pri(n) printf("%d", n) #define pln() printf("\n") #define priln(n) printf("%d\n", n) #define lpriln(n) printf("%lld\n", n) #define rep(i, init, n) for (int i = init; i...
#include <bits/stdc++.h> #define ll long long #define scn(n) scanf("%d", &n) #define lscn(n) scanf("%lld", &n) #define lpri(n) printf("%lld", n) #define pri(n) printf("%d", n) #define pln() printf("\n") #define priln(n) printf("%d\n", n) #define lpriln(n) printf("%lld\n", n) #define rep(i, init, n) for (int i = init; i...
replace
43
44
43
44
TLE
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long int ll; int main() { int N, M; cin >> N >> M; vector<int> v[M + 1]; for (int i = 0; i < N; i++) { int A, B; cin >> A >> B; v[A].push_back(B); } int ans = 0; priority_queue<int> pq; for (int i = 1; i <= M...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long int ll; int main() { int N, M; cin >> N >> M; vector<int> v[1000007]; for (int i = 0; i < N; i++) { int A, B; cin >> A >> B; v[A].push_back(B); } int ans = 0; priority_queue<int> pq; for (int i = 1; i <=...
replace
8
9
8
9
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) #define all_map(pos, mp) for (ll pos = mp.begin(); pos != mp.end(); pos - ++) #define ALL(a) (a).begin(), (a).end() using namespace std; using ll = long long; using pll = pair<ll, ll>; const ll MOD = 1e9 + 7; const ll LINF = 1LL << 62; const int I...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) #define all_map(pos, mp) for (ll pos = mp.begin(); pos != mp.end(); pos - ++) #define ALL(a) (a).begin(), (a).end() using namespace std; using ll = long long; using pll = pair<ll, ll>; const ll MOD = 1e9 + 7; const ll LINF = 1LL << 62; const int I...
replace
19
20
19
20
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MAX = 5100000; ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); } long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMin...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MAX = 5100000; ll gcd(ll a, ll b) { return (b == 0) ? a : gcd(b, a % b); } long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMin...
replace
58
59
58
59
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(a, b, c) for (register int a = b, _n = c; a <= _n; ++a) #define DREP(a, b, c) for (register int a = b, _n = c; a >= _n; --a) #define FOR(a, b, c) for (register int a = b, _n = c; a < _n; ++a) #define DFOR(a, b, c) for (register int a = b, _n = c; a > _n; --a) ...
#include <bits/stdc++.h> using namespace std; #define REP(a, b, c) for (register int a = b, _n = c; a <= _n; ++a) #define DREP(a, b, c) for (register int a = b, _n = c; a >= _n; --a) #define FOR(a, b, c) for (register int a = b, _n = c; a < _n; ++a) #define DFOR(a, b, c) for (register int a = b, _n = c; a > _n; --a) ...
replace
37
38
37
38
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m; cin >> n >> m; vector<vector<int>> k(m, vector<int>(1, 0)); int ans = 0; priority_queue<int, vector<int>, less<int>> q; rep(i, n) { int a, b; cin >> a >> b; k[a - 1].push_bac...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m; cin >> n >> m; vector<vector<int>> k(m, vector<int>(1, 0)); int ans = 0; priority_queue<int, vector<int>, less<int>> q; rep(i, n) { int a, b; cin >> a >> b; if (a > m) ...
insert
12
12
12
14
0
p02948
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; vector<int> ve[12000]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; int x, y; for (int i = 0; i < n; i++) { cin >> x >> y; if (x > k) continue; int tt = k - x + 1...
#include <iostream> #include <queue> #include <vector> using namespace std; vector<int> ve[120000]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; int x, y; for (int i = 0; i < n; i++) { cin >> x >> y; if (x > k) continue; int tt = k - x + ...
replace
6
7
6
7
0
p02948
C++
Runtime Error
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define rrep(i, n) for (ll i##_len = (n), i = i##_len - 1; i >= 0; --i) #define repi(i, a, b) for (ll i = ll(a); i < ll(b); ++i) #define printd(val) std::cout << #val " = " << val << "\n"; #include <bits/stdc++.h> using ll = long long; using pii = std::p...
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define rrep(i, n) for (ll i##_len = (n), i = i##_len - 1; i >= 0; --i) #define repi(i, a, b) for (ll i = ll(a); i < ll(b); ++i) #define printd(val) std::cout << #val " = " << val << "\n"; #include <bits/stdc++.h> using ll = long long; using pii = std::p...
replace
48
50
48
52
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N, M; cin >> N >> M; vector<pair<int, int>> A(N, pair<int, int>(0, 0)); for (int i = 0; i < N; i++) { cin >> A.at(i).second >> A.at(i).first; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); vector<int> D(M...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N, M; cin >> N >> M; vector<pair<int, int>> A(N, pair<int, int>(0, 0)); for (int i = 0; i < N; i++) { cin >> A.at(i).second >> A.at(i).first; } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); vector<int> D(M...
replace
21
22
21
22
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> g[M + 10]; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; g[a].push_back(b); } priority_queue<int> que; int ans = 0; for (int i = 1; i <= M; i++) { for (auto v : g[i]) { que.pus...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> g[100100]; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; g[a].push_back(b); } priority_queue<int> que; int ans = 0; for (int i = 1; i <= M; i++) { for (auto v : g[i]) { que.pus...
replace
6
7
6
7
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<pair<int, int>> a; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; if (x <= m) { a.push_back(make_pair(x, y)); } } ll ans...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<pair<int, int>> a; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; if (x <= m) { a.push_back(make_pair(x, y)); } } ll ans...
replace
22
23
22
23
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, m; const int N = 1e5 + 7; pair<int, int> prs[N]; int main() { ios_base::sync_with_stdio(0), cin.tie(0); #ifndef ONLINE_JUDGE freopen("input.in", "rt", stdin); #endif cin >> n >> m; for (int i = 0; i < n; ++i) { cin >> prs[i].second >> prs[i].first; } ...
#include <bits/stdc++.h> using namespace std; int n, m; const int N = 1e5 + 7; pair<int, int> prs[N]; int main() { ios_base::sync_with_stdio(0), cin.tie(0); cin >> n >> m; for (int i = 0; i < n; ++i) { cin >> prs[i].second >> prs[i].first; } sort(prs, prs + n, greater<>()); set<int> ss; for (int i =...
delete
9
12
9
9
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define per(i, n) for (int i = n - 1; i >= 0; i--) typedef long long ll; typedef pair<int, int> P; typedef pair<long long, long long> Pll; typedef vector<int> vi; typedef vector<ll> vll; const long long mod = 1000000007LL; int ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define per(i, n) for (int i = n - 1; i >= 0; i--) typedef long long ll; typedef pair<int, int> P; typedef pair<long long, long long> Pll; typedef vector<int> vi; typedef vector<ll> vll; const long long mod = 1000000007LL; int ...
replace
15
16
15
16
0
p02948
C++
Time Limit Exceeded
// #include <bits/stdc++.h> #include <algorithm> // std::sort, std::min, std::next_permutation, std::lower_bound #include <cmath> // std::ceil #include <cmath> // std::atan2 #include <iomanip> // std::setprecision #include <iostream> #include <limits> // std::numeric_limits<long int>::max() #include <map> #incl...
// #include <bits/stdc++.h> #include <algorithm> // std::sort, std::min, std::next_permutation, std::lower_bound #include <cmath> // std::ceil #include <cmath> // std::atan2 #include <iomanip> // std::setprecision #include <iostream> #include <limits> // std::numeric_limits<long int>::max() #include <map> #incl...
replace
40
48
40
45
TLE
p02948
C++
Runtime Error
#include <bits/stdc++.h> #define WHOLE(v) (v).begin(), (v).end() #define REV_WHOLE(v) (v).rbegin(), (v).rend() using i64 = int64_t; using namespace std; int main() { int N, M; cin >> N >> M; vector<pair<int, int>> data; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; data.emplace_back(a, b); ...
#include <bits/stdc++.h> #define WHOLE(v) (v).begin(), (v).end() #define REV_WHOLE(v) (v).rbegin(), (v).rend() using i64 = int64_t; using namespace std; int main() { int N, M; cin >> N >> M; vector<pair<int, int>> data; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; data.emplace_back(a, b); ...
replace
19
20
19
20
0
p02948
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define LL long long #define mod 1000000007 int N, M, ans = 0; pair<int, int> A...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define LL long long #define mod 1000000007 int N, M, ans = 0; pair<int, int> A...
insert
26
26
26
27
-11
p02948
C++
Time Limit Exceeded
/// mAAria... #include <bits/stdc++.h> using namespace std; #define int long long #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
/// mAAria... #include <bits/stdc++.h> using namespace std; #define int long long #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
replace
57
58
57
58
TLE
p02948
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, m; cin >> n >> m; vector<vector<int>> a(m); rep(i, n) { int p, q; cin >> p >> q; a[p - 1].push_back(q); } priority_queue<int> que; ...
#include <iostream> #include <queue> #include <vector> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, m; cin >> n >> m; vector<vector<int>> a(m); rep(i, n) { int p, q; cin >> p >> q; if (p <= m) a[p - 1].push_back(q); } priority...
replace
13
14
13
15
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef complex<double> Vec; ll N, M; vector<vector<ll>> New; multiset<ll, greater<ll>> Now; ll R; int main() { cin >> N >> M; New.resize(M); for (ll i = 0; i < N; ++i) { ll a, b; cin >> a >> b; New[a - 1].push_back(b); } for (...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef complex<double> Vec; ll N, M; vector<vector<ll>> New; multiset<ll, greater<ll>> Now; ll R; int main() { cin >> N >> M; New.resize(M); for (ll i = 0; i < N; ++i) { ll a, b; cin >> a >> b; --a; if (a >= M) continue;...
replace
17
18
17
21
0
p02948
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> using namespace std; const int N = 1e5 + 4; int n, m; int tot; struct Node { int a, b; friend bool operator<(const Node &x, const Node &y) { return x.b < y.b; } } p[N]; bool cmp(Node c, Node d) { return c.a < d.a; } prior...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> using namespace std; const int N = 1e5 + 4; int n, m; int tot; struct Node { int a, b; friend bool operator<(const Node &x, const Node &y) { return x.b < y.b; } } p[N]; bool cmp(Node c, Node d) { return c.a < d.a; } prior...
replace
38
40
38
42
-11
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, m, n) for (int i = m; i < n; i++) int main() { // ここに処理を記述 int N, M; cin >> N >> M; vector<pair<int, int>> v; int A, B; for (int i = 0; i < N; i++) { cin >> A >> B...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, m, n) for (int i = m; i < n; i++) int main() { // ここに処理を記述 int N, M; cin >> N >> M; vector<pair<int, int>> v; int A, B; for (int i = 0; i < N; i++) { cin >> A >> B...
replace
36
37
36
37
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define pb push_back #define pii pair<int, int> #define sz size() #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char *name, Arg1 &&arg1) { cout << name << " : " << arg1 << "\...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define pb push_back #define pii pair<int, int> #define sz size() #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char *name, Arg1 &&arg1) { cout << name << " : " << arg1 << "\...
replace
50
52
50
54
-11
p02948
C++
Runtime Error
/* */ #include <algorithm> #include <cstdlib> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define repb(i, a, b) for (int i = a; i < b; i++) #...
/* */ #include <algorithm> #include <cstdlib> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define repb(i, a, b) for (int i = a; i < b; i++) #...
replace
33
34
33
36
0
p02948
C++
Time Limit Exceeded
// abc137_d.cpp // Sat Aug 10 20:49:51 2019 #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define INTINF 2147483647 #define LLINF 9223372036854775807 using namespace std; using ll = long long; typed...
// abc137_d.cpp // Sat Aug 10 20:49:51 2019 #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define INTINF 2147483647 #define LLINF 9223372036854775807 using namespace std; using ll = long long; typed...
replace
53
54
53
57
TLE
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define REP(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ALL(x) (x).begin(), (x).end() typedef long long ll; #def...
#include <bits/stdc++.h> using namespace std; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define REP(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ALL(x) (x).begin(), (x).end() typedef long long ll; #def...
replace
20
21
20
21
0
p02948
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int N, M; cin >> N >> M; vector<int> P[100000]; int A, B; rep(i, N) { cin >> A >> B; P[A].emplace_back(B); } priority_queue<int> que; long long res = 0; for (int i = 1; i <= M; i++) { ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int N, M; cin >> N >> M; vector<int> P[100001]; int A, B; rep(i, N) { cin >> A >> B; P[A].emplace_back(B); } priority_queue<int> que; long long res = 0; for (int i = 1; i <= M; i++) { ...
replace
8
9
8
9
0
p02948
C++
Runtime Error
#include <algorithm> #include <numeric> #include <stdio.h> #include <string> #include <vector> const int mod = 1000000007; class carr { int **c; int level; public: carr(int n, int t = 0) { for (int i = 0; i < 30; i++) { if (1 << i >= n) { level = i + 1; break; } } c = new...
#include <algorithm> #include <numeric> #include <stdio.h> #include <string> #include <vector> const int mod = 1000000007; class carr { int **c; int level; public: carr(int n, int t = 0) { for (int i = 0; i < 30; i++) { if (1 << i >= n) { level = i + 1; break; } } c = new...
insert
91
91
91
93
0
p02948
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #define maxn 100005 using namespace std; priority_queue<int> q; vector<int> G[maxn]; int read() { int cnt = 0; char ch = getchar(); while (ch < '0' || '9' < ch) ch = getchar(); while ('0' <= ch && ch <= '9') { cnt = cnt * 10 + c...
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #define maxn 100005 using namespace std; priority_queue<int> q; vector<int> G[maxn]; int read() { int cnt = 0; char ch = getchar(); while (ch < '0' || '9' < ch) ch = getchar(); while ('0' <= ch && ch <= '9') { cnt = cnt * 10 + c...
replace
23
24
23
25
0
p02949
C++
Runtime Error
// Optimise #include <bits/stdc++.h> using namespace std; // #define multitest 1 #ifdef Debug #define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__); #define pc(...) PC(#__VA_ARGS__, __VA_ARGS__); template <typename T, typename U> ostream &operator<<(ostream &out, const pair<T, U> &p) { out << '[' << p.first << ", " << p.sec...
// Optimise #include <bits/stdc++.h> using namespace std; // #define multitest 1 #ifdef Debug #define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__); #define pc(...) PC(#__VA_ARGS__, __VA_ARGS__); template <typename T, typename U> ostream &operator<<(ostream &out, const pair<T, U> &p) { out << '[' << p.first << ", " << p.sec...
replace
40
41
40
41
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const int INF = 1001001001; vector<int> to[2505]; vector<int> rto[2505]; bool reachableFrom1[2505]; bool reachableToN[2505]; bool ok[2505]; void dfs(int v) { if (reachableFrom1[v]) return; reac...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const int INF = 1001001001; vector<int> to[2505]; vector<int> rto[2505]; bool reachableFrom1[2505]; bool reachableToN[2505]; bool ok[2505]; void dfs(int v) { if (reachableFrom1[v]) return; reac...
insert
36
36
36
37
-11
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = long long; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return std::...
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = long long; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return std::...
replace
75
76
75
76
0
p02949
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
53
54
53
54
TLE
p02949
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int n, m, p; cin >> n >> m >> p; vector<int> a(m), b(m), c(m); for (int i = 0; i < m; i++) { cin >> a[i] >> b[i] >> c[i]; a[i]--; b[i]--; c[i] = p - c[i]; } vector<bool> reach_fwd(n, false); reach_...
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int n, m, p; cin >> n >> m >> p; vector<int> a(m), b(m), c(m); for (int i = 0; i < m; i++) { cin >> a[i] >> b[i] >> c[i]; a[i]--; b[i]--; c[i] = p - c[i]; } vector<bool> reach_fwd(n, false); reach_...
replace
55
57
55
57
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; struct Edge { ll to; ll from; ll cos...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; struct Edge { ll to; ll from; ll cos...
replace
21
23
21
23
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define inf 1000000000 #define INF 100000000000000 #define ll long long #define ull unsigned long long #define M (int)(1e9 + 7) #define P pair<int, int> #define PLL pair<ll, ll> #define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++) #define RFOR(i, m, n) for (int i = (...
#include <bits/stdc++.h> using namespace std; #define inf 1000000000 #define INF 100000000000000 #define ll long long #define ull unsigned long long #define M (int)(1e9 + 7) #define P pair<int, int> #define PLL pair<ll, ll> #define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++) #define RFOR(i, m, n) for (int i = (...
replace
62
63
62
63
0
p02949
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #define rep(index, num) for (int index = 0; index < num; index++) #define rep1(index, num) for (int ...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #define rep(index, num) for (int index = 0; index < num; index++) #define rep1(index, num) for (int ...
replace
30
31
30
31
0
p02949
C++
Time Limit Exceeded
#include <iostream> #include <queue> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long using namespace std; vector<int> to[2505]; vector<int> rto[2505]; bool from1[2505]; bool toN[2505]; void dfs(int v) { if (from1[v]) return; from1[v] = t...
#include <iostream> #include <queue> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long using namespace std; vector<int> to[2505]; vector<int> rto[2505]; bool from1[2505]; bool toN[2505]; void dfs(int v) { if (from1[v]) return; from1[v] = t...
replace
71
75
71
75
TLE
p02949
C++
Runtime Error
// #pragma GCC optimize("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma warning(disable : 4786) #pragma warning(disable : 4996) #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #includ...
// #pragma GCC optimize("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma warning(disable : 4786) #pragma warning(disable : 4996) #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #includ...
replace
119
120
119
120
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif struct edge { int to, cost; }; vector<edge> G[3010]; vector<int> RG[3010], can_use(3010, 0); vector<int> dist; int bellmanford(int n, int s) { // 頂点数、始点 const int INF = 1LL << 60; dist = vec...
#include <bits/stdc++.h> using namespace std; #define int long long #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif struct edge { int to, cost; }; vector<edge> G[3010]; vector<int> RG[3010], can_use(3010, 0); vector<int> dist; int bellmanford(int n, int s) { // 頂点数、始点 const int INF = 1LL << 60; dist = vec...
insert
49
49
49
51
0
p02949
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; #define REP(i, n) FOR(i, 0, n) #define FOR(i, sta, n) \ for (long lo...
#include <algorithm> #include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; #define REP(i, n) FOR(i, 0, n) #define FOR(i, sta, n) \ for (long lo...
replace
40
42
40
41
0
p02949
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #define N 2007 #define M 5007 #define int long long using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0'...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #define N 2507 #define M 5007 #define int long long using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0'...
replace
4
5
4
5
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int n, m, p; cin >> n >> m >> p; int a[5010], b[5010]; long long c[5010], dist[5010]; for (int i = 0; i < m; i++) { cin >> a[i] >> b[i] >> c[i]; c[i] = -c[i]; c[i] += p; a[i]--, b[i]--; } ...
#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int n, m, p; cin >> n >> m >> p; int a[5010], b[5010]; long long c[5010], dist[5010]; for (int i = 0; i < m; i++) { cin >> a[i] >> b[i] >> c[i]; c[i] = -c[i]; c[i] += p; a[i]--, b[i]--; } ...
replace
41
42
41
42
0
p02949
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++) #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--) #define FOR(i, n1, n2) for (ll i = (ll)(n1); i...
#include "bits/stdc++.h" using namespace std; #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++) #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--) #define FOR(i, n1, n2) for (ll i = (ll)(n1); i...
replace
112
113
112
113
0
p02949
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++) #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--) #define FOR(i, n1, n2) for (ll i = (ll)(n1); i...
#include "bits/stdc++.h" using namespace std; #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++) #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define RREP(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--) #define FOR(i, n1, n2) for (ll i = (ll)(n1); i...
replace
106
107
106
107
-11
p02949
Python
Runtime Error
from collections import defaultdict, deque N, M, P = map(int, input().split()) G = defaultdict(lambda: defaultdict(lambda: 10000000)) G_rev = defaultdict(lambda: defaultdict(lambda: 10000000)) for i in range(1, N + 1): G[i] = dict() G_rev[i] = dict() for _ in range(M): A, B, C = map(int, input().split())...
from collections import defaultdict, deque N, M, P = map(int, input().split()) G = defaultdict(lambda: defaultdict(lambda: 10000000)) G_rev = defaultdict(lambda: defaultdict(lambda: 10000000)) for _ in range(M): A, B, C = map(int, input().split()) G[A][B] = min(G[A][B], P - C) G_rev[B][A] = 1 reachable_N...
delete
5
9
5
5
KeyError: 2
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02949/Python/s582998390.py", line 13, in <module> G[A][B] = min(G[A][B], P - C) KeyError: 2
p02949
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <queue> #include <vector> using namespace std; const int MAXN = 2500; const long long INF = 1e17; int N, M, PF, vis[MAXN]; int Ok[MAXN], cnt[MAXN]; long long dist[MAXN], Ans; vector<int> P[MAXN], T[MAXN], F[MAXN]; queue<int> Q; void SPFA(int u, int val) { for (int i = 1...
#include <algorithm> #include <cstdio> #include <queue> #include <vector> using namespace std; const int MAXN = 2500; const long long INF = 1e17; int N, M, PF, vis[MAXN]; int Ok[MAXN], cnt[MAXN]; long long dist[MAXN], Ans; vector<int> P[MAXN], T[MAXN], F[MAXN]; queue<int> Q; void SPFA(int u, int val) { for (int i = 1...
replace
28
29
28
29
TLE
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vs = vector<string>; using pll = pair<ll, ll>; using vp = vector<pll>; #define rep(i, n) for (...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vs = vector<string>; using pll = pair<ll, ll>; using vp = vector<pll>; #define rep(i, n) for (...
replace
62
63
62
63
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vs = vector<string>; using pll = pair<ll, ll>; using vp = vector<pll>; #define rep(i, n) for (...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vs = vector<string>; using pll = pair<ll, ll>; using vp = vector<pll>; #define rep(i, n) for (...
replace
62
64
62
64
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; const int INF = 1001001001; vector<int> to[2505]; vector<int> rto[2505]; bool reachableFrom1[2505]; bool reachableToN[2505]; bool ok[2505]; void dfs(int v) { if (reachableFrom1[v]) return; reachab...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; const int INF = 1001001001; vector<int> to[2505]; vector<int> rto[2505]; bool reachableFrom1[2505]; bool reachableToN[2505]; bool ok[2505]; void dfs(int v) { if (reachableFrom1[v]) return; reachab...
replace
54
55
54
55
0
p02949
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) const int inf = 1e9 + 7; const ll longinf = 1LL << 60; const ll mod = 1e9 + 7; struct Edge { int to; int cost; Edge(int t, int c) : to(t), cost(c) {} };...
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) const int inf = 1e9 + 7; const ll longinf = 1LL << 60; const ll mod = 1e9 + 7; struct Edge { int to; int cost; Edge(int t, int c) : to(t), cost(c) {} };...
replace
63
64
63
67
TLE
p02949
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace st...
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace st...
replace
207
208
207
208
0
p02949
C++
Runtime Error
#include <algorithm> #include <complex> #include <cstdlib> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; long long int INF = 99999999999999; // INFを...
#include <algorithm> #include <complex> #include <cstdlib> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; long long int INF = 99999999999999; // INFを...
replace
50
51
50
51
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> #define vi vector<ll> #define vvi vector<vi> #define llINF 1e18 #define ll long long using namespace std; bool vis[2222]; struct Edge { ll to, cost; }; const ll MAX_V = 2010; vector<vector<Edge>> E(MAX_V); vi dist(MAX_V, llINF); bool bellman_ford(ll s) { queue<ll> que; que.push(s); dist...
#include <bits/stdc++.h> #define vi vector<ll> #define vvi vector<vi> #define llINF 1e18 #define ll long long using namespace std; bool vis[2222]; struct Edge { ll to, cost; }; const ll MAX_V = 2510; vector<vector<Edge>> E(MAX_V); vi dist(MAX_V, llINF); bool bellman_ford(ll s) { queue<ll> que; que.push(s); dist...
replace
10
11
10
11
0
p02949
C++
Runtime Error
// Hack it and have it ;) // /*author* Priyanshu Shrivastav (from IIT Palakkad) * * *_ __ ___ _ ______ ___ _ ____ ___ ___| |_ * * | '_ ` _ \| '__/ __/ _ \| '_ \ \ / / |/ __| __| * * | | | | | | | | (_| (_) | | | \ V /| | (__| |_ * * |_| |_| |_|_|(_)___\___/|_| |_|\_/ |_|\___|\__| * When I wrote this, only Go...
// Hack it and have it ;) // /*author* Priyanshu Shrivastav (from IIT Palakkad) * * *_ __ ___ _ ______ ___ _ ____ ___ ___| |_ * * | '_ ` _ \| '__/ __/ _ \| '_ \ \ / / |/ __| __| * * | | | | | | | | (_| (_) | | | \ V /| | (__| |_ * * |_| |_| |_|_|(_)___\___/|_| |_|\_/ |_|\___|\__| * When I wrote this, only Go...
replace
73
74
73
74
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define Int long long #define int long long // TEMPLATE // START---------------8<---------------8<---------------8<---------------8<---------------// typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; ...
#include <bits/stdc++.h> using namespace std; #define Int long long #define int long long // TEMPLATE // START---------------8<---------------8<---------------8<---------------8<---------------// typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; ...
insert
315
315
315
317
0
p02949
C++
Runtime Error
// ██████╗ ██╗ ██╗██╗ ██████╗ ███████╗ // ██╔══██╗██║ ██║██║ ██╔══██╗██╔════╝ // ██████╔╝██║ ██║██║█████╗██║ ██║█████╗ // ██╔══██╗██║ ██║██║╚════╝██║ ██║██╔══╝ // ██║ ██║╚██████╔╝██║ ██████╔╝███████╗ // ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ #include <bits/stdc++.h> // #pragma GCC target(...
// ██████╗ ██╗ ██╗██╗ ██████╗ ███████╗ // ██╔══██╗██║ ██║██║ ██╔══██╗██╔════╝ // ██████╔╝██║ ██║██║█████╗██║ ██║█████╗ // ██╔══██╗██║ ██║██║╚════╝██║ ██║██╔══╝ // ██║ ██║╚██████╔╝██║ ██████╔╝███████╗ // ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ #include <bits/stdc++.h> // #pragma GCC target(...
insert
104
104
104
105
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if (!(p)) #define until(p) while (!(p)) using ll = std::int64_t; constexpr int INF = 1001001001; int N, M, P; int A[2600], B[2600], C[2600]; std::vector<int> G[2600], rG[2600]; bool us...
#include <bits/stdc++.h> #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if (!(p)) #define until(p) while (!(p)) using ll = std::int64_t; constexpr int INF = 1001001001; int N, M, P; int A[5100], B[5100], C[5100]; std::vector<int> G[2600], rG[2600]; bool us...
replace
12
13
12
13
0
p02949
C++
Runtime Error
#include "bits/stdc++.h" typedef long long ll; #define int ll #define fi first #define se second #define SORT(a) sort(a.begin(), a.end()) #define rep(i, n) for (int i = 0; i < (n); i++) #define REP(i, n) for (int i = 0; i < (n); i++) #define MP(a, b) make_pair(a, b) #define pb(a) push_back(a) #define INF LLONG_MAX / 2...
#include "bits/stdc++.h" typedef long long ll; #define int ll #define fi first #define se second #define SORT(a) sort(a.begin(), a.end()) #define rep(i, n) for (int i = 0; i < (n); i++) #define REP(i, n) for (int i = 0; i < (n); i++) #define MP(a, b) make_pair(a, b) #define pb(a) push_back(a) #define INF LLONG_MAX / 2...
replace
52
53
52
53
0
p02949
C++
Time Limit Exceeded
// // main.cpp // #include <algorithm> #include <array> #include <assert.h> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <memory> #include <queue> #include <random> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #in...
// // main.cpp // #include <algorithm> #include <array> #include <assert.h> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <memory> #include <queue> #include <random> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #in...
replace
62
64
62
64
TLE
p02949
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define endl "\n" using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define fi first #define se second ...
#include <bits/stdc++.h> #define endl "\n" using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define fi first #define se second ...
replace
115
116
115
123
TLE
p02949
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef tree<ll, null_typ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef tree<ll, null_typ...
replace
42
43
42
43
0
p02949
C++
Time Limit Exceeded
#include <iostream> #include <limits> #include <vector> #include <unordered_set> using namespace std; struct arc { int to, cost; }; struct node { int value; vector<arc> arcs; node(int v) : value(v) {} }; class graph { protected: vector<node> nodes; public: graph(int N, int value) : nodes(N, value){}; ...
#include <iostream> #include <limits> #include <vector> #include <unordered_set> using namespace std; struct arc { int to, cost; }; struct node { int value; vector<arc> arcs; node(int v) : value(v) {} }; class graph { protected: vector<node> nodes; public: graph(int N, int value) : nodes(N, value){}; ...
insert
95
95
95
97
TLE
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define LLINF 9223372036854775807 #define MOD ll(1e9 + 7) #define all(x) (x).begin(), (x).end() #define dbg(x) cerr << #x << ": " << x << endl #define MAX_DIST 1LL << 50 #define NMAX 10 #define MMA...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define LLINF 9223372036854775807 #define MOD ll(1e9 + 7) #define all(x) (x).begin(), (x).end() #define dbg(x) cerr << #x << ": " << x << endl #define MAX_DIST 1LL << 50 #define NMAX 3000 #define M...
replace
11
12
11
12
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define MAX 5050 #define INF (1LL << 60LL) typedef pair<int, int> P; int V; struct edge2 { int from, to, cost; edge2() {} edge2(int from, int to, int cost) : from(from), to(to), cost(cost) {} }; edge2 es[MAX]; int d[MAX]; int ok[MAX]; int used[MA...
#include <bits/stdc++.h> using namespace std; #define int long long #define MAX 5050 #define INF (1LL << 60LL) typedef pair<int, int> P; int V; struct edge2 { int from, to, cost; edge2() {} edge2(int from, int to, int cost) : from(from), to(to), cost(cost) {} }; edge2 es[MAX]; int d[MAX]; int ok[MAX]; int used[MA...
replace
41
42
41
42
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double Double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) // chmax, chmin 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, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double Double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) // chmax, chmin 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, ...
replace
57
58
57
58
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define HUGE_NUM 1000000000000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; #define SIZE 2505 struct Edge { void set(int arg_from, int arg_to, ll arg_value) { from = arg...
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define HUGE_NUM 1000000000000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; #define SIZE 2505 struct Edge { void set(int arg_from, int arg_to, ll arg_value) { from = arg...
replace
24
25
24
25
0
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; const ll mod = 1e9 + 7; // const ll mod=998244353; const ll inf = 5e18; int main() { ll n, m, p; cin >> n >> m >> p; vec d(n, -inf); d[0] = 0; vec a(n); vec b(n); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; const ll mod = 1e9 + 7; // const ll mod=998244353; const ll inf = 5e18; int main() { ll n, m, p; cin >> n >> m >> p; vec d(n, -inf); d[0] = 0; vec a(m); vec b(m); ...
replace
15
18
15
18
0
p02949
C++
Time Limit Exceeded
#include "bits/stdc++.h" #include <cassert> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) const long long mod = 998244353; const long long inf = 1ll << 61; const double eps = 0.000000000001; typedef pair<int, int> P; typedef pair<P, int> PP; struct edge { int from, to, cost;...
#include "bits/stdc++.h" #include <cassert> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) const long long mod = 998244353; const long long inf = 1ll << 61; const double eps = 0.000000000001; typedef pair<int, int> P; typedef pair<P, int> PP; struct edge { int from, to, cost;...
replace
65
74
65
66
TLE
p02949
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long typedef pair<int, int> pii; queue<int> q; int ver[3009], edge[5009 * 2], nxt[5009 * 2], head[5009 * 2], tot = 0; ll d[3009]; int v[3009]; void add(int x, int y, int z) { ver[++tot] = y; edge[tot] = z; nxt[tot] = head...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long typedef pair<int, int> pii; queue<int> q; int ver[5009 * 2], edge[5009 * 2], nxt[5009 * 2], head[3009], tot = 0; ll d[3009]; int v[3009]; void add(int x, int y, int z) { ver[++tot] = y; edge[tot] = z; nxt[tot] = head...
replace
6
7
6
7
0
p02949
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <unordered_map> #include <unordered_set> #include <ve...
#include <algorithm> #include <bitset> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <unordered_map> #include <unordered_set> #include <ve...
replace
89
91
89
93
TLE
p02950
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second #define pii pair<int, int> #define pli pair<ll, int> #define pil pair<int, ll> #define pll pair<ll, ll> #define eb emplace_back #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define r...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second #define pii pair<int, int> #define pli pair<ll, int> #define pil pair<int, ll> #define pll pair<ll, ll> #define eb emplace_back #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define r...
replace
124
126
124
128
TLE
p02950
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; using ll = long long; int P; ll powmod(ll n, ll k) { ll r = 1, t = n % P; for (; k != 0; k /= 2) { if (k & 1) r = r * t % P; t = t * t % P; } re...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; using ll = long long; int P; ll powmod(ll n, ll k) { ll r = 1, t = n % P; for (; k != 0; k /= 2) { if (k & 1) r = r * t % P; t = t * t % P; } re...
replace
60
62
60
63
TLE
p02950
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 2 * 1000 + 17; const int MOD = 1000 * 1000 * 1000 + 7; struct poly { int P; vector<long long> a; poly(int P) : P(P), a(vector<long long>(P, 0ll)) {} int len() const { int res = 0; for (int i = 0; i < P; ++i) if (a[i] != 0) re...
#include <bits/stdc++.h> using namespace std; const int N = 200 * 1000 + 17; const int MOD = 1000 * 1000 * 1000 + 7; struct poly { int P; vector<long long> a; poly(int P) : P(P), a(vector<long long>(P, 0ll)) {} int len() const { int res = 0; for (int i = 0; i < P; ++i) if (a[i] != 0) ...
replace
4
5
4
5
0
p02950
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
replace
204
205
204
209
TLE
p02950
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; ll mod; struct Modint { ll num; Modint() : num() { num = 0; } Modint(ll x) : num() { num = x % mod; if (num < 0) num += mod; } inline Modint &operator=(int x) { num = x % mod; if (num < 0) num += mod; return...
#include <bits/stdc++.h> using namespace std; using ll = long long; ll mod; struct Modint { ll num; Modint() : num() { num = 0; } Modint(ll x) : num() { num = x % mod; if (num < 0) num += mod; } inline Modint &operator=(int x) { num = x % mod; if (num < 0) num += mod; return...
replace
196
198
196
200
TLE