fast_code_id
stringlengths
64
64
fast_id
stringlengths
64
64
fast_time
float64
0
0.39
language
stringclasses
1 value
measured_fast_code_id
stringlengths
64
64
measured_slow_code_id
stringlengths
64
64
measurement_metric
stringclasses
1 value
pair_id
stringlengths
6
9
problem_id
stringlengths
6
6
slow_code_id
stringlengths
64
64
slow_id
stringlengths
64
64
slow_time
float64
0
1.69
speedup
float64
2
72.5
stratum
stringclasses
3 values
sampling_key
stringlengths
64
64
slow_code
stringlengths
107
29.9k
fast_code
stringlengths
88
161k
6503235e2ed1aeb76cf82e78625582c15e3841c654ad650c6534ce2c8de91033
c889f83c4952dc23fd2f04fdda1dd4628b2136c34b58d3ca47f7cc041bb41f14
0.017954
cpp
c889f83c4952dc23fd2f04fdda1dd4628b2136c34b58d3ca47f7cc041bb41f14
e7d027f7954fe67d8c9c56d39bc4f18c31847726565d4df641d0ea5cce783092
PIE_released_gem5_runtime
pie_10033
p04040
78359b56a8205b18363eccd9861fbf6d616bfbe9eb44387ef6ca94ecb9e89c85
e7d027f7954fe67d8c9c56d39bc4f18c31847726565d4df641d0ea5cce783092
0.400695
22.31775
8+
106accddb666834d185018582115e9574efdb70a1daa2498bd23555cc3b607f0
#include <iostream> #include <cstdio> #define int long long #define N 200002 using namespace std; const int mod = 1000000007; int a, b, x, y, i, j, f[N], inv[N]; int poww(int a, int b) { int ans = 1, base = a; while (b) { if (b & 1) ans = ans * base % mod; base = base * base % mod; b ...
#include <cstdio> #include <algorithm> using namespace std; #define MOD 1000000007 #define MAXN 200005 #define LL long long LL inv[MAXN], s[MAXN]; int N; int n, m, x, y; LL Pow(LL a, int b) { LL ans = 1; while (b) { if (b & 1) ans = ans * a % MOD; a = a * a % MOD; b >>= 1; } ...
2c793dbe4b840bf21560370ebc6fd9d0586394fac8661209b4b1466d6b688413
af85ff90099f356749dc45a90f8d208bb94c40d50d767f26705cd6d8b745e5b8
0.10459
cpp
af85ff90099f356749dc45a90f8d208bb94c40d50d767f26705cd6d8b745e5b8
9a7f72758e4c969d9cc99ba3eb5eb21c0cfa002d72262a754051b19ee769d03e
PIE_released_gem5_runtime
pie_10112
p02573
a3fb58771c8949e75fa52e4d3dd805f9ec8fafab7e65e2043ddaf164ea4bda6f
9a7f72758e4c969d9cc99ba3eb5eb21c0cfa002d72262a754051b19ee769d03e
1.259351
12.040879
8+
b98ed5b11fa768651f94c7e8b0d9eb3c1a69d8d9ee732b90f9a1062867b06208
#include <iostream> #include <set> #include <vector> #include <string> #include <algorithm> #include <cmath> using namespace std; using ll = long long; #define rep(i, a, b) for (ll i = a; i < ll(b); i++) #define repr(i, a, b) for (ll i = a; i >= ll(b); i--) #define endl "\n" #define ALL(x) x.begin(), x.end()...
#include <iostream> #include <vector> using namespace std; using ll = long long; #define rep(i, a, b) for (ll i = a; i < ll(b); i++) #define endl "\n" struct UnionFind { vector<int> data; UnionFind(int size = 0) : data(size, -1) {} int root(int x) { if (data[x] < 0) return x; return x = r...
bc3b2a44632ab7bdf5b79be06ccfa4d371b95ba6b5f2975f481cba99718a3101
6fc57d3099722b85aae2a32c2f7ba263bee7963c406266a2a1fd148c21274ccd
0.081147
cpp
6fc57d3099722b85aae2a32c2f7ba263bee7963c406266a2a1fd148c21274ccd
0f770f6c133495a7edc3b6c68297963f84cd822658c30a1f3bf2ed7c02bfc45d
PIE_released_gem5_runtime
pie_10118
p03184
16ab07ec4ecbbb48c83e87e91d1e6e9fba7dae85bc1d1558cdb440982ba73205
0f770f6c133495a7edc3b6c68297963f84cd822658c30a1f3bf2ed7c02bfc45d
0.548043
6.753712
4-8
28b56969c1ce10e58ba13cc4a07fac5e5616493718d60ea174648378a9d16327
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <string> #include <map> #include <set> #include <tuple> #include <deque> #include <numeric> #include <bitset> #include <iomanip> #include <cassert> #include <chrono> #include <random> #include <limits> ...
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <string> #include <map> #include <set> #include <stack> #include <tuple> #include <deque> #include <numeric> #include <bitset> #include <iomanip> #include <cassert> #include <chrono> #include <random> ...
7feb4f36a8b52ccd2b7c7ca2682b7889109f3d42cce02db965b4c182f6a1cb1d
77dbadc25352098089b91dcc483b3c73047de54b77c178306d7e17f8283a4a3d
0.159319
cpp
77dbadc25352098089b91dcc483b3c73047de54b77c178306d7e17f8283a4a3d
d2a25a39d9762a6cfca0b8fb4d3691f50c41af0b81f4c0ba00b653210504bad0
PIE_released_gem5_runtime
pie_1051
p03362
cae5fce4661158d7faa613ce86a2ded57cbea8094ca90692b288eb269a3cded7
d2a25a39d9762a6cfca0b8fb4d3691f50c41af0b81f4c0ba00b653210504bad0
0.333276
2.09187
2-4
174c45f96f4ffd32bb99a3408fa1cd2b8551ddd015eb85422497ede6cc19e7c3
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> calc(int n) { const int sz = 55556; vector<int> sieve(sz, 1); sieve[0] = sieve[1] = 0; for (int i = 2; i < (int)sieve.size(); ++i) { for (int m = 2; i * m < sz; ++m) { sieve[i * m] = 0; } } int cnt = 0; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1000000000; void sieve(vector<int> &primes) { int n = primes.size(); primes[0] = primes[1] = 0; for (int i = 2; i * i < n; ++i) { if (not primes[i]) { continue; } for (int j = i * i; j < n; j += i) { ...
7868335e6bd3219cb60933b75e87b601cfc7dd91cabe7ebb91e792d579109ba9
606584b546256bd319712e420af9fa40a00cd43e260485006797f68c0680abd1
0.010832
cpp
606584b546256bd319712e420af9fa40a00cd43e260485006797f68c0680abd1
1dc8f2d03912916593f7cbb1a1872f261fb7d65fbe67de240eed19cace5d6b68
PIE_released_gem5_runtime
pie_108
p03440
4116ee63417236f0ad881f40abe62aff171a82cff42071138a94a0b3eca0b083
1dc8f2d03912916593f7cbb1a1872f261fb7d65fbe67de240eed19cace5d6b68
0.36841
34.012738
8+
018e09f292f4b70975823fa0104db8efb84a0b10a1c1cd3eaa03aca530dc1c0d
#include <bits/stdc++.h> typedef long long LL; const int MAXN = 1e5 + 5; int n, m, w[MAXN]; std::multiset<int> st[MAXN]; std::set<std::pair<int, int> > spec; int fa[MAXN], part; int Find(int x) { return fa[x] == x ? x : fa[x] = Find(fa[x]); } void merge(int u, int v) { if (Find(u) == Find(v)) return; ...
#include <cstdio> #include <algorithm> #define F(i, a, b) for (int i = (a); i <= (b); ++i) using namespace std; typedef long long ll; int n, m; int a[100001], b[100001], t; int fa[100001]; int ff(int x) { return fa[x] ? fa[x] = ff(fa[x]) : x; } ll Sum; int main() { int x, y; scanf("%d%d", &n, &m); if...
884d8bc3b1937f4a297314bd0f1c6d3981d7bdcebae2d54bcabcec85864aca0b
b6e46d95ded4207bc8f61629dcdf87fd85b7be148f134139f3da5ab3f0e25759
0.005552
cpp
b6e46d95ded4207bc8f61629dcdf87fd85b7be148f134139f3da5ab3f0e25759
fd0acee7f6769aa1467111dbe68902cdcda4a5722c2296fde97a7368453300c2
PIE_released_gem5_runtime
pie_11033
p03294
b1efa96e45e94c78065ba0ba5c136b9cc9592a7e32a6eb6020c21931bdb89330
fd0acee7f6769aa1467111dbe68902cdcda4a5722c2296fde97a7368453300c2
0.02919
5.257492
4-8
0e8ab6631007c453c816d98c16ff519683d80b0b0a7263754f2b69bd46627d42
#include <iostream> #include <cstdio> using namespace std; const int maxn = 3010; int a[maxn]; int main() { int n; scanf("%d", &n); int sum = 0; for (int i = 0; i < n; i++) { int t; scanf("%d", &t); sum += (t - 1); } printf("%d\n", sum); return 0; }
#include <cstdio> #include <algorithm> using namespace std; typedef long long ll; ll num[3010]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%lld", &num[i]); num[i]--; } ll res = 0; for (int i = 0; i < n; i++) { res += num[i]; } printf("%lld"...
528533f6f0516a79d69199a44b59c106f354af65a750652bb44fbbd8c219cdfd
438d4fbd76a150c7d9621f288f2fdd3f0076a1d1fe24e9d76b9c50d9449a11d3
0.02364
cpp
438d4fbd76a150c7d9621f288f2fdd3f0076a1d1fe24e9d76b9c50d9449a11d3
9cefd0600b965ca0ff9015734292d5200a2e7dc65b88a0ed012c7134477dae06
PIE_released_gem5_runtime
pie_11075
p02796
ff4271998ef8e29b730dc16d35d836f0f6edbeb81f9b14959ccef2609d7fe7f2
9cefd0600b965ca0ff9015734292d5200a2e7dc65b88a0ed012c7134477dae06
0.19349
8.184782
8+
11e645df4acf34c44962622f2086d581ab38218395f76b26d9db89ba6547e425
#pragma GCC optimize("O3") #pragma GCC target("avx") #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 << (...
#pragma GCC optimize("O3") #pragma GCC target("avx") #include <cstdio> 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) << "...
434b8b759e506915f6656050976a4c8b332ddbd56da7ecab8a81a03b26079fb4
b0b88cb2733513cdb828cb277e978d9be413e4c3a12fb8e9845cf213e3944347
0.105083
cpp
b0b88cb2733513cdb828cb277e978d9be413e4c3a12fb8e9845cf213e3944347
e7ab9fce74c66c34b2e177f0b152249cbf43bc74a7b1088af372a25ad442637b
PIE_released_gem5_runtime
pie_11141
p02373
3e2f8c3b96ec27ab48bb517c43a4223b2de33b82ad86a4a0c46dbf94c6c244f0
e7ab9fce74c66c34b2e177f0b152249cbf43bc74a7b1088af372a25ad442637b
0.410215
3.903708
2-4
01b66d7489b262b7d7f9afa23ee85ffae75c14b231db576fb68b5dd3236da9bc
#include <iostream> #include <vector> #include <map> #include <string.h> #include <algorithm> #define P pair<int, int> #define INF (1 << 30) using namespace std; vector<int> Ind(100010); vector<bool> f(100010, false); vector<vector<int>> T(100010); vector<P> ET; void dfs(int n, int dep) { f[n] = true; ...
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define INF 1 << 30 #define LINF 1LL << 60 class LCA { public: ll V; vector<vector<ll>> T; vector<pll> ET; vector<int> visited; vector<ll> Ind; ll N; vector<pll> node; ...
1cf3aa9c851cf40249a007ead37a63aa2a011f05eebe380e279fd6dcca65f570
d38ff829217f893214f20364cd88c7bc0e7810d3cdef9ce1ad4f64ae2b2db4cd
0.107837
cpp
d38ff829217f893214f20364cd88c7bc0e7810d3cdef9ce1ad4f64ae2b2db4cd
7405d61b472e468886b08ee4a51201c86388887d1351a55c86dbb59137a9767c
PIE_released_gem5_runtime
pie_11144
p03740
fabf8e8835ffd192327d2424d56c3aa2d0580f42c5a84eda81880adcd7a0cbbe
7405d61b472e468886b08ee4a51201c86388887d1351a55c86dbb59137a9767c
0.675037
6.259759
4-8
f1ae725909d7a4e7d06d789bf9052dffda1e0b7aac4c6e782fb1325350d29b9e
#include <bits/stdc++.h> using namespace std; #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) #define reprev(i, n) reprrev(i, 0, n) typedef long long ll; typedef unsigned long long ull; template <class T> i...
#include <bits/stdc++.h> using namespace std; #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) #define reprev(i, n) reprrev(i, 0, n) typedef long long ll; typedef unsigned long long ull; template <class T> i...
87f6c0d52238ea1a1e2fdbe7f6e5d1c8c6b61198bcb9705beb7170b0462411ca
2bd865bcfd883b7b18ded1b983de578c0bbb2d72a83476588ab03a01ce16a276
0.105596
cpp
2bd865bcfd883b7b18ded1b983de578c0bbb2d72a83476588ab03a01ce16a276
872bf32630e90398de2463898c7ff05476043ffbfaee9ff9b8ab8740a5117816
PIE_released_gem5_runtime
pie_11146
p02328
7cdf246ef6e6b1785026c5d63a698dbe40c6b9b3a778b63d4506f0d62c34eedb
872bf32630e90398de2463898c7ff05476043ffbfaee9ff9b8ab8740a5117816
0.400079
3.788758
2-4
3da0dfb1d6e9f788a4055968c8d66ae86b5c6944b3d29bafbc9793f039b981b2
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1 << 17; const ll INF = (1e9) + 10; class RMQ { public: ll n, dat[2 * N - 1]; RMQ() { n = N; for (int i = 0; i < 2 * n - 1; i++) dat[i] = INF; } void update(int k, ll a) { k += n - 1; dat[k] = a; ...
#include <bits/stdc++.h> #define int long long #define N 200000 using namespace std; int n; struct dat { int h, i; }; int calc(int A[]) { stack<dat> S; int res = 0; for (int i = 0; i <= n; i++) { int h = A[i]; if (S.empty() || S.top().h < h) S.push((dat){h, i}); else if (S.top().h ...
b5c717a50a3200a22ef4297847b69bc9076e5fc4f30ccb19d7e8bdac8b85decd
b08a9c3cd7bdcbc6290c3cb45f98281d5b3b6c22063c84514c562eceeebfa37f
0.055447
cpp
b08a9c3cd7bdcbc6290c3cb45f98281d5b3b6c22063c84514c562eceeebfa37f
78ad2998d59e62275c1ab24a70fdc83b5194c9276e98b0875730c4e6162b3593
PIE_released_gem5_runtime
pie_11148
p01980
d27e54e2795f29cb2fd92c0dd26e1375b94549144ae2bda0835fff054a75ca16
78ad2998d59e62275c1ab24a70fdc83b5194c9276e98b0875730c4e6162b3593
0.169175
3.051099
2-4
1e30ece7b4368638e99ce86745e8e552422fa893a200a78092a9a4607d623182
#include <iostream> #include <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits>...
#include <bits/stdc++.h> using namespace std; #define int long long #define all(v) (v).begin(), (v).end() #define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__) #define reps(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) reps(i, 0, n) template <class T1, class T2> void chmin(T1 &a, T2 b)...
15db54d9dac4868fbc1fb0017dcc8fe4674b7be2a9054d2fbba463f11c04314e
65750488906e8dce6b425a5a2708438516c3178ecf66e9d1bc0308254c4f340d
0.105519
cpp
65750488906e8dce6b425a5a2708438516c3178ecf66e9d1bc0308254c4f340d
c9bb14ba03272e52bbc0591ec870bcfccce933da047fb0e740794c9d3e41d14b
PIE_released_gem5_runtime
pie_11359
p03330
76281808a2d90a37836c09831273dec1654b8a43ff81b845cd008276342f98a9
c9bb14ba03272e52bbc0591ec870bcfccce933da047fb0e740794c9d3e41d14b
0.330333
3.130553
2-4
8322b91e1d804cd1dd8a8566b52ad1bfe4682e14fbf0c7f248fdd26f74c63f49
#include <iostream> #include <algorithm> using namespace std; using int64 = int64_t; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define print(x) cout << (x) << '\n' int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, c; cin >> n >> c; int64 D[40][40] = {}; int64 C[51...
#include <iostream> #include <algorithm> using namespace std; inline void fastin(int &num) { int c; num = 0; c = getchar_unlocked(); for (; (c > 47 && c < 58); c = getchar_unlocked()) num = (num << 3) + (num << 1) + c - 48; } inline void fastout(int n) { int N = n, rev, count = 0; rev = N; ...
447e9248211fcd4085a7df5f57f24c9f8324960a4ffa89a7fbd9789cd31d7d45
1a00c16d648ab0bd4b1422fc6a1e49abec44fce7dee6168daa28ce4722809705
0.104926
cpp
1a00c16d648ab0bd4b1422fc6a1e49abec44fce7dee6168daa28ce4722809705
90078b49849536552f1006837c319e0b7e53ee991655247c5c3186c873286b94
PIE_released_gem5_runtime
pie_11368
p02607
987d72f1326f7b5a0c11c74fa7538036f65b03dc0f66d563ce5bd9c20f8e6828
90078b49849536552f1006837c319e0b7e53ee991655247c5c3186c873286b94
0.276003
2.630441
2-4
13b8a0ea67f1a26989b17bc33664e5814127bdc3000be4db330a7c4245cce2e0
#include <bits/stdc++.h> using namespace std; #define oo (long long)1e18 #define ll long long #define setdp memset(dp, -1, sizeof(dp)) const ll mod = 1e9 + 7; void _IOS() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin.sync_with_stdio(0); } #define PI 3.14159265359 int n, l, r, x; vector<int> b...
#include <iostream> using namespace std; int main() { int n, j = 1, c = 0; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] % 2 != 0 && j % 2 != 0) c = c + 1; j = j + 1; } cout << c << endl; return 0; }
8777cab31281f569aa6603544836662c10b9338878c93c743049304bb0221bfe
a7cf5602153cc57d258f0363bb0f5ea6dcc5d38b5eeaf54b3e0c9b91a0a27a11
0.009304
cpp
a7cf5602153cc57d258f0363bb0f5ea6dcc5d38b5eeaf54b3e0c9b91a0a27a11
3b89a72643d86901303962ba4f52ccb5a1507bb51746673e952b72dedcd6fd7b
PIE_released_gem5_runtime
pie_11394
p03842
4fef653961bb12940b3446b79c443a5d3ab512919c2eeb7f811d390b816e60c2
3b89a72643d86901303962ba4f52ccb5a1507bb51746673e952b72dedcd6fd7b
0.061467
6.606194
4-8
031dc0b5459e13523f08d645d5e5ef8ff88aca77273007793b61d6d252d8a578
#include <cstdio> #include <cstring> #include <cstdlib> using namespace std; int p1[110000], p2[110000]; int a[110000]; int lb[110000]; inline void jio() { puts("0"); exit(0); } bool lowb[110000]; long long ff[110000]; int ljrose[110000]; long long renleizhihui[110000]; int main() { int n; scanf("...
#include <cstdio> #include <cctype> #define RI register int #define g (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, size, stdin), p1 == p2) ? EOF : *p1++) using namespace std; typedef long long ll; const int mod = 1e9 + 7, N = 1e5 + 10, size = N << 2; char buf[size], *p1 = buf, *p2 = buf; void qr(int &x) { c...
eba3576bfc91ab3e37fba46f845fd716b5277d669f8992e4b01f10b68bbc5f5c
2bed5f5927fc75950c7e07b0abaf3231de37443974c72ca47c8119c6ab3593fa
0.001052
cpp
2bed5f5927fc75950c7e07b0abaf3231de37443974c72ca47c8119c6ab3593fa
b9a249ef5d43539fe8494a27d6d75763116717a6d6ac3e916e6c384f4af90cd5
PIE_released_gem5_runtime
pie_11427
p03277
4b0610cf1e4edbf95920f6aeedf98aafc58d2bdb5cc3fc836386f9f8df93c7cb
b9a249ef5d43539fe8494a27d6d75763116717a6d6ac3e916e6c384f4af90cd5
0.014014
13.32001
8+
8622e4a0f8c24949952accd4396d6a3b3deec9fdab8e12a181e56f99f34976e1
#include <bits/stdc++.h> #define fi first #define se second #define ll long long #define pb push_back #define mp make_pair #define mt make_tuple using namespace std; const int N = 1e5; int niz[N + 10]; int binNiz[N + 10]; int odnos[N + 10]; set<int> Set; vector<int> brojevi; ll n; int seg[15 * N + 10]; ...
#include <bits/stdc++.h> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> us...
239271fd7deb1d01fc934ec2a2d066aaf771859c2693190b3317449ae6d8704f
1a28f9087ce6125fbafcd02956609ee6b001b0ae1310e31d001e225a98bee2bc
0.066173
cpp
1a28f9087ce6125fbafcd02956609ee6b001b0ae1310e31d001e225a98bee2bc
a98e65c2cc39c8e49ca406cfd72e39a4d69471eb444eaeaeece9a2da36b0cb33
PIE_released_gem5_runtime
pie_11442
p01622
5ab4992d749839c1b86382e1b6b2800461f42bd67b8fdbc357079d03261cd5e2
a98e65c2cc39c8e49ca406cfd72e39a4d69471eb444eaeaeece9a2da36b0cb33
0.145414
2.197471
2-4
0fdadee8c4f748f7b0540cd816bea0e5f90a426c153cdd05022935742daaaf14
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <queue> #include <cctype> #include <climits> #include <stack> using namespace std; int main() { int n; in...
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <queue> #include <cctype> #include <climits> #include <stack> using namespace std; int main() { int n; in...
77c5b38d0a7e94e08fd7b36ec1e63ee5539ba0815364082ffedcb196a8093c45
d0ef48a9dd7a6d3065f64f6c5491c0b180cab411f39944d14ffd4d645e6f08c3
0.019229
cpp
d0ef48a9dd7a6d3065f64f6c5491c0b180cab411f39944d14ffd4d645e6f08c3
a49ca54bae6005ffd6e1605229ade254cfc03f6494b718bcf2575a5b60373b70
PIE_released_gem5_runtime
pie_11462
p03257
65602af61ac682d757900f0ec6c54b7089bc2d98715972316e5792b21f0c3c52
a49ca54bae6005ffd6e1605229ade254cfc03f6494b718bcf2575a5b60373b70
0.051969
2.702565
2-4
9c31b33177e0c7044368d80ed0af310056626e0b99815441ea32ba42225a7bd1
#include <bits/stdc++.h> using namespace std; int n, cnt = 2; long long res[507][507]; map<int, int> a, b; int nxt() { while (1) { bool ok = 1; for (int i = 2; i * i <= cnt && ok; i++) if (cnt % i == 0) ok = 0; if (ok) return cnt++; cnt++; } return 0; } long lo...
#include <cstdio> #include <algorithm> #define int long long using namespace std; int n, a[1100][1100]; int tot, p[110000]; bool vis[110000]; void init() { vis[1] = true; for (int i = 2; i <= 10000; i++) { if (!vis[i]) p[++tot] = i; if (tot == 1000) break; for (int j = 1; j <= tot...
6e0e2ba495a98b22239eb5fad606406ccd9950eb80b1d1569d44c57b3be5b2bf
d26dcc8b24dddb019c58d9eb3e88c5cbffba83dcef41fcbb599d064261f316dd
0.081582
cpp
d26dcc8b24dddb019c58d9eb3e88c5cbffba83dcef41fcbb599d064261f316dd
fb3c1fb0cee54ce3a137085083d8d840d6c5cb83285f329fdbccee5c8cea040c
PIE_released_gem5_runtime
pie_11473
p03031
5e65410d741d1996fcbe353c6acb6aeacf3551e1e1a06400d8c4de6cc63b5429
fb3c1fb0cee54ce3a137085083d8d840d6c5cb83285f329fdbccee5c8cea040c
0.288989
3.542324
2-4
19dd71cd9db63a2220edfddca0cb2197d72a970b65492a83ff11d1e93d86d37e
#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...
#include <bits/stdc++.h> #define f(i, n) for (int i = 0; i < (n); i++) #define inf (int)(3e18) #define int long long #define mod (int)(1000000007) #define intt long long #define P pair<int, int> using namespace std; int modpow(int x, int y, int m = mod) { int res = 1; while (y) { if (y % 2) { ...
79d2268b85c78c155b93393679ca7f1976550a45b1583c10391d5c5ccb89243d
57741927b63193dd2ef43e95bece568e195441a2064c13eadcb0a2d33c132011
0.072605
cpp
57741927b63193dd2ef43e95bece568e195441a2064c13eadcb0a2d33c132011
3038d624cc3f1725b4745160cc435912047fc9b727c8e69cfe13132c66c14c20
PIE_released_gem5_runtime
pie_11474
p03286
0bd3700a6ad67d85c2dca4e3db123df2ab746a51d80100bcf09965040512a6c3
3038d624cc3f1725b4745160cc435912047fc9b727c8e69cfe13132c66c14c20
0.253256
3.488116
2-4
3ee47a44465b5e1f5525dfbd389d60a8eae67a26ab749b04ee47ce3298eea2bd
#include <stdio.h> #include <sstream> #include <string.h> #include <vector> #include <map> #include <algorithm> #include <utility> #include <set> #include <cctype> #include <queue> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> #include <deque> #include <limits> #include <iomanip...
#include <stdio.h> #include <sstream> #include <string.h> #include <vector> #include <map> #include <algorithm> #include <utility> #include <set> #include <cctype> #include <queue> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> #include <deque> #include <limits> #include <iomanip...
cee9210fba3cd8d5103f0a8b03eef2a4e3fe7d4d55b7d09203797cb0038c2280
370691dc67835c538e21802f571381c363c04a496db8207f3dfa0d53aecae903
0.019348
cpp
370691dc67835c538e21802f571381c363c04a496db8207f3dfa0d53aecae903
05479d6c68941e42eb7a7c5ee15510cb926f7414774d1caf35b328fb81bcd61b
PIE_released_gem5_runtime
pie_11501
p03147
e2306bc7a85786a184fc53392ec5d0d825e4609ae1d0f374879f0381923cf7e8
05479d6c68941e42eb7a7c5ee15510cb926f7414774d1caf35b328fb81bcd61b
0.088848
4.592034
4-8
e0f2fb6b7c3c91ecb8a2b5362b85b36e22fca4826dd1b74728af52865ef3f31a
#include <cstdio> #include <vector> #include <algorithm> int main() { int N; scanf("%d", &N); char *map[101]; for (int i = 0; i < 101; i++) { map[i] = new char[N + 1]; map[i][0] = 0; } int tmp; for (int i = 1; i < N + 1; i++) { scanf("%d", &tmp); for (int j = 0; j < 101; j++) ...
#include <cstdio> #include <cstring> int main() { int N; scanf("%d", &N); char map[100][100 + 1]; memset(map, 0, sizeof(map)); int tmp; for (int i = 1; i < N + 1; i++) { scanf("%d", &tmp); for (int j = 0; j < 100; j++) { map[j][i] = (j < tmp) ? 1 : 0; } } int count = 0; ...
8af1e73fc92464604de159b143e92a83b1b6411c1b3ae484ca7476af33881a98
db36ac389e19ba6e72fc3e6a0da0474dabc0e189305d8627e39f7192949ba6f2
0.106602
cpp
db36ac389e19ba6e72fc3e6a0da0474dabc0e189305d8627e39f7192949ba6f2
d949aa518cd2ef6f0937a3f161e3ca3bc1ea06e038ba1ba0cc980fd2ca5d930a
PIE_released_gem5_runtime
pie_11589
p02678
580ec58d04c34aaa2cc4a320cbe0854f4e7f0500a0890f96f4b6f654d0289c7e
d949aa518cd2ef6f0937a3f161e3ca3bc1ea06e038ba1ba0cc980fd2ca5d930a
1.178499
11.055096
8+
2da10ddc206743ca958ea0ee2258b6c569ad8898d6ba526e03bf7aa6075558cd
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1e9; #define sz 300005 #define Fast \ ios_base::sync_with_stdio(false); \ cin.t...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n; int visited[200005], high[200005]; typedef struct ANode { long long adjvex; struct ANode *nextarc; } ArcNode; typedef struct Vnode { int count; ArcNode *firstarc; } VNode; typedef struct node { VNode adjlist[100005]; } Ad...
e5894ae56b56ac1bfdaa77342d3fdd4baa5157a012a691de5dbc8d0e017c4eb2
42aba6d1bd026837fb9f0af46d094595f8b83c534cbed0649338d8eb591b76e3
0.020104
cpp
42aba6d1bd026837fb9f0af46d094595f8b83c534cbed0649338d8eb591b76e3
787a7be6a9f4be732c74f38c2a5f3da095bbb14884fc7f72cba67bbcda3fa335
PIE_released_gem5_runtime
pie_11638
p03684
165df3ae9ad4ac9893f454b369461a0c10af082d155b77c1cb6a0adcefb33097
787a7be6a9f4be732c74f38c2a5f3da095bbb14884fc7f72cba67bbcda3fa335
0.375012
18.653808
8+
60289534e07c5747333de43ca928c4cba4718ce37552927ec4ef63b45c9685a6
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typede...
#include <stdio.h> #include <stdlib.h> #include <algorithm> const int N = 100010, M = N + N; int x[N], y[N], id[N], n; typedef struct ufset *UFset; struct ufset { int *parent; int *root; }; UFset UFinit(int size) { int e; UFset U = (UFset)malloc(sizeof *U); U->parent = (int *)malloc((size + 1) *...
18baba4fbfb4c76846cfde8f64e8f203657bf68a2ad9aa0f3e72736bc7c471dc
29e08bc06e1c44efbccbf7f2cb420e2030c4f5311f22fca38fb6b472b0eed876
0.019856
cpp
29e08bc06e1c44efbccbf7f2cb420e2030c4f5311f22fca38fb6b472b0eed876
5659ec34740aa665ebe04d6bb292e8de64889d9086d26d46b89c63bfb1c8d9dc
PIE_released_gem5_runtime
pie_11806
p02728
af1b94471e06bff5532e6101b158df333b97232b4938b0561e67c539b055ed24
5659ec34740aa665ebe04d6bb292e8de64889d9086d26d46b89c63bfb1c8d9dc
0.625223
31.487494
8+
377310889c332ee7fed3b84af057d3d14f2a7b4fb262956dd13f878ce0e7756f
#include <iostream> #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cstring> #include <complex> #include <deque> #include <functional> #include <initializer_list> #include <math.h> #include <map> #include <random> #include <set> #include <stack> #include <tuple> #inc...
#include <stdio.h> #include <utility> constexpr unsigned int MAX_INPUT_SIZE = 3'000'000; char Input[MAX_INPUT_SIZE]; char *input = Input; inline unsigned int get(void) { unsigned int res = 0; char c; while ((c = *(input++) - '0') >= 0) res = 10 * res + c; return res; } constexpr unsigned int MAX_OU...
17ff174c265cf330c3320dee3f95d22e178472c73a3c6dbae4218c6ded9ca94a
ab228e43742f4d1b68b9f5d6647a84297eba4aa536046d8140135bcbfaeaf881
0.043502
cpp
ab228e43742f4d1b68b9f5d6647a84297eba4aa536046d8140135bcbfaeaf881
60f733f2491efee3931b5c3953e7e977e66ba6b65c61d67343d248e35a6d084a
PIE_released_gem5_runtime
pie_11858
p00215
a3b09beb4d88ff20c105e5540dc58e68eb0ab5403e8ac235012e282be09c271d
60f733f2491efee3931b5c3953e7e977e66ba6b65c61d67343d248e35a6d084a
0.119784
2.753537
2-4
854e2bcc28da81410c1724704dffe449b5d9db96031605cc7d0078f2932cc737
#include <vector> #include <map> #include <algorithm> #include <cstring> #include <cstdio> #define INF 1 << 28 using namespace std; int sx, sy, gx, gy; typedef pair<int, int> P; vector<P> p[5]; int memo[5][5][1111]; int a, b; int solve(int k, int t, int q) { if (k == 4) return abs(p[t][q].first - gx)...
#include <algorithm> #include <cstring> #include <cstdio> #define INF 1 << 28 using namespace std; int sx, sy, gx, gy; int dx[5][1111], dy[5][1111], dn[5]; int memo[5][5][1111]; int a, b; int solve(int k, int t, int q) { if (k == 4) return abs(dx[t][q] - gx) + abs(dy[t][q] - gy); if (memo[k][t][q]) ...
06d4bac8c5900d4d488fcb6644300e03b4b774b878188b4eadfc6283070b7cc9
f3551a99f3a82f4060322f1989e05b4f0d5d727b51e317dcee60427fba4f695d
0.020055
cpp
f3551a99f3a82f4060322f1989e05b4f0d5d727b51e317dcee60427fba4f695d
68e171a1ecd6188b822777a650ed13b5507758f7699531e097bf107a8bba6227
PIE_released_gem5_runtime
pie_12024
p02777
1729b561b2a964e425e1d26e7622c3734d40f26c8234a80a90b4d2763a5c20fe
68e171a1ecd6188b822777a650ed13b5507758f7699531e097bf107a8bba6227
0.105497
5.260265
4-8
0108237aa7a7eb74d4f49a02628086fd08971ab92a12ec85264ca7de5db60122
#include <iostream> using namespace std; int main() { string s, t, u; int A, B; cin >> s >> t; cin >> A >> B; cin >> u; if (s == u) { A--; } else B--; cout << A << " " << B; return 0; }
#include <stdio.h> #include <string.h> int main() { int A, B; char S[11]; char T[11]; char U[11]; scanf("%s %s", &S, &T); scanf("%d %d", &A, &B); scanf("%s", &U); if (strcmp(S, U) == 0) { A--; printf("%d %d", A, B); } else if (strcmp(T, U) == 0) { B--; printf("%d %d", A...
86c7af143f1749d632b608358550df392f55b090fb8ea47371f6a40c2f492107
b13268f0bb2f1c374d786a1f53169261de2f32c0deca0b3225989d3ee5350787
0.020162
cpp
b13268f0bb2f1c374d786a1f53169261de2f32c0deca0b3225989d3ee5350787
be2040d0a0f4a290387e74ae9bc85dba32827034a6d1fdefcea7c87ecde282ea
PIE_released_gem5_runtime
pie_12224
p03221
9c9a1b3c093266ecbec6c9c84212fc03ad0b2b68c8f9ae0bb2a8057050117450
be2040d0a0f4a290387e74ae9bc85dba32827034a6d1fdefcea7c87ecde282ea
0.683466
33.897903
8+
320b2d4f758f659972261fdb9340bfec0743ba291a2f4627ca15e45a0ac077aa
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <vector> #include <queue> #include <stack> #include <cstdlib> #include <iomanip> #include <cmath> #include <cassert> #include <ctime> #include <cstdlib> #include <map> #include <set> using namespace std; #pragma comme...
#include <cstdio> #include <cmath> #include <algorithm> using namespace std; const int maxn = 1e5 + 5; typedef struct Node { int id, p, y, s; } Node; Node node[maxn] = {0}; bool cmp(Node &a, Node &b) { if (a.p == b.p) return a.y < b.y; return a.p < b.p; } bool cov(Node &a, Node &b) { return a.id <...
c9d1899eeee077dc5842e718ed548f0e803f1b82853610f5ca6c4ea0294a4f4c
394bca5dd8d97abfcced30ba8bb5b9e5630ca38aaaddec6510d7a872e5261022
0.000186
cpp
394bca5dd8d97abfcced30ba8bb5b9e5630ca38aaaddec6510d7a872e5261022
132560ef44709a479f92288fade9934d1469682c360919ae1dd99e034984eaec
PIE_released_gem5_runtime
pie_12263
p03731
d0cc07ad0dadd4537098223052b06b3206cd5f76528ae44ce2b49e760de6012b
132560ef44709a479f92288fade9934d1469682c360919ae1dd99e034984eaec
0.001048
5.632897
4-8
5a8d235ff783f0f34ae1a46f60f454f9ecdb37bb5776a9016bf6d149b39f9444
#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...
#pragma GCC optimize("O3") #pragma GCC target("avx") #include <cstdio> #include <algorithm> 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 ...
72d0dc9b055126bb6b95a4cb1fceb5f5b55108941688eafe4109b6899687c6c0
417c7fc2f5915fc848258ba47c92ecca4a55a97bf1f17d0b9338041b19e6b330
0.015434
cpp
417c7fc2f5915fc848258ba47c92ecca4a55a97bf1f17d0b9338041b19e6b330
b6812212bda411fed5a435434f3ab179efd73a7dcf68939942c015ef7c8854b6
PIE_released_gem5_runtime
pie_12266
p03143
5ef919e5155cd74dd3fb4610c9198b46f3fb3331b5ef173ba9c56ecce8105c6b
b6812212bda411fed5a435434f3ab179efd73a7dcf68939942c015ef7c8854b6
0.107119
6.940585
4-8
87ea39d025bca370493917d0e150641897ad5da274e12a05d31c89be5052d936
#include <stdio.h> #include <vector> #include <algorithm> #include <map> using namespace std; struct node { node *l = nullptr; node *r = nullptr; node *p = nullptr; long long val = 0; long long sum = 0; node() {} }; void fix(node *x) { x->sum = x->val; if (x->l) x->sum += x->l->sum; ...
#include <stdio.h> #include <vector> #include <algorithm> #include <map> using namespace std; struct union_find { int uf[100000]; long long sum[100000]; int id_[200000]; int uf_[200000]; long long sum_[200000]; int k; int find(int x) { while (uf[x] >= 0) x = uf[x]; return x; ...
1d3fade5fe5ceba2c306ee1cbf17fd343fb74f4e68205ac7db65f05d6ce118bd
33825d124c73e58ebb30e892fcdad4b9de2d23dec644f40bf087fb2f49a91606
0.022134
cpp
33825d124c73e58ebb30e892fcdad4b9de2d23dec644f40bf087fb2f49a91606
8939fe20001a184692358cd7134cfa2c8299c04ee6781e5d76fbf8741bc80732
PIE_released_gem5_runtime
pie_12274
p01159
a40e0e10dfbfc665028e6e7f1b19029684a4142220e28ab1276aa9e8ebd392ec
8939fe20001a184692358cd7134cfa2c8299c04ee6781e5d76fbf8741bc80732
0.102132
4.614265
4-8
8d24618caf357409654f253577e1b10372e59651141490dd1f8f91cbe433b90a
#include <cstdio> #include <vector> #include <complex> #include <algorithm> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef complex<double> Point; const double EPS = 1e-9; namespace std { bool operator<(const Point &a, const Point &b) { return abs(a.real() - b.real()) < EPS ? (a...
#include <cstdio> #include <algorithm> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; const double EPS = 1e-9; struct Point { double x, y; }; int n; Point _f[100], _g[100]; double f(double x) { if (x < _f[0].x) return 0; rep(i, n - 1) { double x1 = _f[i].x, x2 = _f[i + 1]....
4fbd8c267eddace97751fedd4b403bd14192708b34abf2fec5278136973a2d72
7a64d925443a662e55742078e36307e61cba60b7f325363b6e272ea67e7bf752
0.111524
cpp
7a64d925443a662e55742078e36307e61cba60b7f325363b6e272ea67e7bf752
e3e316deaaaf5d25bea0ebbc24257796299369b81ac12f8dc5d60fe0bca76246
PIE_released_gem5_runtime
pie_12283
p02549
dab18090588a70f47a577bc6f8e2a3a6ed8438e0f2db554fcdd78c695b2e77a5
e3e316deaaaf5d25bea0ebbc24257796299369b81ac12f8dc5d60fe0bca76246
0.814588
7.304152
4-8
17c926d768945da509dfbae9354556650f8f7e59486e347c8b0f49713555aa1d
#include <iostream> #include <vector> #include <deque> #include <algorithm> #include <numeric> #include <string> #include <cstring> #include <list> #include <unordered_set> #include <tuple> #include <cmath> #include <limits> #include <type_traits> #include <iomanip> #include <map> #include <unordered_map...
#include <iostream> #include <vector> #include <deque> #include <algorithm> #include <numeric> #include <string> #include <cstring> #include <list> #include <unordered_set> #include <tuple> #include <cmath> #include <limits> #include <type_traits> #include <iomanip> #include <map> #include <unordered_map...
b29ce1a232f0ca1962639f594e4df8a9f399e39ff07483defa54d48db8cf648a
9d5515731ea0bf45dc04c1bf1ed4444dffb412430f5835a5b3bffbfae8af88e0
0.008895
cpp
9d5515731ea0bf45dc04c1bf1ed4444dffb412430f5835a5b3bffbfae8af88e0
553e4fb16f8674b02781c37eae409f1b23febf51e151f97bcc5e1238f188ad5f
PIE_released_gem5_runtime
pie_12301
p03283
388bdb7178e0036cbca4ab1e2f764d71d35a23695febf7390764ec310a4789f2
553e4fb16f8674b02781c37eae409f1b23febf51e151f97bcc5e1238f188ad5f
0.237339
26.682625
8+
3792685de681d1cc871cf3165e51202431c3bd11b8749cd4748283289a738d2b
#include <bits/stdc++.h> using namespace std; int dp[1010][1010]; int main() { int n, m, q, i, x, y, j, k; scanf("%d%d%d", &n, &m, &q); memset(dp, 0, sizeof(dp)); for (i = 1; i <= m; i++) { scanf("%d%d", &x, &y); dp[x][y]++; } for (j = 1; j < n; j++) for (i = 1; i + j <= n; i++) ...
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int NN = 700; int x, y, ans, n, m, q, a[NN][NN], b[NN][NN], c[NN][NN]; int main() { scanf("%d%d%d", &n, &m, &q); for (int i = 1; i <= m; i++) { scanf("%d%d", &x, &y); a[x][y]++; } for (int i = 1; i <= n; i+...
f3f924cc2b5d9bd07e413313819933defd69ad827bdc27831b8ba2efac4f30b1
34837532483cef5eaad128889a3b73ec34f1b526f7c0df7c7508474382d6840c
0.013242
cpp
34837532483cef5eaad128889a3b73ec34f1b526f7c0df7c7508474382d6840c
b4bec7267fee1290e5947827bd39bc131c854e64df5e96be4eba81a11205cef2
PIE_released_gem5_runtime
pie_12533
p03656
24ed2b54e0df3d528dd5a029d1a30e04d51ddbadb71a6fd8c77b55c33d7aa03e
b4bec7267fee1290e5947827bd39bc131c854e64df5e96be4eba81a11205cef2
0.729795
55.113891
8+
65ac99f6599a81614f69a554cd6877df89469656e1a5e6c92f5cc58d08fd1e01
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typede...
#include <cstdio> #include <cstring> #define maxn 100005 int n, r1, r2, s1[maxn], s2[maxn], ans[maxn], st[maxn], tp; bool vis[maxn]; struct node { int v; node *nxt; } edge[maxn * 16], *head[3][maxn], *ncnt; void addedge(int u, int v, int d) { ncnt++; ncnt->v = v, ncnt->nxt = head[d][u]; head[d][u] =...
dafe019d94645af16cb3871a19180c77f0ca5daffea54de014673443328cb26b
c39f92089bbf86c9dc3d9886340519c696bc2f544cea038d5843924087ceaa9a
0.103185
cpp
c39f92089bbf86c9dc3d9886340519c696bc2f544cea038d5843924087ceaa9a
7a400349a3899ab06bc08ce55194858b8cc3e341ff3d3a98841f50b7dbbbd7b3
PIE_released_gem5_runtime
pie_12542
p00526
5a2b9f245cb036d50c7d3b6f1c2f67a2c0ffd6e52240ddd1be488737ac721def
7a400349a3899ab06bc08ce55194858b8cc3e341ff3d3a98841f50b7dbbbd7b3
0.22667
2.196736
2-4
a55523e6e101f89a1a78a927075cd20c3e01598427f761cf372c783a8327654a
#include <bits/stdc++.h> using namespace std; int n; int a[100010]; int dp[100010][3]; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i + 1]; } a[0] = a[1] ^ 1; a[n + 1] = a[n] ^ 1; for (int i = 1; i <= n; i++) { if (a[i - 1] ^ a[i]) { dp[i][0] = dp[i - 1][0] + 1; ...
#include <bits/stdc++.h> using namespace std; int n; vector<pair<int, int>> v(3, make_pair(-1, 0)); int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { int a; scanf("%d", &a), a ^= i & 1; if (v.empty() || v.back().first != a) { v.emplace_back(a, 1); } else v.back...
8b3909b8fa9f43ab49232dc7c191a36a40eab76b955474e52ac2b62882cef08c
4ef8982752c9b0dded52edf83e9e851fa02020c9c4b657fb4e96385b9d913842
0.001248
cpp
4ef8982752c9b0dded52edf83e9e851fa02020c9c4b657fb4e96385b9d913842
1635e3965821a7926470aea51d1f2354e481773ba2e36305ae8c0af9559c3184
PIE_released_gem5_runtime
pie_12545
p00283
95474f3351d176d5b3469af342ba7d4c45f4a928c83604762b173e670d772b80
1635e3965821a7926470aea51d1f2354e481773ba2e36305ae8c0af9559c3184
0.014423
11.555062
8+
9323097e17df508b9f1893055dfe624cbd8656182e979276cadd5d5ba67a49a6
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define REPR(i, n) for (int i = (int)(n) - 1; i >= 0; --i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define A...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define ALL(c) (c).begin(), (c).end() const int INF = 0x3f3f3f3f; t...
3f893bdc898ba19c082198017b5e83dc24e38bbd5f494aca55feaba1a14a1fa6
661b87534a5703d285d1c3276f8bf79aa3a50e9efbe08db7cdedb71c9a737f52
0.000189
cpp
661b87534a5703d285d1c3276f8bf79aa3a50e9efbe08db7cdedb71c9a737f52
f9b51a36ac70c6d2fd19bdcf3fb4022fb7d518109095afde990c52d20527fa55
PIE_released_gem5_runtime
pie_12570
p03645
76d970f6b3089dc94f6acdabdb28955912426abe0c2d4329ff5f35da3dae2c95
f9b51a36ac70c6d2fd19bdcf3fb4022fb7d518109095afde990c52d20527fa55
0.007492
39.533749
8+
1bbe2727c1378f0b1ff0c0457f795f6a221e2f3a1aa3e8105024ac9a2da3cbe9
#include <stdio.h> #include <vector> #include <queue> #include <string.h> using namespace std; int d[200005]; const int inf = 200005; vector<int> v[200005]; void bfs(void) { d[1] = 0; queue<int> q; q.push(1); while (!q.empty()) { int t = q.front(); q.pop(); for (int i = 0; i < v[t]...
#include <stdio.h> #include <string.h> bool from[200005]; bool to[200005]; int main() { int n, m; scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) { int a, b; scanf("%d%d", &a, &b); if (a == 1) from[b] = 1; if (b == n) to[a] = 1; } bool ans = 0; for (int i = 2;...
3c9b3c4edb796a62735c4ec28a941cd56ca50542e3347a0dbb3fa0a1c767cdf9
f0cab77c12eeaa66374fef6dcb9b8c84ed1504f646763f520b275389b83b1339
0.10483
cpp
f0cab77c12eeaa66374fef6dcb9b8c84ed1504f646763f520b275389b83b1339
17164f130155b02022ce0872d7c9a7bc5db89a69fc5f303fc07d7f1ef12b9533
PIE_released_gem5_runtime
pie_12715
p03380
a23919aa080eb4c4f1ea67c54bfb07cfccfa028d792d989f389aa3c68a90ab0b
17164f130155b02022ce0872d7c9a7bc5db89a69fc5f303fc07d7f1ef12b9533
0.68147
6.500737
4-8
b85bb7186138f92dc20db2b39a50b6e98ca708dba626fab6d37a8bb7081d6e47
#include <stdio.h> #include <iostream> #include <algorithm> #include <string> #include <queue> #include <vector> #include <utility> #include <math.h> #include <set> #include <map> #include <string.h> #include <stack> #define n 200000 #define loop(i, a, b) for (int i = a; i <= b; i++) using namespace std; ...
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; int arr[a + 50], n = 0, m = 0, now = 999999999; for (int i = 0; i < a; i++) { cin >> arr[i]; n = max(n, arr[i]); } for (int i = 0; i < a; i++) { if (arr[i] == n) continue; int tmp = abs(arr[i] ...
079f2d1380bea53b5730bd3ebe74b79a57471cdf9015761712be8c6b8901ff63
be03826539ab3400773dd11f1ef271be8409aa81af09d561838c84286ee47a96
0.000228
cpp
be03826539ab3400773dd11f1ef271be8409aa81af09d561838c84286ee47a96
1e8bba5edec2e7f8d18185171d149f176ae628707981cf9cf267c60e5f0b3ee1
PIE_released_gem5_runtime
pie_12718
p00523
eba063c839876ae06aac1a98611f488c54d359bbe140c6eb769878fb19b13758
1e8bba5edec2e7f8d18185171d149f176ae628707981cf9cf267c60e5f0b3ee1
0.009542
41.844215
8+
52ba60360c4fcdba7bb39a56c654e481217ebd3dccc990d39ecb4c9c429586d7
#include <cstdio> #include <algorithm> #include <vector> using namespace std; typedef long long lint; int main() { int n; static int a[100000]; static int s[200000], t[200000], next[2][200000]; static pair<int, int> p[400000]; static vector<int> bucket[300000]; lint sum = 0; scanf("%d", &n); ...
#include <cstdio> #include <algorithm> #include <vector> using namespace std; typedef long long lint; int main() { int n; int a[100000]; int t[300000]; lint sum = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", a + i); sum += a[i]; } lint left = 0, right = sum / 3; ...
e2d6e1427361cfa21546810c9b7f1891b184ab26a33c7c11406050e82bc0dfbb
71d63d53aae1142a33f7f30e2b8df3a63d82d272e2829af7c199b672f5277990
0.013487
cpp
71d63d53aae1142a33f7f30e2b8df3a63d82d272e2829af7c199b672f5277990
a912548e661e5d48ce97c0a5c57ab2cf2e42a9df1500bc1d6b23c730bec1216d
PIE_released_gem5_runtime
pie_1273
p03703
2b0815541de7e8a0c9b642aa0e0c8d99b817dce38fa3f646f4ccc8e0746e3eee
a912548e661e5d48ce97c0a5c57ab2cf2e42a9df1500bc1d6b23c730bec1216d
0.421488
31.251208
8+
11edb975a1df8cbbe995e56968376c450453a55bdf5cb768a6d38bcaaf81f683
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #define N 200040 using namespace std; int n, k; long long ans = 0, aux[N], sum[N]; long long tree[N]; int lowbit(int x) { return x & -x; } long long getsum(int x) { long long ans = 0; for (int i = x; i; i -= lowbit(i)) ...
#include <cstdio> #include <algorithm> int n, k; long long ans; long long c[200010], val[200010], sum[200010]; inline void add(long long x, long long y) { for (; x <= n; x += x & -x) c[x] += y; } inline long long ask(long long x) { long long ans = 0; for (; x; x -= x & -x) ans += c[x]; return ...
ac6fd49f30dde6fd1e7f8ddd624e36c14cf4db0b68088b2a0d56718f3042652e
973a375f4b93cac82b737b555381ad81ace086630bc2c4ecec3b9a6add3fbce5
0.104837
cpp
973a375f4b93cac82b737b555381ad81ace086630bc2c4ecec3b9a6add3fbce5
30eb8588fe1a268e3f47ee960b3b91bd9e0c293945f0fb92a6f8cf2cba99d0fc
PIE_released_gem5_runtime
pie_12752
p03948
410c6adeb5e56e8508d3422699f90e0d39bc67bce6f8bc30b4df2570b0da16d4
30eb8588fe1a268e3f47ee960b3b91bd9e0c293945f0fb92a6f8cf2cba99d0fc
0.385012
3.672482
2-4
5608b9bb5064422e30bd1c966ebed2f9a82a8ab54fea5faf568e02ea698e2811
#include <bits/stdc++.h> using namespace std; #define maxn 100010 #define inf 0x3f3f3f3f int v[maxn]; int pre[maxn]; vector<int> g[maxn]; int ty[maxn]; bool used[maxn]; int a, b; void dfs(int u) { a++; b += ty[u]; used[u] = true; for (int i = 0; i < g[u].size(); i++) { int to = g[u][i]; i...
#include <bits/stdc++.h> using namespace std; #define maxn 100010 int q[maxn], top = 0; int Max = 0, cnt = 0; int n, a[maxn]; int main() { int t, T; t = 1; while (t--) { scanf("%d %d", &n, &T); for (int i = 0; i < n; i++) scanf("%d", &a[i]); q[0] = a[0], top = 0; Max = -1; ...
82ea6469bc4bce7647b1cbc0eaef4915cd5adc0b9cae12d90d0d571a6dd206b8
a281e6f1814ef4d9dcdf6e28943dc9561bc48a21f463f4ba7f9037de1f763491
0.055786
cpp
a281e6f1814ef4d9dcdf6e28943dc9561bc48a21f463f4ba7f9037de1f763491
601715fa1a6f325aca8e315fc60da52c67394b27ce4b30d9eb772d969488a933
PIE_released_gem5_runtime
pie_12754
p02982
6c82c7a378f82bfb4ec0fba9f6cca92c75ba583668c1cc99fe3ae9b359eca4e4
601715fa1a6f325aca8e315fc60da52c67394b27ce4b30d9eb772d969488a933
0.155184
2.781741
2-4
1cffc6474ff7fc1559b6e9d41d54a57d70ce221a694cdbcb68198a762b3cbc00
#include <bits/stdc++.h> using namespace std; #define lli long long int #define REP(i, s, l) for (lli i = s; i < l; i++) #define DEBUG 0 #define INF (1LL << 50) #define MOD 1000000007 vector<vector<lli>> v; lli n, d; lli distance(lli a, lli b) { lli sum = 0; REP(i, 0, d) { lli d = v[a].at(i) - v[b]....
#include <bits/stdc++.h> using namespace std; #define lli long long int #define REP(i, s, n) for (int i = s; i < n; i++) #define NUM 2520 #define INF (1LL << 50) #define DEBUG 0 #define mp(a, b) make_pair(a, b) #define SORT(V) sort(V.begin(), V.end()) #define PI (3.141592653589794) #define TO_STRING(VariableN...
c43dbc3587bb2c4a10768457f8204c341caf10a6ef273aa8f807d8a306736ca8
952398ba928324aadf4029a18402fef172611800e1eb59a714db8c455e57deda
0.055313
cpp
952398ba928324aadf4029a18402fef172611800e1eb59a714db8c455e57deda
aa55f912a54dc86710a5d2a9b4fc3f6b6c1c41a9c9e7a58c280f54dfa6a0e132
PIE_released_gem5_runtime
pie_12758
p02724
f649cee9a04432b9dd4f2119d221e9654bb175c4b8c03f58c576a15eab0da048
aa55f912a54dc86710a5d2a9b4fc3f6b6c1c41a9c9e7a58c280f54dfa6a0e132
0.545304
9.858477
8+
0475703cc7c1198d9cab59ffc6a43d4da3d2f14e852fcda7031da4616efd9862
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <set> #include <queue> #include <stack> #include <bitset> #include <functional> #include <map> #include <iomanip> #include <limits> #include <unordered_set> #include <cmath> #include <numeric> #include <array> #include...
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <set> #include <queue> #include <stack> #include <bitset> #include <functional> #include <map> #include <iomanip> #include <limits> #include <unordered_set> #include <cmath> #include <numeric> #include <array> #include...
fa773e83067e8dbce750f72294a1ae681f9c928fe36a448da848f50055529fff
2e984cd849dc001ef9344039ffb54ad5f3461b6bd3acefc98e7fa03495df14d3
0.093277
cpp
2e984cd849dc001ef9344039ffb54ad5f3461b6bd3acefc98e7fa03495df14d3
d483adea002838879bb1a25693b6265f89551b737c7b88129663d6ccf6c26b53
PIE_released_gem5_runtime
pie_12769
p03333
28959ce799036fb183f43d36f329ea99992a77e811b430c8687b714791d58117
d483adea002838879bb1a25693b6265f89551b737c7b88129663d6ccf6c26b53
0.215001
2.30496
2-4
2859cdc2ebc2b3b19e3a912ecf8ab024b5bc9d3093c786742e85fcbf0b8bc9f4
#include <algorithm> #include <cstdio> #include <cstring> const int Maxv = 100010; int l[Maxv << 1], r[Maxv << 1], n; long long ans; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') { f = -1; } ch = getchar(); } while (ch >...
#include <bits/stdc++.h> #define up(l, r, i) for (int i = l; i <= r; i++) #define dn(l, r, i) for (int i = l; i >= r; i--) using namespace std; typedef long long LL; const int INF = 2147483647; int qread() { int w = 1, c, ret; while ((c = getchar()) > '9' || c < '0') w = (c == '-' ? -1 : 1); ret = c ...
fee2291484ee24d43fa1c9617f48276a218a677f5459aced907f685268ce7f99
1ef01d2d70f180ab8cf36b1e0a3eaa4b2281ed94651bbdcb2c9ee9404aed8893
0.10703
cpp
1ef01d2d70f180ab8cf36b1e0a3eaa4b2281ed94651bbdcb2c9ee9404aed8893
2e7706bacc329459222c8e15ea44c17d15bc86183b786af4ea628693ba0382bb
PIE_released_gem5_runtime
pie_12957
p04043
dbb24647bde68762ec490b5c1b13cfccab654a0fef00ffd7ba88bed00180f217
2e7706bacc329459222c8e15ea44c17d15bc86183b786af4ea628693ba0382bb
0.3704
3.4607
2-4
1baec7d811f1e4d3d7eb94fd1f76bae7113dde231d789811b0df240951f1d16f
#include <bits/stdc++.h> #define lln long long int #define llu unsigned lln #define sc(n) scanf("%d", &n); #define scl(n) scanf("%lld", &n); #define scd(n) scanf("%lf", &n); #define pf(res) printf("%d\n", res); #define pfl(res) printf("%lld\n", res); #define pfd(res) printf("%lf\n", res); #define maxii 100005 ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; #define ff first #define ss second #define mp make_pair #define pb push_back #define all(x) (x).begin(), (x).end() #define FastIO ...
132304f9d60457cb95de288200ace2e0c6bbab8501fae8cdce8cff66f9b71156
b2a50d8e726016898955255c4b689d8e8627238e5cdc2f988a0a6d4600d25c57
0.055408
cpp
b2a50d8e726016898955255c4b689d8e8627238e5cdc2f988a0a6d4600d25c57
40a7de315d7d28479d5952e440640e3f24f39977e768dfa49f9dd53cd9a2bb50
PIE_released_gem5_runtime
pie_13033
p03111
7e541296424782c14ca86054afacf7b5744ed184bc88b2d167545a54ae6a92da
40a7de315d7d28479d5952e440640e3f24f39977e768dfa49f9dd53cd9a2bb50
0.114351
2.063798
2-4
85a262ea98ead1ab85da6f6c8420381ca2c2beaf8a036f788525aec013d61c10
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <sstream> #include <map> #include <set> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #include <typeinfo> #include <numeric> #include <functional> #include <unordered_map> #include <bitset> #in...
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <sstream> #include <map> #include <set> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #include <typeinfo> #include <numeric> #include <functional> #include <unordered_map> #include <bitset> #in...
4ed7c7cdcb29b3194751ad5f4cc10aeb36f8c565035fa01a9ea5f2066c2ccfb4
a8dd7ee64de52d76fd3369ef516970f4a7ec272d8ec11eb6558f87ebf077398a
0.106712
cpp
a8dd7ee64de52d76fd3369ef516970f4a7ec272d8ec11eb6558f87ebf077398a
94ba79969b24be69d3e124165d7c80287a84c6b1b1a590e0b75e0fc6578f395c
PIE_released_gem5_runtime
pie_13079
p03435
99757d65f15a2963c6bbac8d0d93c2c221dc234a5065601874a88866fe098956
94ba79969b24be69d3e124165d7c80287a84c6b1b1a590e0b75e0fc6578f395c
0.217994
2.042829
2-4
90955040b7cbe4bf651b21a3191ab48e459cb2a7227e6379dd548c203b7d0935
#include <iostream> using namespace std; int main() { int c[4][4]; for (int i = 1; i <= 3; i++) for (int j = 1; j <= 3; j++) cin >> c[i][j]; int a1, a2, a3; int correct = 0; for (a1 = 0; a1 <= 100; a1++) { for (a2 = 0; a2 <= 100; a2++) { for (a3 = 0; a3 <= 100; a3++) { in...
#include <iostream> using namespace std; int main() { int c[4][4]; for (int i = 1; i <= 3; i++) for (int j = 1; j <= 3; j++) cin >> c[i][j]; int a[4] = {0, 1}, b[4]; for (int i = 1; i <= 3; i++) b[i] = c[1][i] - a[1]; for (int i = 2; i <= 3; i++) a[i] = c[i][1] - b[1]; int f = 1; ...
e1e44fb9ee0d78bc4f09f659cdaa8f205f4ede658bfa344668809315460417e8
87a11e18e55449d4955a9666800114d6b3f7668811cc9fbd81439ae8e1e4353d
0.044836
cpp
87a11e18e55449d4955a9666800114d6b3f7668811cc9fbd81439ae8e1e4353d
0339da7357bee893ea2adc3ccf3cef9bcd932ab9b97e03b1bab9d6a86f46ee95
PIE_released_gem5_runtime
pie_13235
p00899
68d9384e679a161d49b127144a9f2c19e6b04d3c7a5e94708a9f6c098730b34d
0339da7357bee893ea2adc3ccf3cef9bcd932ab9b97e03b1bab9d6a86f46ee95
0.110822
2.471698
2-4
2922ba22a13aadb0df7c6a88297b9ef8e24cb0585cdbff418333ebf181380659
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <map> using namespace std; const int N = 14; const int INF = 1e9; string str[20], s[20]; int dp[20][1 << 15], ok[20][20]; int n; int check(int x, int y) { int i, j, r = 0, l1 = s[x].size(), l2 = s[y].size(); for (i ...
#include <cstdio> #include <iostream> #include <cstring> #include <cmath> #include <queue> #include <vector> #include <map> #include <cstdlib> #include <string> #include <algorithm> #define mod 998244353; using namespace std; char c[25][25], s[25][25]; int n, d[25][25]; bool issub(int x) { for (int i ...
8b8958d4ba68fe25b074d475be5ca1a3ddffd257bb7a0e66f6f5b2fabebe4082
6ef4cea30df42523fdb0391c05f4e0642a2c78a8f9ea166d461627bd9b9174b6
0.019653
cpp
6ef4cea30df42523fdb0391c05f4e0642a2c78a8f9ea166d461627bd9b9174b6
b240b52f0f68daa722604ee02bd50ad092052fda2f282eb9d091ff555e68cbf0
PIE_released_gem5_runtime
pie_13328
p03965
c36bb20ad453af18ce3b5cb915758c128a8280bbc7910bd5b5936eb5c197ef36
b240b52f0f68daa722604ee02bd50ad092052fda2f282eb9d091ff555e68cbf0
0.405557
20.635755
8+
11bfee49746fd0a268f3a836477b78784d0ae9c01ca877d991171de73742b085
#include <bits/stdc++.h> using namespace std; char a[1000010]; int main() { cin >> a; int x = 0, y = 0; int ans = 0; for (int i = 0; i < sizeof(a); i++) { if (x == y) { x++; if (a[i] == 'p') ans--; } else { y++; if (a[i] == 'g') { ans++; } ...
#include <cstdio> #define sacnf scanf #define pritnf printf #define srnad srand #define rnad rand #define sl(sl_a) strlen(sl_a) #define gt(gt_a) goto gt_a #define mst(mst_a, mst_b) memset(mst_a, mst_b, sizeof(mst_a)) #define fora(fora_x, fora_a, fora_b) ...
9fa060536e3eb513059ebeff58d1e9d8e5817abaecee8c43cebbbe9df510a557
015bb4f64eb254ebd707456cc8104b211a7ff577b28cf4404d196c2e566fb787
0.01447
cpp
015bb4f64eb254ebd707456cc8104b211a7ff577b28cf4404d196c2e566fb787
f728cbb137086f045c4f5c9f4892b320a4e036fa5a963e0c58dae5d575d4f8dc
PIE_released_gem5_runtime
pie_13489
p03568
0d72e0356c5c2795b1dfff4f6e2c1f139d8b81dab7256b08a97675660fafd80e
f728cbb137086f045c4f5c9f4892b320a4e036fa5a963e0c58dae5d575d4f8dc
0.070314
4.859385
4-8
04652da8394c1c4d3685ac567587e4d6ae7e3833ae1fb18aec97790a935cbea5
#include <iostream> #include <string> #include <cmath> using namespace std; int n, a[100]; int main() { cin >> n; int odd = 0, even = 0; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] % 2 == 0) even++; else odd++; } int ans = pow(3, n); ans -= pow(2, even); cout ...
#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { int n, m; int ans; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &m); if (m % 2 == 0) { ans++; } } printf("%d", int(pow(3, n) - pow(2, ans))); return 0; }
5e88cdf028f1804b5f2f34aa46be227ea54c99e65cb1d2700e6e240146098dd2
14c976e624bdcc2737a48e358f8a16d3bfc784c8b86da8847896a0fca5f7c7dc
0.029337
cpp
14c976e624bdcc2737a48e358f8a16d3bfc784c8b86da8847896a0fca5f7c7dc
1a9c494459b6faa094dab50e4c95ac477d43c2614ff85ff87d90d475a08c6d73
PIE_released_gem5_runtime
pie_13565
p03861
b2091ef572f2521c4924b264db9db2c1182ec35033e76f2318a20b1845ed22f9
1a9c494459b6faa094dab50e4c95ac477d43c2614ff85ff87d90d475a08c6d73
0.191633
6.53202
4-8
f13e8660a24eb7792e66db5fd33ee91bdffeb29b80282fde677634119914320e
#include <bits/stdc++.h> #define lln long long int #define llu unsigned lln #define sc(n) scanf("%d", &n); #define scl(n) scanf("%lld", &n); #define scd(n) scanf("%lf", &n); #define pf(res) printf("%d\n", res); #define pfl(res) printf("%lld\n", res); #define pfd(res) printf("%lf\n", res); #define maxii 20000...
#include <bits/stdc++.h> using namespace std; main() { unsigned long long int a, b, x, result; cin >> a >> b >> x; if (a % x != 0) { result = (b / x - a / x); } else { result = (b / x - a / x) + 1; } cout << result; }
0fb77c1805dcc304e42804467f39c4d1d6cf333a7e1e69c6fa625267526716fb
c0e72befa79305d6330f14956f0a28285d24011fa896215a89c183ce237de35b
0.020123
cpp
c0e72befa79305d6330f14956f0a28285d24011fa896215a89c183ce237de35b
3fadd7de55a8e1d42b95c6492823259c80c01f67e5ab0f3502659a6ecf0631f4
PIE_released_gem5_runtime
pie_13867
p03637
7fdebae06bc52366b32e463ec4b938b8a4eb0f5309bcaf65e09f2cab8c733597
3fadd7de55a8e1d42b95c6492823259c80c01f67e5ab0f3502659a6ecf0631f4
0.151215
7.514574
4-8
1d5fcca073e56822a1ae1cfae9ca70c64a4551d57f85874918ada4a352693751
#include <iostream> using namespace std; int main() { int N; int num[100000] = {0}; cin >> N; int jishu = 0, oushu = 0, numfour = 0; for (int i = 0; i < N; i++) { cin >> num[i]; if (num[i] % 4 == 0) { numfour++; } else if (num[i] % 2 == 0) { oushu++; } else { ji...
#include <stdio.h> const int maxn = 100005; int main() { int a = 0, b = 0, c = 0, n, x; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &x); if (x % 4 == 0) { c++; } else if (x % 2 == 0) { b++; } else { a++; } } if (b == 0) { if (a - 1 > c) { ...
8d00313c20efe4fd048637aa9972e1324fb12e912a7c9dea5407fe049fd3e683
80292233f11ca68390e39b007dc7706968f680c74feb7c9cbc75e33c77f7dd97
0.000192
cpp
80292233f11ca68390e39b007dc7706968f680c74feb7c9cbc75e33c77f7dd97
be432cbe4adfe65f54a838d111337190ddb6914c7cb8cef9a0ce4f2f6fa6daa7
PIE_released_gem5_runtime
pie_13903
p03246
7e951ca54315f3b83f333c979cde8e7267b88a8dfed3485a10db7747dd079df4
be432cbe4adfe65f54a838d111337190ddb6914c7cb8cef9a0ce4f2f6fa6daa7
0.002138
11.159447
8+
052739b484500b71d0845a039db53967e3d5aa9dd6b14e36c7f5a521ae5023ca
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v[i]; vector<int> cnt(110000, 0); for (int i = 0; i < n; i += 2) { cnt[v[i]]++; } int i1 = max_eleme...
#include <cstdio> #define maxn 100010 int cnt[2][maxn], M[2], Q[2], m[2], q[2]; int n; int main() { scanf("%d", &n); for (int i = 1, x, p; i <= n; i++) { scanf("%d", &x); p = i % 2; cnt[p][x]++; if (M[p] < cnt[p][x]) M[p] = cnt[p][x], Q[p] = x; } if (Q[0] != Q[1]) { printf("...
9da13a76107969a76de881f365b99a509cd6a74659f3de75989037f2d1c23ba7
842654c789c91e2a389b2a131cd009e2708082ca39c7df7bb51535a923d14e7b
0.026866
cpp
842654c789c91e2a389b2a131cd009e2708082ca39c7df7bb51535a923d14e7b
7423951117dc1a32d1797d562ada248154a567cfdccd73c54803797c42480058
PIE_released_gem5_runtime
pie_13988
p02844
213442857fa2e3ab42c9bf4f834172410be776732870b742d02fdf2f7edd483d
7423951117dc1a32d1797d562ada248154a567cfdccd73c54803797c42480058
0.114186
4.250293
4-8
ae29136b7c89e262dae507e4cf1ae79d05243c60307df930384359744932ae21
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <math.h> #include <complex> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <bitset> #include <functional> #include <assert.h> #include <numeric> using names...
#include <stdio.h> int main() { int n; char str[50010]; int x = 0; int ctr = 0; scanf("%d", &n); scanf("%s", str); for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { for (int k = 0; k < 10; k++) { char test[] = {i, j, k}; x = 0; for (int a = 0; a <...
f60324083b3000dbebbfaece221766bde8805f6995591426d5ae8f8bdbaeab81
56a425b603142509cc153edd1f281182e452baa45e899a60ecf6e5fad97022a4
0.058724
cpp
56a425b603142509cc153edd1f281182e452baa45e899a60ecf6e5fad97022a4
ed40cc46ac3e02de55d05c39bca92df0fa29b854a71c2c5319615d3df0f4cfe0
PIE_released_gem5_runtime
pie_14013
p02768
c227dabec9919c890f413006aefda8612de79565decbb2e768c96c78ff6a7c21
ed40cc46ac3e02de55d05c39bca92df0fa29b854a71c2c5319615d3df0f4cfe0
0.165236
2.813762
2-4
6d6e64ca747cb0a1588c8bbe5badda7d35ab90a4938822edfc5b1421b866895b
#include <bits/stdc++.h> using namespace std; const int maxx = 2e5 + 7; const int Mod = 1e9 + 7; typedef long long ll; ll n; int a, b; ll fac[maxx], inv[maxx]; ll qwe(ll x, int y) { ll res = 1ll; while (y) { if (y & 1) res = res * x % Mod; x = x * x % Mod; y >>= 1; } return res; ...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const LL Mod = 1e9 + 7; LL n, a, b, ans; LL qwe(LL a, LL n) { LL res = 1LL; while (n) { if (n & 1) res = res * a % Mod; a = a * a % Mod; n >>= 1LL; } return res % Mod; } LL C(LL n, LL m) { if (m < n - m) m =...
5160a013c6dcba5b26fd594253feadc21085f63655665b14c36ed765a84ca27d
1e87d8d2af6e67e3c7554eb963c0a97c4e5b7938c89c89c6e01f71fbbf8e9f45
0.009855
cpp
1e87d8d2af6e67e3c7554eb963c0a97c4e5b7938c89c89c6e01f71fbbf8e9f45
757a8318d9061049bd8d8c35fe0f150307ae31c7fef1f91b7f8cd95a83b64743
PIE_released_gem5_runtime
pie_14021
p03334
2be6ec508a1638b68e5eb511031eb7b60bcfed484e8ee900abbc8002501bd9e1
757a8318d9061049bd8d8c35fe0f150307ae31c7fef1f91b7f8cd95a83b64743
0.126256
12.81137
8+
2fd51b49ac025f511db2baecf305f6d86397dbbe2d22e95ef89c29dbf43d340f
#include <bits/stdc++.h> using namespace std; int n, d1, d2; int col[603][603], col1[605][605], col2[605][605]; int dx[4803], dy[4803], cnt; vector<pair<int, int> > typ[2][2]; void Col(int x, int y, int tar) { col[x][y] = tar; for (int i = 1; i <= cnt; ++i) { int nx = x + dx[i], ny = y + dy[i]; ...
#include <cstdio> int n, m, d1, d2, cnt, vis[605][605]; void solve(int d) { int tim = 0; while (d % 4 == 0) d /= 4, ++tim; if (d & 1) { for (int i = 0; i < m; ++i) for (int j = 0; j < m; ++j) { if (((i >> tim) + (j >> tim)) & 1) vis[i][j] = 1; } } else { for ...
a3b038eeed380ebcbaea18c1c7fed153b1dbccc19fbc2301b08eadd98eaedcf7
653030cf7bb644ba86f0356b10393f8f8d2a0df8364b4b05ca15e1a843d4e1d9
0.010553
cpp
653030cf7bb644ba86f0356b10393f8f8d2a0df8364b4b05ca15e1a843d4e1d9
c7180f6301bf30f01915f763e3cea9980f51e6845a966abdbe2c9c995d467213
PIE_released_gem5_runtime
pie_14024
p02249
e84a022eb1f954728e17fde764a2536529113b8c07e00acfbd27157173be7615
c7180f6301bf30f01915f763e3cea9980f51e6845a966abdbe2c9c995d467213
0.058988
5.589652
4-8
e3bf39460d68e99f49a4c76bb7b919846febbff28506a7a868ce099a8c03eff8
#include <string> #include <iostream> #pragma warning(disable : 4996) using namespace std; int H, W, R, C; string s[1000], t[1000]; unsigned long long power[1001], h1[1000][1000], h2[1000]; int main() { scanf("%d%d", &H, &W); for (int i = 0; i < H; i++) cin >> s[i]; scanf("%d%d", &R, &C); for (int ...
#include <stdio.h> int H, W, R, C; char s[1001][1007], t[1001][1007]; unsigned long long pw1, pw2, h1[1001][1007], h2[1001][1007], h3[1001]; int main() { scanf("%d%d", &H, &W); for (int i = 0; i < H; i++) scanf("%s", s[i]); scanf("%d%d", &R, &C); pw1 = 1, pw2 = 1; for (int i = 0; i < R; i++) sc...
0d37e3790747ccfb1033e2d249f4a5be4c82a392deae3deb03e5a50fc02b4ab2
8340917856feb1c50c980e2f7e84d56a7aae015feb01dd150c7e20077342eebf
0.000191
cpp
8340917856feb1c50c980e2f7e84d56a7aae015feb01dd150c7e20077342eebf
7ebfd57deb06b4a3e8ffc2c9173f2edf759a94b284e271f539cbe106c06d6e07
PIE_released_gem5_runtime
pie_14142
p03487
9b29372b6e159663bd8f1b8a536fec418b3762a8082bc7585f27725a4ac93b1f
7ebfd57deb06b4a3e8ffc2c9173f2edf759a94b284e271f539cbe106c06d6e07
0.001488
7.781786
4-8
427ecadbd49f7d72ba630faebb6d227abebc3ee7a98145642f34ea7b1de22cdb
#include <iostream> using namespace std; int n, a[100010], b, ans; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> b; if (b > 100000) ans++; else a[b]++; } for (int i = 0; i < 100001; i++) { if (a[i] >= i) ans += a[i] - i; else ans += a...
#include <cstdio> #define tin int #define itn int #define tni int #define nit int #define nti int #define pritnf printf #define scnaf scanf #define retrun return #define sizoef sizeof #define ll long long #define inl inline #define br break #define con continue #define mst(a, b) memset(a, b, sizeof(a)) #...
2819cdaf86fb830473d901f6354fa338d9b40ed2fb373431468275105e8d82fa
7e0143370b0959392c8076d99c5eed93b05c3297d683959f64772798833b2992
0.060468
cpp
7e0143370b0959392c8076d99c5eed93b05c3297d683959f64772798833b2992
66a1c741e7798b81c1564c34cea0a66d6a4c50b0154933b730243e67b842b288
PIE_released_gem5_runtime
pie_14239
p03893
81a90e24fd8dafbf8989d2ed7cc867e690c55a6f73f634f99f5fd142f4dc9a20
66a1c741e7798b81c1564c34cea0a66d6a4c50b0154933b730243e67b842b288
0.188834
3.122879
2-4
0b5de3e8fd9242cca9ecfd788246dae893f07da356e248f0890c34607350ff42
#include <bits/stdc++.h> #define pb push_back using namespace std; void debug_out() { cerr << '\n'; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...); } #define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__) #define dbg_v(x, n) ...
#include <bits/stdc++.h> #define ll long long using namespace std; map<ll, ll> nb; ll f(ll x) { if (x <= 2) return 0; if (nb[x] != 0) { return nb[x]; } int aux; if (x % 2 == 1) { aux = f((x - 1) / 2); } else { aux = f((x - 2) / 2); } nb[x] = 1 + aux; return nb[x]; } v...
3c18bf9e7dba9575664c25429d0ec32c449a498f42503b9435e8a8eceac15fd3
a274a527247ca234737cd17e866d75cf63174d46a5f59247a2db83fb8d5fed88
0.00363
cpp
a274a527247ca234737cd17e866d75cf63174d46a5f59247a2db83fb8d5fed88
29e9134996cafa415a94356ef3f292361c319d6943485d1b11538a6190884d6b
PIE_released_gem5_runtime
pie_14273
p00498
a0b97ad76b48d827af6a34697fdcb4d0e54031cf5ff7e92ed1eae772f74d48af
29e9134996cafa415a94356ef3f292361c319d6943485d1b11538a6190884d6b
0.011425
3.1472
2-4
17d4edc983e1f583beb4e9332d028833483a41f9a411d19c50684fa126042453
#include <bits/stdc++.h> using namespace std; struct edge { int to, cost; }; struct edge2 { int u, v, cost; bool operator<(const edge2 &e) const { return (cost < e.cost); } }; typedef pair<int, int> Pi; const int INF = 1 << 30; struct UnionFind { vector<int> data; UnionFind(int sz) { data.assign(sz...
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; typedef pair<int, int> Pi; struct UnionFind { vector<int> data; UnionFind(int sz) { data.assign(sz, -1); } int find(int k) { if (data[k] < 0) return (k); return (data[k] = find(data[k])); } void unite(...
037be2938b2ee0e549eb48a839343484630f64bd18b46d22adcbc5bfb75df944
429e2a29f8ca534b74305d7da50245ff76f821f77dd2927b80a9c7be98cafe86
0.021003
cpp
429e2a29f8ca534b74305d7da50245ff76f821f77dd2927b80a9c7be98cafe86
ae256bf808b2b9a3e97576e12cdaf9dcdcc861b5241e07c19c9ba4a249224a78
PIE_released_gem5_runtime
pie_14277
p00255
ea5400e21c5b0168f00b4dc285edf80f971a2a4bd2c46b115814fd444b31c63a
ae256bf808b2b9a3e97576e12cdaf9dcdcc861b5241e07c19c9ba4a249224a78
0.106309
5.06163
4-8
7ff4ca4388e39453e25f2ffe7755a1bba7dce2441e129caf51480746c872e75b
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; int main() { ll i, n, num, len, p, l[100000]; while (cin >> n, n) { num = n; len = 0; for (i = 0; i < n; i++) { cin >> p; len += p; } for (i = 0; i < n - 1; i++) cin >> l[i]; sort...
#include <cstdio> #include <algorithm> using namespace std; int main() { int n, p, l[100000]; while (scanf("%d", &n), n) { long long num = n, len = 0; for (int i = 0; i < n; i++) { scanf("%d", &p); len += p; } for (int i = 0; i < n - 1; i++) scanf("%d", &l[i]); sort(l,...
96c1e22258140163c255af033babff7a4b4740bd99d537c587befdd85ee596f2
bbe9ce5e2cb4de2dbe7a048526d247175d4b170dc2eeeb094c1773c9a3eca7fc
0.112362
cpp
bbe9ce5e2cb4de2dbe7a048526d247175d4b170dc2eeeb094c1773c9a3eca7fc
8d15acbd9cfda8a88426761c5cc519b9a4c81ae51a3b7168f597addaa204e925
PIE_released_gem5_runtime
pie_14279
p00040
d4d70832ee954ea606c763a4e7c4653deff92c94b230be6aae4914bc8ca92c44
8d15acbd9cfda8a88426761c5cc519b9a4c81ae51a3b7168f597addaa204e925
0.259403
2.308631
2-4
840c87e4d602e108e2eecc3d3832cfac749d29447a297d5f741ad4df6f61a406
#include <iostream> #include <map> #include <sstream> #include <string.h> using namespace std; map<int, char> AlphabetTable; map<int, int> table; char decode(char a) { int z = a - 'a'; for (int i = 0; i < 26; i++) { if (table[i] == z) return AlphabetTable[i]; } } void makeTable(int a, int b) ...
#include <iostream> #include <string> #include <vector> using namespace std; void solve() { int N; scanf("%d\n", &N); while (N--) { string s; getline(cin, s); string sbuf = s; sbuf += ' '; int n = sbuf.size(); int start = 0; int end = 0; vector<string> Vec; ...
f70251e74a65a50a941ae37e34c8e9cdc48f439854429965f1e238200c640bfe
70f5b93a33703eebf74dfe839f19dc299ac7a71ca3c8659468770ebc6725cad0
0.340158
cpp
70f5b93a33703eebf74dfe839f19dc299ac7a71ca3c8659468770ebc6725cad0
457ea11669b4db51c61768c294678aca84b1342f109cdf3200daf6686adbb1a0
PIE_released_gem5_runtime
pie_14285
p03941
04fffc85e4369271d1e75f17c05f82f3b768bc8b1eed353d2f34a6bcea48efc1
457ea11669b4db51c61768c294678aca84b1342f109cdf3200daf6686adbb1a0
0.744247
2.187948
2-4
b5f14d13c60386dc2dfce336b1f9f028c4213f5da3d4e8776789a6064c1c91fd
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typede...
#include <cstdio> #include <algorithm> #include <vector> using namespace std; #define MAXN 131100 #define LL long long #define INF 40000000000 struct node { LL in, out; node(LL _in = 0, LL _out = 0) { in = _in, out = _out; } }; vector<node> dp[MAXN], tmp1, tmp2; LL lim; void vector_merge(vector<node> &...
9cf0165951e249cd186d4f1c1e5d5153be2179368e1c19e0e2f47bb9f6f12e1b
71ec0adf943333e9dda6cc5699ffc55bd1c09f185e4054a0dbf2f2ec863b34c5
0.095832
cpp
71ec0adf943333e9dda6cc5699ffc55bd1c09f185e4054a0dbf2f2ec863b34c5
9c904e7967b37f15f89f13d7c2a05a0a163063194bc6618ff8ea3f750d163147
PIE_released_gem5_runtime
pie_14294
p00929
3863a5abfc97652acb2f75cf08017dfe3be398c8d0cfe02f16104bd52a0bc9b9
9c904e7967b37f15f89f13d7c2a05a0a163063194bc6618ff8ea3f750d163147
0.340189
3.549846
2-4
12c46190b31e44b437ea8269cb577b7ddbebe7c44713dc81d21007f443ee4ae2
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; int n, m; const int maxn = 5e4 + 1000; const int maxv = 600; struct Edge { int u, v, w, next; Edge(int _u = 0, int _v = 0, int _w = 0, int _next = 0) { u = _u, v = _v; w = _w...
#include <bits/stdc++.h> #define maxn 50018 #define N 558 #define inf 200000000 #define PII pair<int, int> using namespace std; int n, m; int cnt = 0; int sum1, sum2; int ans; int father[N]; struct nod { int from, to, cost; } edg[maxn]; bool cmp(nod i, nod j) { return i.cost < j.cost; } int v[N], n...
47c15a8d067f792524f4fd0f632d64bd2f359330c8643edadaadab24ba89e4c0
46d50ac11b7475602324cfc068e506f6eb8deab25dd3f979336f13eb7ee05ba6
0.018299
cpp
46d50ac11b7475602324cfc068e506f6eb8deab25dd3f979336f13eb7ee05ba6
fb0fc549f0246b3e283433721ef82196c9bb8fcb7baefae907f774d5bff5f3eb
PIE_released_gem5_runtime
pie_14304
p02834
d19eeb97e7f3d5a8be3d15c78e5ac68a1b203ba0a1ad4f6236bb983cd23d46f1
fb0fc549f0246b3e283433721ef82196c9bb8fcb7baefae907f774d5bff5f3eb
0.404471
22.102983
8+
707b2b07c70505b3e1368903e37b000b6e0bcdada330ff67ae4716cd6897c746
#pragma GCC optimize("O3") #pragma GCC target("avx") #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 << (...
#pragma GCC optimize("O3") #pragma GCC target("avx") #include <cstdio> #include <algorithm> 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 ...
f80aa5939164d045d4c8fd4454b8c2c1bf78d62b5c91fbe5087b808170998a3d
d33fced47591f89bee1b56a88211090683a470c813235fe41c7c6f29b10952d2
0.109943
cpp
d33fced47591f89bee1b56a88211090683a470c813235fe41c7c6f29b10952d2
b9b69f53af1cf30927b512047b5285305fa55ff0f4b7f4936c27963c5b99e5e2
PIE_released_gem5_runtime
pie_14326
p03168
25528ca5743ed4fea2fd96baad04babb90ebe83ae87a56c3beab56578d7c0676
b9b69f53af1cf30927b512047b5285305fa55ff0f4b7f4936c27963c5b99e5e2
0.381772
3.472449
2-4
678525bfce82c1a1b38e511c86b8ba1125732cba0c28e5ba64b1f996f8b40e4b
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long ll mod = 1e9 + 7; #define PI 3.1415926535897932385 #define inf 9e18 #define fastio \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long ll mod = 1e9 + 7; #define PI 3.1415926535897932385 #define inf 9e18 #define fastio \ ios_base::sync_with_stdio(false); ...
47b736351ddbdcb7608eb2fcb3411acc965b31aa76c886eee1ba640acadb7fb6
8189ed9f6f2400781dc8045b644a7d02e068923b2701ecca00357bb9fd413baa
0.391256
cpp
8189ed9f6f2400781dc8045b644a7d02e068923b2701ecca00357bb9fd413baa
ec6ed5b6f588ea22cc6008392954c3fbd21436a058a396e6fcad31265ec616b0
PIE_released_gem5_runtime
pie_14331
p02998
6e4d05a9e500b8e91dacf4d05562b741a08871795032f747e3d49da9ccf520b7
ec6ed5b6f588ea22cc6008392954c3fbd21436a058a396e6fcad31265ec616b0
0.825601
2.110129
2-4
3bf89fe56c71a17d8cf2b722cc27d8f30b5822d2e9f49ce5b44759646f04e15b
#include <bits/stdc++.h> using namespace std; #define reg register #define MaxN 100003 #define hhhhhhh 1000000 int N; int fa[MaxN]; long long ans, cnty[MaxN], cntx[MaxN]; map<int, bool> bk[MaxN]; struct Nd { int x, y; } a[MaxN]; inline int Rd() { int x = 0, f = 1; char ch = getchar(); while (ch < ...
#include <bits/stdc++.h> using namespace std; #define N 100000 int n, f[N * 2 + 5], cx[N * 2 + 5], cy[N * 2 + 5]; int find(int x) { return x == f[x] ? x : f[x] = find(f[x]); } int main() { #ifdef whyqx freopen("work.in", "r", stdin); freopen("work.out", "w", stdout); #endif cin >> n; for (int i = 1; ...
03b25cdb53c8553bd70db891867b9f5d59b80d8e2b38a07394bb8f10e698f778
28bee9e510e842aaabff40745ba23d38cd5298a330045eaf044e7cd36ac75f15
0.015771
cpp
28bee9e510e842aaabff40745ba23d38cd5298a330045eaf044e7cd36ac75f15
5f8e82476091b3ae97e825ed8a26399f0896100686f906ab8a8f867df56e792b
PIE_released_gem5_runtime
pie_14355
p00664
711d8efc18b0cc72f0003f2d4ad5ac2b53d6521c0277db75673c37fbff0f2e69
5f8e82476091b3ae97e825ed8a26399f0896100686f906ab8a8f867df56e792b
0.076569
4.855074
4-8
701e61c9b2a927d4fffdda219041d3b1ee2f4272063dbcaa1ec1eb628259872e
#include <iostream> using namespace std; int main() { int r, c, q, a[50000], b[50000], o[50000]; int nr, nc; bool row[50000], col[50000]; int ans; while (1) { cin >> r >> c >> q; if (!r && !c && !q) break; for (int i = 0; i < r; i++) row[i] = false; for (int i = 0; i < c...
#include <cstdio> using namespace std; int main() { int r, c, q, a[50000], b[50000], o[50000]; int nr, nc; bool row[50000], col[50000]; long long int ans; while (1) { scanf("%d %d %d", &r, &c, &q); if (!r && !c && !q) break; for (int i = 0; i < r; i++) row[i] = false; fo...
e9e5a665347b3e40e03c16604b9f1e97a030eda18a9d7e7d98ef4290d0ee8239
bb9f7d7cc69e6f929d6a3588fb367e809868a5ed85953f98d16d7c4d7f976882
0.109962
cpp
bb9f7d7cc69e6f929d6a3588fb367e809868a5ed85953f98d16d7c4d7f976882
3641bd9d7de768a64da26e807f0f21e8c0d7a7b7245de2ef02e11d6eed796784
PIE_released_gem5_runtime
pie_14379
p02610
fde7256fc7f4ea036faa2b948b74ea7df5abc88cda9850cb57b29fe43dfb0354
3641bd9d7de768a64da26e807f0f21e8c0d7a7b7245de2ef02e11d6eed796784
0.267419
2.43191
2-4
63ad7f5de39218426684a51710db4c7a164f887e1cad50188baf587c11842b62
#pragma GCC optimize("O2") #pragma GCC target("avx2") #include <iostream> #include <algorithm> #include <cstring> #include <queue> 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" #de...
#pragma GCC optimize("O2") #pragma GCC target("avx2") #include <iostream> #include <algorithm> #include <cstring> #include <queue> 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" #de...
ee57edc43630acdcb1c74b5ec9d049a050966a5cb03ef98fa75c79997a734f0e
7c7fb156ccaa605bdf0bbe577bd468846a6b9207d8efe09aee4fdb9942c4240d
0.012178
cpp
7c7fb156ccaa605bdf0bbe577bd468846a6b9207d8efe09aee4fdb9942c4240d
cdc6cbc3e94d1918d65056898c82e672a42043dedf8d1a57264c84b14cd8bfba
PIE_released_gem5_runtime
pie_14387
p03189
8a4a0f4d41c4636bd55a64b1e3ec20a49849a8d8bd1a102295398537dda28f28
cdc6cbc3e94d1918d65056898c82e672a42043dedf8d1a57264c84b14cd8bfba
0.062358
5.120412
4-8
205b1ca5838c2bcebae2b7a8f9f20943ba58185aa90f5124ed579b4feb9c69c6
#include <cmath> #include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> #include <cstring> #include <map> #include <queue> #include <set> #include <vector> #include <bitset> #define int long long #define lowbit(x) ((x) & (-x)) using namespace std; const int maxn = 3005, mod = 1e9 + ...
#include <cstdio> const int _ = 3e3 + 5, p = 1e9 + 7; int n, m, a[_], dp[_][_]; inline int power(int x, int k) { int res = 1; for (; k; k >>= 1, x = 1ll * x * x % p) if (k & 1) res = 1ll * res * x % p; return res % p; } int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= n; ++i) ...
eedcaf026fc61c84578933faaa078eb19384e53961981dfef5f87b4691ad4847
7a382e8975658c15ee2c0b5550fa8e7e51f143d3efe40806969b07b8e0dc6191
0.016983
cpp
7a382e8975658c15ee2c0b5550fa8e7e51f143d3efe40806969b07b8e0dc6191
deeb0bf967b2a771bff89c306f2b8acf33468653476fc8305412db4b9cfb58fd
PIE_released_gem5_runtime
pie_14439
p03252
708a3fd2415428e4854cd732f560782f6c87c5a429d5a96e49ffc3583f913dcd
deeb0bf967b2a771bff89c306f2b8acf33468653476fc8305412db4b9cfb58fd
0.132545
7.804431
4-8
b5b4623e1065db00402fa03442a50526c48f6286a2b0e24085732f4165ee9f20
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 7; int num[maxn]; int main() { string stra; string strb; cin >> stra >> strb; int len = stra.size(); memset(num, -1, sizeof(num)); for (int i = 0; i < len; i++) { if (num[stra[i]] == -1) { num[stra[i]] = strb...
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 200000; int len; char s[N + 5], t[N + 5]; char s1[255], t1[255]; int main() { scanf("%s %s", s + 1, t + 1); len = strlen(s + 1); for (int i = 1; i <= len; i++) { if ((!s1[s[i]] || s1[s[i]] == t[i]) && ...
fc0ba0a44dfd22cd20f42ca44b179d577bae338ce2e4201bdedf79bc08d00eaa
84e5e7ac7b626e499a8efae136578424ccf4017396c1ca79d3363ced7dd664c4
0.104504
cpp
84e5e7ac7b626e499a8efae136578424ccf4017396c1ca79d3363ced7dd664c4
70eb8ee7d8b1485ca8579b657fa3f1a4565d1c9edcf7b2e874f768a46fd483dd
PIE_released_gem5_runtime
pie_14472
p03821
5608e8c361f1e75f0f3f851f2d857efbcc3067d021c619b1f23f6277eb99e0c7
70eb8ee7d8b1485ca8579b657fa3f1a4565d1c9edcf7b2e874f768a46fd483dd
0.276094
2.641945
2-4
971b2308cb61cf0a683c41e9a95dc798c9163dadd826b1e3c6c149f98b1c886a
#include <bits/stdc++.h> using namespace std; int main() { int mod, n, i, a[100001] = {0}, b[100001] = {0}; long long tim[100001] = {0}; long long mul, done = 0; cin >> n; for (i = 0; i < n; i++) cin >> a[i] >> b[i]; for (i = 0; i < n; i++) { mod = a[i] % b[i]; if (mod) tim...
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T1, class T2> ostream &operator<<(ostream &os, pair<T1, T2> &p); template <class T> ostream &operator<<(ostream &os, vector<T> &v); template <class T> ostream &operator<<(ostream &os, set<T> &v); #define debug(a) cerr << #a << ...
890488c4dbfebddc2ad4e788386b37bd531311ebbbbdc357942cbefdb947469b
26c75ba0fb0136c9c4bd65e82e42f64c71f829387d2c6d7f668555eed76b28f8
0.000192
cpp
26c75ba0fb0136c9c4bd65e82e42f64c71f829387d2c6d7f668555eed76b28f8
3f836dc3dfeb22a09e6148a4abad11a964f40178d98efe702ed1e56c252ac80a
PIE_released_gem5_runtime
pie_14515
p03311
506d8ba0e39e704432ab5802cf017ee402479852d4c001a780b54c9f631a6a80
3f836dc3dfeb22a09e6148a4abad11a964f40178d98efe702ed1e56c252ac80a
0.0052
27.035174
8+
b514fd5fb034bcdc7ebf1d3f45329880e0b3a2e80c1573f9c8665f5992924892
#include <bits/stdc++.h> using namespace std; #pragma warning(disable : 4996) #ifndef constexpr #define constexpr const #endif using ll = long long; using LL = ll; using ull = unsigned long long; using uLL = ull; using pii = pair<int, int>; #define clean_0(A) memset((A), 0, sizeof(A)) #define clean_1(A) mem...
#include <cstdio> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; const int maxn = 2e5 + 7; int a[maxn]; int main() { int n; scanf("%d", &n); for (int i = 1; i <= n; ++i) { scanf("%d", &a[i]); a[i] -= i; } sort(a + 1, a + 1 + n); ll sum = 0; for (int...
202c76c4bced76ebacbf578c34394097b3de096655c17ccd9d410fb6b7ec687f
88cfe2fbf6d296a451b501bca4f2c3faf65192dcb4ab5465e62f5c24d8d18600
0.011864
cpp
88cfe2fbf6d296a451b501bca4f2c3faf65192dcb4ab5465e62f5c24d8d18600
e08f50ccca0f518adf5bd7150c8214341bda9f429c7986225b25046407906d65
PIE_released_gem5_runtime
pie_14529
p03108
908526033da19b2659bcd2e22dfa4f55719df19601e9131e47c23d955f55bfdb
e08f50ccca0f518adf5bd7150c8214341bda9f429c7986225b25046407906d65
0.164189
13.839408
8+
3ed85a59aec7c34f71958a9c539fc2c7e878fea578dc2485672a3e661c82af9f
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define error(args...) \ { \ string _...
#include <stdio.h> #include <stdlib.h> #define N 100100 using namespace std; long long f[N], k[N], ans[N], sum; int x[N], y[N]; int get(int x) { if (k[x] == x) return x; return k[x] = get(k[x]); } void ju(int x, int y) { int tx = get(x); int ty = get(y); k[tx] = ty; f[ty] += f[tx]; } int...
4ac27c16abc3d1ddaddc0ade55134aaa9e64b22f865f554dfdc429864afd7624
c4121a35f4ce5f028f68ef1a97a345b7ad7dc3cface007d07fe51b9de68b42e9
0.019646
cpp
c4121a35f4ce5f028f68ef1a97a345b7ad7dc3cface007d07fe51b9de68b42e9
f85a5f113f8be1827cda541745b36d732038d352223c0162013416763c00fbbd
PIE_released_gem5_runtime
pie_1455
p02612
c4ed54fa5317da85c024ea7f4c30e4dc3d6876dbc146c16487c0754c02580980
f85a5f113f8be1827cda541745b36d732038d352223c0162013416763c00fbbd
0.103524
5.269518
4-8
1df0370651c5e8dc7715df74ebe3925893330211764423b625a0b2adfd1ba8b4
#include <cstdlib> #include <cstdio> #include <cstring> #include <cmath> #include <iostream> #include <algorithm> #include <stack> using namespace std; int main(void) { int N; scanf("%d", &N); if (N % 1000 != 0) printf("%d", 1000 - (N % 1000)); else printf("0"); return 0; }
#include <stdio.h> int main() { int n; scanf("%d", &n); if (n % 1000 == 0) printf("0\n"); else { int x = n / 1000 + 1; x *= 1000; printf("%d\n", x - n); } return 0; }
787dc0c62b8f703599887d64df38da0ee312958aa837c1414b6a9b5eb0b21f8f
85d27d2519e27837b0edd46592ceb68713b483e5f83ffd4206fd6cf9c5b0b6c6
0.020414
cpp
85d27d2519e27837b0edd46592ceb68713b483e5f83ffd4206fd6cf9c5b0b6c6
e2f387055fda0f53699600fdbb3262db9144fd7223561d907415216f7561c5c6
PIE_released_gem5_runtime
pie_14581
p02960
6ca6cba84459a75de9fe360c3a8183eb0aecdcafcd7e27e7588994429f6c9522
e2f387055fda0f53699600fdbb3262db9144fd7223561d907415216f7561c5c6
1.291925
63.284926
8+
fa643fa1b836fdb1315b814608786ec90bacccbc10b33d33ef4b24ade9cdecb0
#include <bits/stdc++.h> using namespace std; #define fix(f, n) std::fixed << std::setprecision(n) << f #define fast \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <stdio.h> #define N 13 #define M 1000000007 #define L 10 char s[111111]; int g[N][L]; int main() { long long d[2][N] = {1}; int i, j, x, p0, p1; for (i = x = 0; i < N; i++, x += L) { for (j = 0; j < L; j++) { g[i][j] = (x + j) % N; } } scanf("%s", s); for (i = 0, p0 = 0,...
0b86d2acc4f0a495047085b6020766d1d3a2497376b5669003ceca3703e54e6e
ae383fa91706bfbc99669154fc146b40d5b4977031a7f9f36f1b068ca52292d4
0.069619
cpp
ae383fa91706bfbc99669154fc146b40d5b4977031a7f9f36f1b068ca52292d4
e849a5d4d64a65e30bb4a75ba9e8a96ceef468b74cdca446fc1ea9d869740128
PIE_released_gem5_runtime
pie_14624
p03058
52353c947b68263e5bc9d6a556913a1b65702a34cf82f4fdca340e5034fd0a03
e849a5d4d64a65e30bb4a75ba9e8a96ceef468b74cdca446fc1ea9d869740128
0.142673
2.049354
2-4
40eb089a9764f1dcac47c37bc56771a171a6cc8c001252b4d458797d4eeb3c32
#include <bits/stdc++.h> using namespace std; #define ri register int namespace io { const int SIZE = (1 << 21) + 1; char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr; #define gc() \ ...
#include <bits/stdc++.h> using namespace std; #define ri register int namespace io { const int SIZE = (1 << 21) + 1; char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr; #define gc() \ ...
b1ca78506db33fe0b86d7e471fd8b41425d84eefd662d95c293b6f01ffd1a6e4
f0da23982d35cb94da52d7c3abf9ff7e74931435717114dc873bb52e97c44d84
0.063992
cpp
f0da23982d35cb94da52d7c3abf9ff7e74931435717114dc873bb52e97c44d84
8ade31d02f557c270a52ce2e15d5cbf98fa1b906096ae85e407e676c6ff33f1c
PIE_released_gem5_runtime
pie_14626
p02903
6570c0ca69927d9020751023047a89d062a9a1e96baf9aa716df50c4fbc0dc4f
8ade31d02f557c270a52ce2e15d5cbf98fa1b906096ae85e407e676c6ff33f1c
0.332434
5.194893
4-8
0ca39a1f494166022f462b239945abcebc07402d50b5b6b9361d6d2cc76ea8ad
#include <iostream> #include <cstring> using namespace std; int arr[1005][1005]; int main() { int h, w, a, b; cin >> h >> w >> a >> b; memset(arr, 0, sizeof(arr)); if (b == 0) { if (a == 0) { for (int i = 1; i <= h; i++) { for (int j = 1; j <= w; j++) { if (j == w) ...
#include <bits/stdc++.h> using namespace std; int h, w, a, b; string s1, s2; int main() { cin >> h >> w >> a >> b; for (int i = 0; i < a; i++) s1 += '1', s2 += '0'; for (int i = a; i < w; i++) s1 += '0', s2 += '1'; for (int i = 0; i < b; i++) cout << s1 << "\n"; for (int i = b; i < h; i++...
a3c8f4eef24ca79b6e929c93ef590e5a7dbdfcdd67c8d6d091d19d7c47b80367
1609f5551611b85cc134dde786a5bb73f9d6303dc34ca6bc7d15984111184f0c
0.026072
cpp
1609f5551611b85cc134dde786a5bb73f9d6303dc34ca6bc7d15984111184f0c
9b04314472a290ffb28fdbd62f95dc4dfd53d861f3f4a07b9039348cdd18fcc9
PIE_released_gem5_runtime
pie_14644
p00887
0a4ea05763d18e8643d28b06f9b2ca6d0c843ec7ba0980fe3a204390318c2e53
9b04314472a290ffb28fdbd62f95dc4dfd53d861f3f4a07b9039348cdd18fcc9
0.197483
7.574386
4-8
35f5f0fbbe2c4183cfe517d53fea06c471193a989d54dc99411dc89ada581106
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int M, N, D, S[32][32], a[768][768]; bool solve(int n) { int h = 0; rep(k, n) { int ix = -1; for (int i = h; i < n; i++) if (a[i][k]) { ...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <bitset> #include <algorithm> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int M, N, D, S[32][32]; bitset<640> bits[640]; bool solve(int n) { int h = 0; rep(k, n) { int ix = -1; for (int i = h; i < ...
7813eb30b462e24941d32b7faba0f8892e9b082f0eab2cd86525c106a95bfa43
6b6ddc02e7751f3bfb00dbc12a3a6821aec22c862ca9581495ea23e86b1bd02a
0.060464
cpp
6b6ddc02e7751f3bfb00dbc12a3a6821aec22c862ca9581495ea23e86b1bd02a
9be82eb50c7935ff31cb68f8370a7732cef14fc06ededdf878930393189f46e0
PIE_released_gem5_runtime
pie_14659
p02803
f8bb3c4fb3fccd0b3c89f769bed83693aa73192f6bcd2dcefbf53fbfef366f4a
9be82eb50c7935ff31cb68f8370a7732cef14fc06ededdf878930393189f46e0
0.138106
2.284112
2-4
b19290608ce4555d6aab4018b58e02a5cdb797bdd053aee84cf7a89abcf51db5
#include <bits/stdc++.h> using namespace std; typedef long long ll; using pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < n; i++) #define rrep(i, m, n) for (ll i = m; i > n; i--) #define Rep(i, m, n) for (ll i = m; i < n; i++) #define all(vec) vec.begin(), vec.end() #define lmax(x, y) max<ll>(x, y) #d...
#include <bits/stdc++.h> using namespace std; typedef long long ll; using pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < n; i++) #define rrep(i, m, n) for (ll i = m; i > n; i--) #define Rep(i, m, n) for (ll i = m; i < n; i++) #define all(vec) vec.begin(), vec.end() #define lmax(x, y) max<ll>(x, y) #d...
dfbd59ccf18f1be401e590909313bca19b929e17ae35a426b10292d8fe4d866f
7add8e7d267c02fa091b0242d554e6db5bd70d150b193cc4ffcc08610c6f581d
0.016785
cpp
7add8e7d267c02fa091b0242d554e6db5bd70d150b193cc4ffcc08610c6f581d
98aafb5dd1f8dd5202b49b4d6436a71ce5b7c2d770eab10bf81cfd62b8d8ace7
PIE_released_gem5_runtime
pie_14669
p00462
89a38f82c5a6ef2cc7d4759e3bc1958a055b2ced565a8f8d3e26bb63c239deea
98aafb5dd1f8dd5202b49b4d6436a71ce5b7c2d770eab10bf81cfd62b8d8ace7
0.084595
5.039945
4-8
3623235a56fc0c36d7485b4c4b4af12a0d8cc055420b61d2dcd79e2131ffa6ce
#include <vector> #include <algorithm> #include <iostream> #include <string> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> using namespace std; int main() { int i, j; int d, m, n, p; int sm; vector<int> a; while (cin >> d && d) { cin >> m >> n; a.clear(); ...
#include <algorithm> #include <cstdio> using namespace std; int main() { int i; int d; while (scanf("%d", &d), d) { int m, n; scanf("%d%d", &m, &n); int a[100001]; a[0] = 0; a[m] = d; for (i = 1; i < m; ++i) scanf("%d", a + i); sort(a, a + m + 1); int sm = 0; ...
4ba86ff8c41e67ed68230a739e7b095db5e7ccbf8c773dcd3e720b74782e8c3f
bd7ee31491712de8f8433ec9a4317511bae5b577090d6e3810f027ed0bcaf434
0.05814
cpp
bd7ee31491712de8f8433ec9a4317511bae5b577090d6e3810f027ed0bcaf434
114b077a08e0d42ad1d77452febecf4ad406d0e5ef2ec27fb42d52d546b86146
PIE_released_gem5_runtime
pie_14693
p02351
d4ab0c2021ed952061d6e1e6145ef5ffc04ef4a61450fd57ec28bc0c93054fed
114b077a08e0d42ad1d77452febecf4ad406d0e5ef2ec27fb42d52d546b86146
0.179324
3.08435
2-4
418256cba7ba58e0a5193f4366c7263648b7350bedd9266de5e0b0fa8af38fca
#include <bits/stdc++.h> #include <unordered_map> using namespace std; using ll = long long; template <typename T> class FenwickTree { const ll n; unordered_map<ll, T> data; public: FenwickTree(ll n_, int pmax = 1e5) : n(n_), data(pmax) {} T find(ll p) { T res = 0; while (p >= 0) { res...
#include <bits/stdc++.h> using namespace std; using ll = long long; struct RS { using type = ll; static type id() { return 0; } static type op(const type &l, const type &r) { return l + r; } }; class seg_node { public: using M = RS; using T = typename M::type; using U = ll; T get() const { retu...
c0e1095710b04e6c5266f36d4da8680c0e4923b18345cb0beb1994401939ad0e
91420a6ac9f6c40b2c51bc67346abf4ce2d0e38da7c736dafd1695c381369b75
0.007734
cpp
91420a6ac9f6c40b2c51bc67346abf4ce2d0e38da7c736dafd1695c381369b75
7963c09cffd639596ce6e5a0da34b1fb2159a41e7cde2a71dedc1d57c6fb2a1c
PIE_released_gem5_runtime
pie_14746
p00002
68246a9b84006cfbb86f04d780d8e4a00caab3ffa4b4d64106f3610465880083
7963c09cffd639596ce6e5a0da34b1fb2159a41e7cde2a71dedc1d57c6fb2a1c
0.040676
5.259529
4-8
438a08edb30c6f5e3708164b122fd0350b071be413f49d64752064af0020ddb1
#include <iostream> #include <cstdio> using namespace std; int main() { int a, b, n, i, count; while (2 == scanf("%d %d", &a, &b)) { n = a + b; count = 0; while (n != 0) { i = n % 10; n /= 10; count++; } cout << count << endl; } return 0; }
#include <stdio.h> #include <math.h> int array[100]; int counter(long long int a, long long int b); int main() { long long int a, b; int count; while (scanf("%lld %lld", &a, &b) == 2) { count = counter(a, b); printf("%d\n", count); } return (0); } int counter(long long int a, long long ...
f22d075a08bd335e51e51cfc175ce38c7ccb63267292d64810ce8ceec7b18819
55594b357c25b5668b183b18d51e154d1929457ad2f1805cbc0f1138957a9feb
0.10517
cpp
55594b357c25b5668b183b18d51e154d1929457ad2f1805cbc0f1138957a9feb
0cf0312c551fb0628182169701fe96c027909cfa7a9cee95a5b58aff3a07f2b9
PIE_released_gem5_runtime
pie_14761
p02376
fb0582174a1de8eca9eda28773a1bc8ba9e0e000c1961e4e93257635ea354a7b
0cf0312c551fb0628182169701fe96c027909cfa7a9cee95a5b58aff3a07f2b9
0.381331
3.625871
2-4
35848da8617d015fcdb0929c396539312075487721a34858ea105377f1f6cc14
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <string> #include <cmath> #include <map> #include <cstring> #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, init, n) for (int i = init; i < (n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define RALL(obj)...
#include <bits/stdc++.h> using namespace std; template <typename T> struct Edge { int rev, from, to; T cap, icap; Edge(int rev, int from, int to, T cap) : rev(rev), from(from), to(to), cap(cap), icap(cap) {} }; template <typename T> struct Graph { vector<vector<Edge<T>>> list; Graph(int n = 0...
f1f7025382b20f5e3eb65a71dca7ca4b89318666b07be0b54ab1b80b9bde0bc2
cebf9e54ae8d4efa6b7d7bf81798b403f3e95caf25c64f1f4d5cba42cb560e95
0.030928
cpp
cebf9e54ae8d4efa6b7d7bf81798b403f3e95caf25c64f1f4d5cba42cb560e95
da98281a146aac1aa533b82fdff6730beb5dec48ce09e4bae276ad7b00b58b11
PIE_released_gem5_runtime
pie_14797
p03806
6f15d8afb4be9c0785b63ec1b40c67af2915e65fab08270c98fe26256105108d
da98281a146aac1aa533b82fdff6730beb5dec48ce09e4bae276ad7b00b58b11
0.091611
2.962033
2-4
dc3f6d7f22cac2c3cbe5543db13727ace3a040885c9373b84358f66ec07d3c6a
#include <bits/stdc++.h> #define INF 1e9 using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n, m1, m2; cin >> n >> m1 >> m2; vector<int> a(n), b(n), c(n); for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i]; int dp[500][500], nxt[500][500]; for (int i ...
#include <bits/stdc++.h> #define INF 1e18 #define int long long #define Rep(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) Rep(i, 0, n) #define all(a) (a).begin(), (a).end() using namespace std; typedef pair<int, int> P; typedef pair<int, P> PP; const int mod = 1000000007; #define MAX_N 41 #defin...
23e9f85964a733d53cc032118c88069199cb2eef81199465174debdb7d67f83b
c5e53082d2e50da24c8d3f888a2bccd2ceacdf306d51ce69f7f45ceca24ab982
0.012176
cpp
c5e53082d2e50da24c8d3f888a2bccd2ceacdf306d51ce69f7f45ceca24ab982
436c4b47012904d5827d836df50cf62338e476d9c97f19d3ca7fd7ef53738eed
PIE_released_gem5_runtime
pie_14798
p00440
d3b1cabf709a37ef36daeea7b7618d5a61c7bc8c2a1fa384ea3e7adc04a1324d
436c4b47012904d5827d836df50cf62338e476d9c97f19d3ca7fd7ef53738eed
0.112603
9.247761
8+
11c37946e22472760e2f1522a38dc22a1847702cbf0ce12053751816ddc1679d
#include <cstdio> #include <cstring> using namespace std; #define rep1(i, x) for (int i = 1; i <= (x); ++i) int a[100001]; int memo[100001]; int start[100001]; int main() { int n, k; while (scanf("%d %d", &n, &k), n || k) { memset(a, 0, sizeof(a)); memset(memo, 0, sizeof(memo)); memset(star...
#include <cstdio> #include <algorithm> using namespace std; #define rep1(i, x) for (int i = 1; i <= (x); ++i) int a[100001]; int memo[100001]; int start[100001]; int main() { int n, k; while (scanf("%d %d", &n, &k), n || k) { fill(a, a + n, 0); fill(memo, memo + n, 0); fill(start, start + n...
850d7766569a13eb56dbeb816e9417b5556b91934e1fee9f6f3ed42ac3308e91
3094a04aa7068560e26b026294c6a5f9f8393942c71430f8df8eecaf5c088c39
0.111427
cpp
3094a04aa7068560e26b026294c6a5f9f8393942c71430f8df8eecaf5c088c39
ba8118be99f75a3d1f93858c5f62bf8b87e2c2d861e69717ad41368ac134cae6
PIE_released_gem5_runtime
pie_14812
p00694
a64f74ef34d4392e311d2010a85015d23c3709972282fac5a1df581e49506def
ba8118be99f75a3d1f93858c5f62bf8b87e2c2d861e69717ad41368ac134cae6
0.270254
2.425391
2-4
dd0266698b8ed5fa3819f033c7efea0560dafc6093a03f6aed46dbeb0ce8259e
#include <iostream> #include <string> #include <vector> #include <set> #include <algorithm> #include <cstring> #include <cstdlib> #include <cmath> #define INF 1001 using namespace std; struct point { int x, y, z; point() : x(0), y(0), z(0) {} point(int x, int y, int z) : x(x), y(y), z(z) {} bool o...
#include <iostream> #include <string> #include <vector> #include <set> #include <algorithm> #include <cstring> #include <cstdlib> #include <cmath> #define INF 1001 using namespace std; struct point { int x, y, z; point() : x(0), y(0), z(0) {} bool operator<(const point &t) const { if (x < t.x) {...
1032d7bcef404ad31ccfc8199884f0c0e61e9a6ac80d90b12f9d5f7c92fbc077
c2eb02163dea91ce5e0397b55909c059a9958d8cc0e4552d9b26fe4ce006bf80
0.002397
cpp
c2eb02163dea91ce5e0397b55909c059a9958d8cc0e4552d9b26fe4ce006bf80
557c1e0a377d007bd5598a30b87a1025262f5184a7e13bc2b0bbf4414915a543
PIE_released_gem5_runtime
pie_14817
p03681
e96509a828be67397020c1c6d04e5ff281b49fe1a3572a78bcd7794134fa6a58
557c1e0a377d007bd5598a30b87a1025262f5184a7e13bc2b0bbf4414915a543
0.005198
2.168488
2-4
fe05d31a1341b5a0f7ca40474c907914cca93fec0d5786914e424510fc5ad2e2
#include <iostream> #include <algorithm> #include <numeric> #include <cmath> #include <string> #include <vector> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <iomanip> #include <functional> using namespace std;...
#include <iostream> #include <algorithm> #include <numeric> #include <cmath> #include <string> #include <vector> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <iomanip> #include <functional> using namespace std;...
f205a93704715a34876e71bed9bf700a0d211ac94e21d6eb681324c831bace72
79e97b7c0ecf2ceb1b99b0c504660cd37384cc4231d2d1af9e404acd35a4fa82
0.101666
cpp
79e97b7c0ecf2ceb1b99b0c504660cd37384cc4231d2d1af9e404acd35a4fa82
081c6d912148777e4029cc78a61299282c4fe5fee747b1c35a5d3cb2b1573d24
PIE_released_gem5_runtime
pie_14822
p00472
18bfc3d8b7f7730f5f0f6f46f5f66c989d50a8c6fabd27f5b223ec9bf4a05193
081c6d912148777e4029cc78a61299282c4fe5fee747b1c35a5d3cb2b1573d24
0.294794
2.899636
2-4
99bd6f94f599375c5bd3c99e78b9b115d0c665a760baee66e9e1efce3b3eb73b
#include <iostream> #define MAX 100500 using namespace std; int main(void) { int n, m; long long int N, M[MAX], d[MAX]; while (cin >> n) { cin >> m; for (int i = 0; i < MAX; i++) { M[i] = 0; d[i] = 0; } d[0] = 0; for (int i = 1; i < n; i++) { cin >> N; d[i...
#include <iostream> using namespace std; int shu[100000]; long long co[100001]; int main() { int n, m; cin >> n >> m; for (int i = 0; i < n - 1; i++) cin >> shu[i]; for (int i = 0; i <= n; i++) co[i] = 0; int ima = 0; for (int i = 0; i < m; i++) { int s, e; int a; cin >> a; ...
03d9e508a8fb38a4ef86375c6f8f2533541433cad92560e78e2baa62e5295d28
e2447b7718137f49de1068eaed1c170b265dcbda90ba8195141305b4d6ac9d1b
0.109415
cpp
e2447b7718137f49de1068eaed1c170b265dcbda90ba8195141305b4d6ac9d1b
fe5b6eef7848a02057718a87bbc40dde248d156a8ce09dbc182d74543a8bb9df
PIE_released_gem5_runtime
pie_1499
p02303
7b928ac10fadc78423ea2c8e7b8af85a743ae2106678fa1636b32eb05900828a
fe5b6eef7848a02057718a87bbc40dde248d156a8ce09dbc182d74543a8bb9df
0.280247
2.561335
2-4
987edb2949b8162951ddedfe334ddbf46570286195915520b98f4393506e69b5
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; typedef complex<double> C; namespace std { bool operator<(const C &a, const C &b) { return real(a) != real(b) ? real(a) < real(b) ...
#include <bits/stdc++.h> #define EPS 1e-12 #define rep(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef complex<double> C; const double PI = 4 * atan(1.0); namespace std { bool operator<(const C a, const C b) { return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag(); } }...
e374cce82b86d11b4ef77f180cbc65bb75ce99d2014afad92044290abb4b107b
b185754c619add72d3c373019809ccb2566e1dee647156f9f4b43f73ec0403f8
0.106682
cpp
b185754c619add72d3c373019809ccb2566e1dee647156f9f4b43f73ec0403f8
c6ff4cf23193c166c889ecada8424e4822bba523682c72ff5528b24a50db9647
PIE_released_gem5_runtime
pie_1516
p01096
0e98e6d0dc5bd284de8141f435b728bfedc4d669e363d2c36e803a5a3966d135
c6ff4cf23193c166c889ecada8424e4822bba523682c72ff5528b24a50db9647
0.234061
2.194005
2-4
3c2c3e76cfd5b314a6332b0604f9e23788f47b104744c9b4ab42c8ef1d75c8be
#include <iostream> #include <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits>...
#include <iostream> #include <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits>...
29b9444e7dbe8c6f96e24e14123d20d0c89509ae82c5c613a9c557bfd359e234
fab5d4ad34a7d60c02578dba5ebc76664980f368f1f25386f2453913a2eb77a0
0.053383
cpp
fab5d4ad34a7d60c02578dba5ebc76664980f368f1f25386f2453913a2eb77a0
1c8753758898cba97cb5a55718e080e5683be6c649068cfef17c6b9daabd6340
PIE_released_gem5_runtime
pie_15267
p03942
50fdc3ee6920d529c6a95d542c054ee3459366741d906d46a7ff9958ea963c1f
1c8753758898cba97cb5a55718e080e5683be6c649068cfef17c6b9daabd6340
0.257198
4.817973
4-8
3eba0f628df95cf04c333918bda7275902c21db500093359f26c7059ded21406
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, b, a) for (int i = (b) - 1; i >= (a); i--) #define ITER(it, a) \ for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair <int, int> pii; #define ALL(a) a.begin(), a.end() #define FastIO ios::sync_with_stdio(false); cin.tie(0);cout.tie(0) #define IN freopen("input.txt","r+",st...
4dfaefb64b70c9ac4d11e7b85e17acb0b500ef7304b4f6bc693bcb657ffb534b
f5372617a3ce7b2580cd704dd532df6c4e364f9e166f72990ba2e87944f22eac
0.187547
cpp
f5372617a3ce7b2580cd704dd532df6c4e364f9e166f72990ba2e87944f22eac
fc14437cb028fc7583723e52206f180098374dd5a84a632fbb5f1bc59d4a03ca
PIE_released_gem5_runtime
pie_15277
p01481
cab4c175faea74d64e2144390c0bc56899fa4e80246bac08f8f9d32ae69a25d1
fc14437cb028fc7583723e52206f180098374dd5a84a632fbb5f1bc59d4a03ca
0.503972
2.687182
2-4
0266f5ccdb7db52bcf37945f13bcd2233d7730a0cf1891866a82f667f7759121
#include <bits/stdc++.h> #define N 1000021 using namespace std; int w, h; int par[N], Rank[N]; char mp[1001][1001]; void init() { for (int i = 0; i < N; i++) par[i] = i, Rank[i] = 0; } int find(int x) { if (par[x] == x) return x; return par[x] = find(par[x]); } void unite(int x, int y) { x =...
#include <bits/stdc++.h> using namespace std; #define lp(i, n) for (int i = 0; i < n; i++) #define lps(i, j, n) for (int i = j; i < n; i++) #define fordebug \ int hoge; ...
a5312fb7a5805f90ea88f51c817227e28155137205159fa515d466703666d9fa
afcbb647e1e8eb5c87d8f338eb1f2a73d744db33a51edafa6d0fc2190b507af0
0.019464
cpp
afcbb647e1e8eb5c87d8f338eb1f2a73d744db33a51edafa6d0fc2190b507af0
7a0e41249de25c907e0d5e895b2651d420dbfd31f504f677afdb1d8d86c489a3
PIE_released_gem5_runtime
pie_15280
p00952
fe04ac3adf676c2e7ab6cc08dd3918ef1ace8da3b4ad40478bdf4b9f17533f22
7a0e41249de25c907e0d5e895b2651d420dbfd31f504f677afdb1d8d86c489a3
0.102558
5.269126
4-8
814ae2b7e822d5ca8b7bcd72385b6f490a94ca40543515739cd702f3318b63df
#include <bits/stdc++.h> using namespace std; const int N = 500010; int f[N], cur, s[N]; void pn() { puts("No"); } void py() { puts("Yes"); } void add(int x, int val) { if (!x) return; while (x < N) { s[x] += val; x += x & -x; } } int query(int x) { int ret = 0; while (x) { ret +...
#include <cstdio> #include <algorithm> using namespace std; int d[1000005]; int main() { int n; scanf("%d", &n); int top = 0, down = 0; while (n--) { int x; scanf("%d", &x); if (d[0] || x < top) { printf("No\n"); continue; } if (x == top && top != down) { prin...
5d12185a5f8bd95e2fa45551c8471ea6596217302323de2d19f837a3c19f7dec
c730b38976fdb247881e29c11c4287940252c98714d8770b1a39323fab669fb0
0.009459
cpp
c730b38976fdb247881e29c11c4287940252c98714d8770b1a39323fab669fb0
08608facf7b62bceb22cd333c969d85e6c0f59b8164dd703f1a1bd31cacf8748
PIE_released_gem5_runtime
pie_15298
p02265
1c648d3befa91d93858bbb897484247e16734f7920d778667e567a46834d7807
08608facf7b62bceb22cd333c969d85e6c0f59b8164dd703f1a1bd31cacf8748
0.045474
4.807298
4-8
0e2fd7f7a8cb8e3fd75e4bc5fbe71cd5bfe81ac80509ac760165637bdf7f5b6c
#include <cstdio> #include <list> #include <algorithm> using namespace std; int main() { int q, x; char com[20]; list<int> v; scanf("%d", &q); for (int i = 0; i < q; i++) { scanf("%s", com); if (com[0] == 'i') { scanf("%d", &x); v.push_front(x); } else if (com[6] == 'L') ...
#include <stdio.h> #include <stdlib.h> struct Node { int v; Node *prev; Node *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->prev = nil; nil->next = nil; } void insertNode(int x) { Node *node = (Node *)malloc(sizeof(Node)); node->v = x; nil->next->prev = node;...
70229be967cade854af52a69503d8262f2168c082a5e028773121c7e3800e601
a7cdea25a2ec404b1a971244b9859f9f327e2a8b3b01353721e298679099cb62
0.026536
cpp
a7cdea25a2ec404b1a971244b9859f9f327e2a8b3b01353721e298679099cb62
dfcfb5ef03132e2f1c95632c20d6557e2cc22c2418e785d78007fa9008473cac
PIE_released_gem5_runtime
pie_15355
p02926
5f2cc3e1d62c05057a27fd59756e2412f4dc3009ae7c1292dfefa0dbc91e7487
dfcfb5ef03132e2f1c95632c20d6557e2cc22c2418e785d78007fa9008473cac
0.109973
4.144306
4-8
8a1dd38b45ac37a1a49caf4eb806566f75a690423d24d7fcf6c05b5215860460
#pragma GCC optimize("O3") #include <bits/stdc++.h> typedef long double ld; using namespace std; const int N = 105; struct Pt { ld x, y, ang; Pt(ld _x = 0, ld _y = 0) : x(_x), y(_y), ang(atan2(_y, _x)) { if (ang < 0) ang += 2 * M_PI; }; Pt operator+(const Pt &a) const { return Pt(x + a.x, y +...
#pragma GCC optimize("O3") #include <bits/stdc++.h> typedef long double ld; using namespace std; const int N = 105; struct Pt { ld x, y, ang; Pt(ld _x = 0, ld _y = 0) : x(_x), y(_y), ang(atan2(_y, _x)) { if (ang < 0) ang += 2 * M_PI; }; Pt operator+(const Pt &a) const { return Pt(x + a.x, y +...
f4bcb30de86cdaf01e88c463bc21bce9c74fd07974615dbeb78e09b8f56e1c8e
0dd4d2c6a93fb77d3a723bae0b893e932a11cd68473b3496814b1aa47fc5bb35
0.027247
cpp
0dd4d2c6a93fb77d3a723bae0b893e932a11cd68473b3496814b1aa47fc5bb35
c060d1c820e31694040512e6f97113193c26f7d9fea6bd9974798daff059feef
PIE_released_gem5_runtime
pie_15366
p02599
6da8b31eb2a645147353bc45a7902e3ef0958002fb92169f20282dfba8dfea69
c060d1c820e31694040512e6f97113193c26f7d9fea6bd9974798daff059feef
0.194461
7.13702
4-8
92c2c33d22a3105260cb113bc3a48024981a64908f7224d17631fb790f3b8ac3
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using P = pair<int, int>; #define rep(i, n) for (ll i = 0; i < (ll)n; i++) #define ALL(x) (x).begin(), (x).end() #define MOD 1000000007 class Mo { public: vector<int> l, r, ord; vector<bool> is; int wid,...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using P = pair<int, int>; #define rep(i, n) for (ll i = 0; i < (ll)n; i++) #define ALL(x) (x).begin(), (x).end() #define MOD 1000000007 struct Mo { using F = function<void(int)>; vector<int> l, r, ord; i...
8169f553a548d85f7dbbf5270283a7e64aaefdfb1f7fdc519dfc00c409ed285e
b59753b4ff5afa1657b9256ab0654119aba3c98a4c0d787634982ea61fd8842f
0.175495
cpp
b59753b4ff5afa1657b9256ab0654119aba3c98a4c0d787634982ea61fd8842f
912a623de9bd994e64075e46ca730c90a4a8b2e3595a59e5cd6b63b25551bfbb
PIE_released_gem5_runtime
pie_1541
p01317
117fc838ea6191ecda423eb1415444d0fea6cefd9ed62062b1f98bd375bddaeb
912a623de9bd994e64075e46ca730c90a4a8b2e3595a59e5cd6b63b25551bfbb
0.367291
2.092885
2-4
c34805c4b9026b57afa17928168f53fa8e38575f5e1397c2e0bfb95c410293c7
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cs...
#include <iostream> #include <algorithm> #include <functional> #include <cstdlib> #include <sstream> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <complex> #include <vector> #include <cstdio> #include <cmath> #include <utility> #define rep(i...
b16e8e28712cf1a196afc6f5f3ebaf9b2f3e8bd85802bae5368989c94ecb49dd
5914af713e344d5daad54082a5721533075501d6363fd3be2e108b21c9aad569
0.045539
cpp
5914af713e344d5daad54082a5721533075501d6363fd3be2e108b21c9aad569
77cc56601c27e8bba731131f864c47542e2f81f9ad8771bcc3d7189f19a977df
PIE_released_gem5_runtime
pie_15421
p03963
fdfcb703e3314764a0bf11e786d5135cedae60bb41feb6a8b6ee8268893f37b5
77cc56601c27e8bba731131f864c47542e2f81f9ad8771bcc3d7189f19a977df
0.434626
9.544009
8+
b12824074a64778124d52a1eff8a7e3670b1dd35b8c2e542bd63f49410431777
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; #define ff first #define ss second #define mp make_pair #define pb push_back #define all(x) (x).begin(), (x).end() #define FastIO ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; n -= 1; unsigned long long ans = k; while (n--) { ans *= k - 1; } cout << ans; }
7d1971fcfb64065eae684a230bf52875edfe9222afd2f120f7f7f0458356f221
009c50122c1c30322cc0487378c4b120038a665b28a18ac2a51c944574cd419f
0.019958
cpp
009c50122c1c30322cc0487378c4b120038a665b28a18ac2a51c944574cd419f
ba95cbb603a144ed8fee94fe847635d54ed34a404b2c997602ef59491df440eb
PIE_released_gem5_runtime
pie_15433
p03265
e9a41d41fbe5c9d0eea47d7a58403b13d401e555172f1727971e1151eb804488
ba95cbb603a144ed8fee94fe847635d54ed34a404b2c997602ef59491df440eb
0.358865
17.980773
8+
32b20b08b66041b91b56894d27b2a7bbfe1e86923900ccde6cc6da81c1a42fe8
#include <iostream> using namespace std; struct node { int x, y; int len; node(){}; node(int xx, int yy) { x = xx; y = yy; len = x * x + y * y; } bool judge(node t) { if (t.len == len && (x * t.y - y * t.x) > 0 && (t.x * x + t.y * y) == 0) return 1; else return 0;...
#include <stdio.h> int main() { int x1, y1, x2, y2, x3, y3, x4, y4, d1, d2; scanf("%d %d %d %d", &x1, &y1, &x2, &y2); d1 = x2 - x1; d2 = y1 - y2; x3 = x2 + d2; y3 = y2 + d1; x4 = x1 + d2; y4 = y1 + d1; printf("%d %d %d %d\n", x3, y3, x4, y4); return 0; }
5d9c089b52675b6cf17c3057365aa376e3ad175f93a04ef09c8c9b67163446ab
6eb2f4198ca2d47d3a3eb619a04b310c5b6850ee0785e932d587a332fefb1e3b
0.010342
cpp
6eb2f4198ca2d47d3a3eb619a04b310c5b6850ee0785e932d587a332fefb1e3b
74b2814bcb9be109d10f857baf669e8893312701374cb50c07829ea9d6b3c327
PIE_released_gem5_runtime
pie_15438
p02763
be4a8645a21f9c319c3f207c7914e70edbd3bed1f1d6a433f68c59f5373c7172
74b2814bcb9be109d10f857baf669e8893312701374cb50c07829ea9d6b3c327
0.043838
4.23869
4-8
1be0c6d6969b181a4072f778ea02145ee41a82efc51bce3109e6cc37903461f6
#include <vector> #include <bitset> #include <iostream> using B = std::bitset<32>; int main() { int N; std::cin >> N; int S[500000]; for (int i = 0; i < N; ++i) { char c; std::cin >> c; S[i] = 1 << (c - 'a'); } int Q; std::cin >> Q; while (Q--) { int q; std::cin >> q...
#include <vector> #include <bitset> #include <cstdio> using B = std::bitset<32>; int main() { int N; scanf("%d\n", &N); int S[500000]; for (int i = 0; i < N; ++i) { char c; scanf("%c", &c); S[i] = 1 << (c - 'a'); } int Q; scanf("\n%d\n", &Q); while (Q--) { int q; sca...
a34a9fbff0ac624c33c17ae03375450aff57d807f83e48abf0f92e5b084db7ae
b9cf4c049466fc15bae4d5957080b0bde9ac5117f5c3d4cf431de574e57f99e6
0.038225
cpp
b9cf4c049466fc15bae4d5957080b0bde9ac5117f5c3d4cf431de574e57f99e6
e3e6f29bfd49755cf1543466c48dbeacb3ddb9fab231d8ecb15b01657265b8b3
PIE_released_gem5_runtime
pie_15454
p03699
17db6b4591c28201b77c182050b30aef2ae34ccb87d77bb4dae137a356f21e79
e3e6f29bfd49755cf1543466c48dbeacb3ddb9fab231d8ecb15b01657265b8b3
0.354739
9.280175
8+
5661a4cad28ffad97af4cbc2479a7731f899416db59f7435cd79ba9c3dd7969f
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define MOD 1000000007 #define ll long long int #...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define MOD 1000000007 #define ll long long int #...