# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1094215 |
2024-09-29T03:08:33 Z |
8pete8 |
Two Dishes (JOI19_dishes) |
C++17 |
|
3558 ms |
183172 KB |
#include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<cassert>
#include<unordered_map>
#include<queue>
#include<cstdint>
#include<cstring>
#include<limits.h>
#include<cmath>
#include<set>
#include<algorithm>
#include<iomanip>
#include<numeric>
#include<bitset>
using namespace std;
#define ll long long
#define f first
#define s second
#define pii pair<int,int>
#define ppii pair<int,pii>
#define vi vector<int>
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define F(n) for(int i=0;i<n;i++)
#define lb lower_bound
#define ub upper_bound
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);
#pragma GCC optimize ("03,unroll-loops")
#define int long long
#define double long double
using namespace std;
const int mod = 998244353, mxn = 1e6+5, inf = 1e16, minf = -1e16, lg = 30;
//#undef int
int n, k, m, q;
void setIO(string name) {
ios_base::sync_with_stdio(0);
cin.tie(0);
freopen((name + ".in").c_str(), "r", stdin);
freopen((name + ".out").c_str(), "w", stdout);
}
pair<int,pii> v1[mxn+10], v2[mxn+10];
//time,before,point
struct seg {
int v[4*mxn+10], lazy1[4*mxn+10], lazy2[4*mxn+10];
void build(int l, int r, int pos) {
int mid = l + (r - l) / 2;
lazy2[pos] = minf;
if (l == r) return;
build(l, mid, pos * 2);
build(mid + 1, r, pos * 2 + 1);
}
void push(int l, int r, int pos) {
v[pos] = max(v[pos] + lazy1[pos], lazy2[pos]);
if (l != r) {
if (lazy2[pos * 2] != minf) lazy2[pos * 2] += lazy1[pos];
if (lazy2[pos * 2 + 1] != minf) lazy2[pos * 2 + 1] += lazy1[pos];
lazy1[pos * 2 + 1] += lazy1[pos];
lazy1[pos * 2] += lazy1[pos];
lazy2[pos * 2] = max(lazy2[pos * 2], lazy2[pos]);
lazy2[pos * 2 + 1] = max(lazy2[pos * 2 + 1], lazy2[pos]);
}
lazy2[pos] = minf;
lazy1[pos] = 0;
}
void updateadd(int l, int r, int ql, int qr, int val, int pos) {
push(l, r, pos);
if (l > qr || r < ql) return;
if (l >= ql && r <= qr) {
lazy1[pos] += val;
push(l, r, pos);
return;
}
int mid = l + (r - l) / 2;
updateadd(l, mid, ql, qr, val, pos * 2);
updateadd(mid + 1, r, ql, qr, val, pos * 2 + 1);
v[pos] = max(v[pos * 2], v[pos * 2 + 1]);
}
void updateset(int l, int r, int ql, int qr, int val, int pos) {
push(l, r, pos);
if (l > qr || r < ql) return;
if (l >= ql && r <= qr) {
lazy2[pos] = max(lazy2[pos], val);
push(l, r, pos);
return;
}
int mid = l + (r - l) / 2;
updateset(l, mid, ql, qr, val, pos * 2);
updateset(mid + 1, r, ql, qr, val, pos * 2 + 1);
v[pos] = max(v[pos * 2], v[pos * 2 + 1]);
}
int qry(int l, int r, int qpos, int pos) {
push(l, r, pos);
if (l == r) return v[pos];
int mid = l + (r - l) / 2;
if (qpos <= mid) return qry(l, mid, qpos, pos * 2);
return qry(mid + 1, r, qpos, pos * 2 + 1);
}
} t;
int getbound(int x, int add) {
int l = 0, r = n, pos = -1;
while (l <= r) {
int mid = l + (r - l) / 2;
if (v1[mid].f + add <= x) l = mid + 1, pos = max(pos, mid);
else r = mid - 1;
}
return pos;
}
int32_t main() {
fastio
//n^2 can use lazy seg to op
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> v1[i].f >> v1[i].s.f >> v1[i].s.s;
v1[i].f += v1[i-1].f;
}
for (int i = 1; i <= m; i++) {
cin >> v2[i].f >> v2[i].s.f >> v2[i].s.s;
v2[i].f += v2[i-1].f;
}
int ans1 = 0;
vector<pii> gap;
for (int i = 1; i <= n; i++) {
if (v1[i].f <= v1[i].s.f) {
gap.pb({v1[i].s.f - v1[i].f, i});
ans1 += v1[i].s.s;
}
}
t.build(0, n, 1);
sort(all(gap));
int cur = 0, bruh, where, x;
vector<int32_t> cut;
for (int j = 1; j <= m; j++) {
while (cur < gap.size() && gap[cur].f < v2[j].f) {
t.updateadd(0, n, 0, gap[cur].s - 1, -v1[gap[cur].s].s.s, 1);
if (v1[gap[cur].s].s.s < 0) cut.pb(gap[cur].s - 1);
cur++;
}
x = getbound(v2[j].s.f, v2[j].f);
if (x != -1) {
cut.pb(x);
t.updateadd(0, n, 0, x, v2[j].s.s, 1);
if (v2[j].s.s > 0) cut.pb(x);
}
for (auto i : cut) {
bruh = t.qry(0, n, i, 1);
t.updateset(0, n, i + 1, n, bruh, 1);
}
cut.clear();
}
t.push(0, n, 1);
cout << ans1 + t.v[1] << '\n';
}
/*
*/
Compilation message
dishes.cpp: In function 'int32_t main()':
dishes.cpp:152:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
152 | while (cur < gap.size() && gap[cur].f < v2[j].f) {
| ~~~~^~~~~~~~~~~~
dishes.cpp:149:24: warning: unused variable 'where' [-Wunused-variable]
149 | int cur = 0, bruh, where, x;
| ^~~~~
dishes.cpp: In function 'void setIO(std::string)':
dishes.cpp:47:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
47 | freopen((name + ".in").c_str(), "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dishes.cpp:48:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
48 | freopen((name + ".out").c_str(), "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
305 ms |
37764 KB |
Output is correct |
2 |
Correct |
334 ms |
38228 KB |
Output is correct |
3 |
Correct |
164 ms |
30664 KB |
Output is correct |
4 |
Correct |
246 ms |
34788 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
306 ms |
36036 KB |
Output is correct |
7 |
Correct |
55 ms |
11936 KB |
Output is correct |
8 |
Correct |
57 ms |
19472 KB |
Output is correct |
9 |
Correct |
151 ms |
31484 KB |
Output is correct |
10 |
Correct |
317 ms |
32708 KB |
Output is correct |
11 |
Correct |
129 ms |
25028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
352 KB |
Output is correct |
10 |
Correct |
0 ms |
352 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
352 KB |
Output is correct |
10 |
Correct |
0 ms |
352 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
852 KB |
Output is correct |
18 |
Correct |
2 ms |
604 KB |
Output is correct |
19 |
Correct |
5 ms |
732 KB |
Output is correct |
20 |
Correct |
2 ms |
604 KB |
Output is correct |
21 |
Correct |
3 ms |
604 KB |
Output is correct |
22 |
Correct |
3 ms |
600 KB |
Output is correct |
23 |
Correct |
3 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
352 KB |
Output is correct |
10 |
Correct |
0 ms |
352 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
852 KB |
Output is correct |
18 |
Correct |
2 ms |
604 KB |
Output is correct |
19 |
Correct |
5 ms |
732 KB |
Output is correct |
20 |
Correct |
2 ms |
604 KB |
Output is correct |
21 |
Correct |
3 ms |
604 KB |
Output is correct |
22 |
Correct |
3 ms |
600 KB |
Output is correct |
23 |
Correct |
3 ms |
600 KB |
Output is correct |
24 |
Correct |
211 ms |
35896 KB |
Output is correct |
25 |
Correct |
293 ms |
26104 KB |
Output is correct |
26 |
Correct |
164 ms |
36032 KB |
Output is correct |
27 |
Correct |
296 ms |
34388 KB |
Output is correct |
28 |
Correct |
252 ms |
35748 KB |
Output is correct |
29 |
Correct |
135 ms |
28616 KB |
Output is correct |
30 |
Correct |
507 ms |
36028 KB |
Output is correct |
31 |
Correct |
48 ms |
10320 KB |
Output is correct |
32 |
Correct |
99 ms |
25860 KB |
Output is correct |
33 |
Correct |
307 ms |
34084 KB |
Output is correct |
34 |
Correct |
409 ms |
35784 KB |
Output is correct |
35 |
Correct |
470 ms |
29640 KB |
Output is correct |
36 |
Correct |
459 ms |
29644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
352 KB |
Output is correct |
10 |
Correct |
0 ms |
352 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
852 KB |
Output is correct |
18 |
Correct |
2 ms |
604 KB |
Output is correct |
19 |
Correct |
5 ms |
732 KB |
Output is correct |
20 |
Correct |
2 ms |
604 KB |
Output is correct |
21 |
Correct |
3 ms |
604 KB |
Output is correct |
22 |
Correct |
3 ms |
600 KB |
Output is correct |
23 |
Correct |
3 ms |
600 KB |
Output is correct |
24 |
Correct |
211 ms |
35896 KB |
Output is correct |
25 |
Correct |
293 ms |
26104 KB |
Output is correct |
26 |
Correct |
164 ms |
36032 KB |
Output is correct |
27 |
Correct |
296 ms |
34388 KB |
Output is correct |
28 |
Correct |
252 ms |
35748 KB |
Output is correct |
29 |
Correct |
135 ms |
28616 KB |
Output is correct |
30 |
Correct |
507 ms |
36028 KB |
Output is correct |
31 |
Correct |
48 ms |
10320 KB |
Output is correct |
32 |
Correct |
99 ms |
25860 KB |
Output is correct |
33 |
Correct |
307 ms |
34084 KB |
Output is correct |
34 |
Correct |
409 ms |
35784 KB |
Output is correct |
35 |
Correct |
470 ms |
29640 KB |
Output is correct |
36 |
Correct |
459 ms |
29644 KB |
Output is correct |
37 |
Correct |
168 ms |
39100 KB |
Output is correct |
38 |
Correct |
309 ms |
37324 KB |
Output is correct |
39 |
Correct |
317 ms |
36284 KB |
Output is correct |
40 |
Correct |
315 ms |
36376 KB |
Output is correct |
41 |
Correct |
1 ms |
344 KB |
Output is correct |
42 |
Correct |
542 ms |
39112 KB |
Output is correct |
43 |
Correct |
323 ms |
37060 KB |
Output is correct |
44 |
Correct |
420 ms |
38592 KB |
Output is correct |
45 |
Correct |
510 ms |
32612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
352 KB |
Output is correct |
10 |
Correct |
0 ms |
352 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
852 KB |
Output is correct |
18 |
Correct |
2 ms |
604 KB |
Output is correct |
19 |
Correct |
5 ms |
732 KB |
Output is correct |
20 |
Correct |
2 ms |
604 KB |
Output is correct |
21 |
Correct |
3 ms |
604 KB |
Output is correct |
22 |
Correct |
3 ms |
600 KB |
Output is correct |
23 |
Correct |
3 ms |
600 KB |
Output is correct |
24 |
Correct |
211 ms |
35896 KB |
Output is correct |
25 |
Correct |
293 ms |
26104 KB |
Output is correct |
26 |
Correct |
164 ms |
36032 KB |
Output is correct |
27 |
Correct |
296 ms |
34388 KB |
Output is correct |
28 |
Correct |
252 ms |
35748 KB |
Output is correct |
29 |
Correct |
135 ms |
28616 KB |
Output is correct |
30 |
Correct |
507 ms |
36028 KB |
Output is correct |
31 |
Correct |
48 ms |
10320 KB |
Output is correct |
32 |
Correct |
99 ms |
25860 KB |
Output is correct |
33 |
Correct |
307 ms |
34084 KB |
Output is correct |
34 |
Correct |
409 ms |
35784 KB |
Output is correct |
35 |
Correct |
470 ms |
29640 KB |
Output is correct |
36 |
Correct |
459 ms |
29644 KB |
Output is correct |
37 |
Correct |
168 ms |
39100 KB |
Output is correct |
38 |
Correct |
309 ms |
37324 KB |
Output is correct |
39 |
Correct |
317 ms |
36284 KB |
Output is correct |
40 |
Correct |
315 ms |
36376 KB |
Output is correct |
41 |
Correct |
1 ms |
344 KB |
Output is correct |
42 |
Correct |
542 ms |
39112 KB |
Output is correct |
43 |
Correct |
323 ms |
37060 KB |
Output is correct |
44 |
Correct |
420 ms |
38592 KB |
Output is correct |
45 |
Correct |
510 ms |
32612 KB |
Output is correct |
46 |
Correct |
908 ms |
181464 KB |
Output is correct |
47 |
Correct |
1619 ms |
173748 KB |
Output is correct |
48 |
Correct |
1707 ms |
168244 KB |
Output is correct |
49 |
Correct |
1755 ms |
168092 KB |
Output is correct |
50 |
Correct |
3479 ms |
181308 KB |
Output is correct |
51 |
Correct |
1867 ms |
168704 KB |
Output is correct |
52 |
Correct |
2555 ms |
174848 KB |
Output is correct |
53 |
Correct |
3318 ms |
150684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
305 ms |
37764 KB |
Output is correct |
2 |
Correct |
334 ms |
38228 KB |
Output is correct |
3 |
Correct |
164 ms |
30664 KB |
Output is correct |
4 |
Correct |
246 ms |
34788 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
306 ms |
36036 KB |
Output is correct |
7 |
Correct |
55 ms |
11936 KB |
Output is correct |
8 |
Correct |
57 ms |
19472 KB |
Output is correct |
9 |
Correct |
151 ms |
31484 KB |
Output is correct |
10 |
Correct |
317 ms |
32708 KB |
Output is correct |
11 |
Correct |
129 ms |
25028 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
352 KB |
Output is correct |
21 |
Correct |
0 ms |
352 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
2 ms |
852 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
5 ms |
732 KB |
Output is correct |
31 |
Correct |
2 ms |
604 KB |
Output is correct |
32 |
Correct |
3 ms |
604 KB |
Output is correct |
33 |
Correct |
3 ms |
600 KB |
Output is correct |
34 |
Correct |
3 ms |
600 KB |
Output is correct |
35 |
Correct |
211 ms |
35896 KB |
Output is correct |
36 |
Correct |
293 ms |
26104 KB |
Output is correct |
37 |
Correct |
164 ms |
36032 KB |
Output is correct |
38 |
Correct |
296 ms |
34388 KB |
Output is correct |
39 |
Correct |
252 ms |
35748 KB |
Output is correct |
40 |
Correct |
135 ms |
28616 KB |
Output is correct |
41 |
Correct |
507 ms |
36028 KB |
Output is correct |
42 |
Correct |
48 ms |
10320 KB |
Output is correct |
43 |
Correct |
99 ms |
25860 KB |
Output is correct |
44 |
Correct |
307 ms |
34084 KB |
Output is correct |
45 |
Correct |
409 ms |
35784 KB |
Output is correct |
46 |
Correct |
470 ms |
29640 KB |
Output is correct |
47 |
Correct |
459 ms |
29644 KB |
Output is correct |
48 |
Correct |
168 ms |
39100 KB |
Output is correct |
49 |
Correct |
309 ms |
37324 KB |
Output is correct |
50 |
Correct |
317 ms |
36284 KB |
Output is correct |
51 |
Correct |
315 ms |
36376 KB |
Output is correct |
52 |
Correct |
1 ms |
344 KB |
Output is correct |
53 |
Correct |
542 ms |
39112 KB |
Output is correct |
54 |
Correct |
323 ms |
37060 KB |
Output is correct |
55 |
Correct |
420 ms |
38592 KB |
Output is correct |
56 |
Correct |
510 ms |
32612 KB |
Output is correct |
57 |
Correct |
232 ms |
39360 KB |
Output is correct |
58 |
Correct |
222 ms |
37828 KB |
Output is correct |
59 |
Correct |
265 ms |
37380 KB |
Output is correct |
60 |
Correct |
380 ms |
37392 KB |
Output is correct |
61 |
Correct |
422 ms |
36040 KB |
Output is correct |
62 |
Correct |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
514 ms |
39096 KB |
Output is correct |
64 |
Correct |
317 ms |
37064 KB |
Output is correct |
65 |
Correct |
458 ms |
38564 KB |
Output is correct |
66 |
Correct |
502 ms |
32716 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
305 ms |
37764 KB |
Output is correct |
2 |
Correct |
334 ms |
38228 KB |
Output is correct |
3 |
Correct |
164 ms |
30664 KB |
Output is correct |
4 |
Correct |
246 ms |
34788 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
306 ms |
36036 KB |
Output is correct |
7 |
Correct |
55 ms |
11936 KB |
Output is correct |
8 |
Correct |
57 ms |
19472 KB |
Output is correct |
9 |
Correct |
151 ms |
31484 KB |
Output is correct |
10 |
Correct |
317 ms |
32708 KB |
Output is correct |
11 |
Correct |
129 ms |
25028 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
352 KB |
Output is correct |
21 |
Correct |
0 ms |
352 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
2 ms |
852 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
5 ms |
732 KB |
Output is correct |
31 |
Correct |
2 ms |
604 KB |
Output is correct |
32 |
Correct |
3 ms |
604 KB |
Output is correct |
33 |
Correct |
3 ms |
600 KB |
Output is correct |
34 |
Correct |
3 ms |
600 KB |
Output is correct |
35 |
Correct |
211 ms |
35896 KB |
Output is correct |
36 |
Correct |
293 ms |
26104 KB |
Output is correct |
37 |
Correct |
164 ms |
36032 KB |
Output is correct |
38 |
Correct |
296 ms |
34388 KB |
Output is correct |
39 |
Correct |
252 ms |
35748 KB |
Output is correct |
40 |
Correct |
135 ms |
28616 KB |
Output is correct |
41 |
Correct |
507 ms |
36028 KB |
Output is correct |
42 |
Correct |
48 ms |
10320 KB |
Output is correct |
43 |
Correct |
99 ms |
25860 KB |
Output is correct |
44 |
Correct |
307 ms |
34084 KB |
Output is correct |
45 |
Correct |
409 ms |
35784 KB |
Output is correct |
46 |
Correct |
470 ms |
29640 KB |
Output is correct |
47 |
Correct |
459 ms |
29644 KB |
Output is correct |
48 |
Correct |
168 ms |
39100 KB |
Output is correct |
49 |
Correct |
309 ms |
37324 KB |
Output is correct |
50 |
Correct |
317 ms |
36284 KB |
Output is correct |
51 |
Correct |
315 ms |
36376 KB |
Output is correct |
52 |
Correct |
1 ms |
344 KB |
Output is correct |
53 |
Correct |
542 ms |
39112 KB |
Output is correct |
54 |
Correct |
323 ms |
37060 KB |
Output is correct |
55 |
Correct |
420 ms |
38592 KB |
Output is correct |
56 |
Correct |
510 ms |
32612 KB |
Output is correct |
57 |
Correct |
908 ms |
181464 KB |
Output is correct |
58 |
Correct |
1619 ms |
173748 KB |
Output is correct |
59 |
Correct |
1707 ms |
168244 KB |
Output is correct |
60 |
Correct |
1755 ms |
168092 KB |
Output is correct |
61 |
Correct |
3479 ms |
181308 KB |
Output is correct |
62 |
Correct |
1867 ms |
168704 KB |
Output is correct |
63 |
Correct |
2555 ms |
174848 KB |
Output is correct |
64 |
Correct |
3318 ms |
150684 KB |
Output is correct |
65 |
Correct |
232 ms |
39360 KB |
Output is correct |
66 |
Correct |
222 ms |
37828 KB |
Output is correct |
67 |
Correct |
265 ms |
37380 KB |
Output is correct |
68 |
Correct |
380 ms |
37392 KB |
Output is correct |
69 |
Correct |
422 ms |
36040 KB |
Output is correct |
70 |
Correct |
0 ms |
348 KB |
Output is correct |
71 |
Correct |
514 ms |
39096 KB |
Output is correct |
72 |
Correct |
317 ms |
37064 KB |
Output is correct |
73 |
Correct |
458 ms |
38564 KB |
Output is correct |
74 |
Correct |
502 ms |
32716 KB |
Output is correct |
75 |
Correct |
1288 ms |
183172 KB |
Output is correct |
76 |
Correct |
1251 ms |
175332 KB |
Output is correct |
77 |
Correct |
1395 ms |
170808 KB |
Output is correct |
78 |
Correct |
2129 ms |
170804 KB |
Output is correct |
79 |
Correct |
3558 ms |
182044 KB |
Output is correct |
80 |
Correct |
1936 ms |
169904 KB |
Output is correct |
81 |
Correct |
2496 ms |
174492 KB |
Output is correct |
82 |
Correct |
3319 ms |
150176 KB |
Output is correct |
83 |
Correct |
3318 ms |
169888 KB |
Output is correct |