//
#ifndef __SIZEOF_INT128__
#define __SIZEOF_INT128__
#endif
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
template <typename T> using oset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define rep(i, p, k) for(int i(p); i < (k); ++i)
#define per(i, p, k) for(int i(p); i > (k); --i)
#define sz(x) (int)(x).size()
#define sc static_cast
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef __int128_t lll;
//#define int ll
template <typename T = int> using par = std::pair <T, T>;
#define fi first
#define se second
#define test int _number_of_tests(in()); while(_number_of_tests--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb emplace_back
struct Timer {
string name{""};
time_point<high_resolution_clock> end, start{high_resolution_clock::now()};
duration<float, std::milli> dur;
Timer() = default;
Timer(string nm): name(nm) {}
~Timer() {
end = high_resolution_clock::now(); dur= end - start;
cout << "@" << name << "> " << dur.count() << " ms" << '\n';
}
};
template <typename T = int> inline T in()
{
static T x;
std::cin >> x;
return x;
}
std::string yn(bool b)
{
if(b) return "YES\n";
else return "NO\n";
}
template <typename F, typename S> std::ostream& operator<<(std::ostream& out, const std::pair <F, S>& par);
template <typename T> std::ostream& operator<< (std::ostream& out, const std::vector <T>& wek)
{
for(const auto& i : wek)out << i << ' ';
return out;
}
template <typename F, typename S> std::ostream& operator<<(std::ostream& out, const std::pair <F, S>& par)
{
out << '{'<<par.first<<", "<<par.second<<"}";
return out;
}
#define show(x) cerr << #x << " = " << x << '\n';
#include "parks.h"
constexpr int maxn =2e5 + 3;
int rep[maxn];
int find(int w)
{
if(!rep[w])return w;
return rep[w] = find(rep[w]);
}
int uni_c(0);
void uni(int a, int b){
a = find(a); b = find(b);
if(a != b){
rep[a] = b;
++uni_c;
}
}
vector <pair <int, int>> graf[maxn];
bool byl[maxn];
int construct_roads(vector <int> x, vector <int> y)
{
int n(sz(x));
map <pair <int, int>, int> s;
rep(i, 0, n)s[{x[i], y[i]}] = i+1;
int m(0);
map <pair <pair <int, int>, pair <int, int>>, int> k;
vector <pair <pair <int, int>, pair <int, int>>> lk;
vector <pair <int, int>> dld;
rep(i, 0, n){
if(s.count({x[i]+2, y[i]})){
uni(i+1, s[{x[i]+2, y[i]}]);
k[{{x[i],y[i]},{x[i]+2, y[i]}}] = ++m;
lk.push_back({{x[i],y[i]},{x[i]+2, y[i]}});
dld.pb(i, s[{x[i]+2, y[i]}]-1);
}
if(s.count({x[i], y[i]+2})){
uni(i+1, s[{x[i], y[i]+2}]);
k[{{x[i],y[i]},{x[i], y[i]+2}}] = ++m;
lk.push_back({{x[i],y[i]},{x[i], y[i]+2}});
dld.pb(i, s[{x[i], y[i]+2}]-1);
}
}
if(uni_c != n-1)return 0;
vector <pair <int, int>> v;
map <pair <int, int>, int> nm;
rep(i, 0, n) if(s.count({x[i]+2, y[i]}) && s.count({x[i], y[i]+2}) && s.count({x[i]+2, y[i]+2})){
v.pb(x[i]+1, y[i]+1);
nm[{x[i]+1, y[i]+1}] = sz(v);
}
rep(i, 0, sz(v)){
auto [x, y] = v[i];
if((x/2 + y/2) % 2){
graf[i+1].pb(nm[{x-2, y}], k[{{x-1, y-1}, {x-1, y+1}}]);
graf[i+1].pb(nm[{x+2, y}], k[{{x+1, y-1}, {x+1, y+1}}]);
graf[nm[{x, y-2}]].pb(i+1, k[{{x-1, y-1}, {x+1, y-1}}]);
graf[nm[{x, y+2}]].pb(i+1, k[{{x-1, y+1}, {x+1, y+1}}]);
}
else{
graf[i+1].pb(nm[{x, y-2}], k[{{x-1, y-1}, {x+1, y-1}}]);
graf[i+1].pb(nm[{x, y+2}], k[{{x-1, y+1}, {x+1, y+1}}]);
graf[nm[{x-2, y}]].pb(i+1, k[{{x-1, y-1}, {x-1, y+1}}]);
graf[nm[{x+2, y}]].pb(i+1, k[{{x+1, y-1}, {x+1, y+1}}]);
}
}
// rep(i, 0, sz(v)+1)for(auto [j, kk]: graf[i])cout << (i ? v[i-1] : pair<int, int>{-1, -1} ) << ' ' << (j ? v[j-1] : pair<int, int>{-1,-1}) << ' ' << lk[kk-1] << '\n';
stack <int> dfs; dfs.push(0);
vector <bool> us(sz(lk));
byl[0] = 1;
while(dfs.size()){
int w(dfs.top()); dfs.pop();
for(auto [i, j]: graf[w])if(!byl[i]){
byl[i] = 1;
dfs.push(i);
us[j-1] = 1;
}
}
vector <int> ru, rv, ra, rb;
rep(i, 0, sz(lk))if(!us[i]){
auto [a, b] = dld[i];
ru.pb(a);
rv.pb(b);
if(x[a] == x[b]){
if((x[a]/2 + y[a]/2) % 2){
ra.pb(x[a]-1);
rb.pb(y[a]+1);
}
else{
ra.pb(x[a]+1);
rb.pb(y[a]+1);
}
}
else{
if((x[a]/2 + y[a]/2) % 2){
ra.pb(x[a]+1);
rb.pb(y[a]+1);
}
else{
ra.pb(x[a]+1);
rb.pb(y[a]-1);
}
}
}
build(ru, rv, ra, rb);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
5040 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4952 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
182 ms |
27844 KB |
Output is correct |
10 |
Correct |
10 ms |
7480 KB |
Output is correct |
11 |
Correct |
57 ms |
17348 KB |
Output is correct |
12 |
Correct |
15 ms |
8424 KB |
Output is correct |
13 |
Correct |
39 ms |
12744 KB |
Output is correct |
14 |
Correct |
3 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
186 ms |
27744 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
5040 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4952 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
182 ms |
27844 KB |
Output is correct |
10 |
Correct |
10 ms |
7480 KB |
Output is correct |
11 |
Correct |
57 ms |
17348 KB |
Output is correct |
12 |
Correct |
15 ms |
8424 KB |
Output is correct |
13 |
Correct |
39 ms |
12744 KB |
Output is correct |
14 |
Correct |
3 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
186 ms |
27744 KB |
Output is correct |
17 |
Correct |
2 ms |
4952 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4952 KB |
Output is correct |
20 |
Correct |
4 ms |
4956 KB |
Output is correct |
21 |
Correct |
3 ms |
4956 KB |
Output is correct |
22 |
Correct |
2 ms |
4956 KB |
Output is correct |
23 |
Correct |
1137 ms |
86556 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
4 ms |
5464 KB |
Output is correct |
26 |
Correct |
5 ms |
5716 KB |
Output is correct |
27 |
Correct |
5 ms |
5980 KB |
Output is correct |
28 |
Correct |
275 ms |
36724 KB |
Output is correct |
29 |
Correct |
499 ms |
53176 KB |
Output is correct |
30 |
Correct |
707 ms |
68536 KB |
Output is correct |
31 |
Correct |
943 ms |
85424 KB |
Output is correct |
32 |
Correct |
2 ms |
4956 KB |
Output is correct |
33 |
Correct |
2 ms |
4956 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
3 ms |
5468 KB |
Output is correct |
44 |
Correct |
4 ms |
5724 KB |
Output is correct |
45 |
Correct |
182 ms |
27700 KB |
Output is correct |
46 |
Correct |
305 ms |
40020 KB |
Output is correct |
47 |
Correct |
306 ms |
40480 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
5040 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4952 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
182 ms |
27844 KB |
Output is correct |
10 |
Correct |
10 ms |
7480 KB |
Output is correct |
11 |
Correct |
57 ms |
17348 KB |
Output is correct |
12 |
Correct |
15 ms |
8424 KB |
Output is correct |
13 |
Correct |
39 ms |
12744 KB |
Output is correct |
14 |
Correct |
3 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
186 ms |
27744 KB |
Output is correct |
17 |
Correct |
2 ms |
4952 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4952 KB |
Output is correct |
20 |
Correct |
4 ms |
4956 KB |
Output is correct |
21 |
Correct |
3 ms |
4956 KB |
Output is correct |
22 |
Correct |
2 ms |
4956 KB |
Output is correct |
23 |
Correct |
1137 ms |
86556 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
4 ms |
5464 KB |
Output is correct |
26 |
Correct |
5 ms |
5716 KB |
Output is correct |
27 |
Correct |
5 ms |
5980 KB |
Output is correct |
28 |
Correct |
275 ms |
36724 KB |
Output is correct |
29 |
Correct |
499 ms |
53176 KB |
Output is correct |
30 |
Correct |
707 ms |
68536 KB |
Output is correct |
31 |
Correct |
943 ms |
85424 KB |
Output is correct |
32 |
Correct |
2 ms |
4956 KB |
Output is correct |
33 |
Correct |
2 ms |
4956 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
3 ms |
5468 KB |
Output is correct |
44 |
Correct |
4 ms |
5724 KB |
Output is correct |
45 |
Correct |
182 ms |
27700 KB |
Output is correct |
46 |
Correct |
305 ms |
40020 KB |
Output is correct |
47 |
Correct |
306 ms |
40480 KB |
Output is correct |
48 |
Correct |
2 ms |
4956 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
1 ms |
4956 KB |
Output is correct |
51 |
Correct |
3 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
4952 KB |
Output is correct |
53 |
Correct |
2 ms |
4956 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
1307 ms |
90124 KB |
Output is correct |
56 |
Correct |
2 ms |
4952 KB |
Output is correct |
57 |
Correct |
5 ms |
5724 KB |
Output is correct |
58 |
Correct |
28 ms |
7640 KB |
Output is correct |
59 |
Correct |
14 ms |
7640 KB |
Output is correct |
60 |
Correct |
530 ms |
46672 KB |
Output is correct |
61 |
Correct |
781 ms |
61516 KB |
Output is correct |
62 |
Correct |
1048 ms |
75444 KB |
Output is correct |
63 |
Correct |
1397 ms |
88884 KB |
Output is correct |
64 |
Correct |
2 ms |
5048 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
2 ms |
5180 KB |
Output is correct |
67 |
Correct |
451 ms |
50516 KB |
Output is correct |
68 |
Correct |
413 ms |
50476 KB |
Output is correct |
69 |
Correct |
465 ms |
50360 KB |
Output is correct |
70 |
Correct |
6 ms |
5724 KB |
Output is correct |
71 |
Correct |
9 ms |
6492 KB |
Output is correct |
72 |
Correct |
210 ms |
27804 KB |
Output is correct |
73 |
Correct |
378 ms |
40208 KB |
Output is correct |
74 |
Correct |
568 ms |
50620 KB |
Output is correct |
75 |
Correct |
570 ms |
55264 KB |
Output is correct |
76 |
Correct |
454 ms |
50512 KB |
Output is correct |
77 |
Correct |
7 ms |
5976 KB |
Output is correct |
78 |
Correct |
14 ms |
6744 KB |
Output is correct |
79 |
Correct |
229 ms |
28956 KB |
Output is correct |
80 |
Correct |
381 ms |
41912 KB |
Output is correct |
81 |
Correct |
612 ms |
53180 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
5040 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4952 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
182 ms |
27844 KB |
Output is correct |
10 |
Correct |
10 ms |
7480 KB |
Output is correct |
11 |
Correct |
57 ms |
17348 KB |
Output is correct |
12 |
Correct |
15 ms |
8424 KB |
Output is correct |
13 |
Correct |
39 ms |
12744 KB |
Output is correct |
14 |
Correct |
3 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
186 ms |
27744 KB |
Output is correct |
17 |
Correct |
2 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
5188 KB |
Output is correct |
19 |
Correct |
1 ms |
4956 KB |
Output is correct |
20 |
Correct |
486 ms |
51780 KB |
Output is correct |
21 |
Correct |
496 ms |
51432 KB |
Output is correct |
22 |
Correct |
473 ms |
52152 KB |
Output is correct |
23 |
Correct |
371 ms |
45500 KB |
Output is correct |
24 |
Correct |
168 ms |
22352 KB |
Output is correct |
25 |
Correct |
399 ms |
41016 KB |
Output is correct |
26 |
Correct |
402 ms |
40636 KB |
Output is correct |
27 |
Correct |
466 ms |
50620 KB |
Output is correct |
28 |
Correct |
450 ms |
50876 KB |
Output is correct |
29 |
Correct |
581 ms |
50428 KB |
Output is correct |
30 |
Correct |
549 ms |
50616 KB |
Output is correct |
31 |
Correct |
2 ms |
4956 KB |
Output is correct |
32 |
Correct |
25 ms |
8536 KB |
Output is correct |
33 |
Correct |
84 ms |
14160 KB |
Output is correct |
34 |
Correct |
467 ms |
52416 KB |
Output is correct |
35 |
Correct |
13 ms |
6872 KB |
Output is correct |
36 |
Correct |
69 ms |
14060 KB |
Output is correct |
37 |
Correct |
158 ms |
23236 KB |
Output is correct |
38 |
Correct |
166 ms |
24164 KB |
Output is correct |
39 |
Correct |
245 ms |
30628 KB |
Output is correct |
40 |
Correct |
326 ms |
39100 KB |
Output is correct |
41 |
Correct |
426 ms |
45528 KB |
Output is correct |
42 |
Correct |
529 ms |
51944 KB |
Output is correct |
43 |
Correct |
2 ms |
4956 KB |
Output is correct |
44 |
Correct |
1 ms |
4956 KB |
Output is correct |
45 |
Correct |
2 ms |
4956 KB |
Output is correct |
46 |
Correct |
1 ms |
4956 KB |
Output is correct |
47 |
Correct |
2 ms |
4956 KB |
Output is correct |
48 |
Correct |
1 ms |
4956 KB |
Output is correct |
49 |
Correct |
1 ms |
5044 KB |
Output is correct |
50 |
Correct |
2 ms |
5048 KB |
Output is correct |
51 |
Correct |
2 ms |
4956 KB |
Output is correct |
52 |
Correct |
1 ms |
4956 KB |
Output is correct |
53 |
Correct |
2 ms |
4956 KB |
Output is correct |
54 |
Correct |
3 ms |
5468 KB |
Output is correct |
55 |
Correct |
5 ms |
5724 KB |
Output is correct |
56 |
Correct |
177 ms |
27844 KB |
Output is correct |
57 |
Correct |
295 ms |
38976 KB |
Output is correct |
58 |
Correct |
290 ms |
40124 KB |
Output is correct |
59 |
Correct |
2 ms |
4952 KB |
Output is correct |
60 |
Correct |
2 ms |
5212 KB |
Output is correct |
61 |
Correct |
2 ms |
4956 KB |
Output is correct |
62 |
Correct |
399 ms |
50744 KB |
Output is correct |
63 |
Correct |
389 ms |
51816 KB |
Output is correct |
64 |
Correct |
398 ms |
50360 KB |
Output is correct |
65 |
Correct |
5 ms |
5724 KB |
Output is correct |
66 |
Correct |
9 ms |
6492 KB |
Output is correct |
67 |
Correct |
188 ms |
27696 KB |
Output is correct |
68 |
Correct |
335 ms |
41400 KB |
Output is correct |
69 |
Correct |
529 ms |
50756 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
5040 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4952 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
182 ms |
27844 KB |
Output is correct |
10 |
Correct |
10 ms |
7480 KB |
Output is correct |
11 |
Correct |
57 ms |
17348 KB |
Output is correct |
12 |
Correct |
15 ms |
8424 KB |
Output is correct |
13 |
Correct |
39 ms |
12744 KB |
Output is correct |
14 |
Correct |
3 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
186 ms |
27744 KB |
Output is correct |
17 |
Correct |
445 ms |
51128 KB |
Output is correct |
18 |
Correct |
494 ms |
51184 KB |
Output is correct |
19 |
Correct |
509 ms |
51540 KB |
Output is correct |
20 |
Correct |
654 ms |
57532 KB |
Output is correct |
21 |
Correct |
557 ms |
48608 KB |
Output is correct |
22 |
Correct |
2 ms |
5188 KB |
Output is correct |
23 |
Correct |
68 ms |
13232 KB |
Output is correct |
24 |
Correct |
32 ms |
8916 KB |
Output is correct |
25 |
Correct |
124 ms |
18760 KB |
Output is correct |
26 |
Correct |
285 ms |
30120 KB |
Output is correct |
27 |
Correct |
248 ms |
31064 KB |
Output is correct |
28 |
Correct |
348 ms |
38888 KB |
Output is correct |
29 |
Correct |
458 ms |
45064 KB |
Output is correct |
30 |
Correct |
574 ms |
50928 KB |
Output is correct |
31 |
Correct |
649 ms |
57236 KB |
Output is correct |
32 |
Correct |
592 ms |
55416 KB |
Output is correct |
33 |
Correct |
394 ms |
50620 KB |
Output is correct |
34 |
Correct |
6 ms |
5980 KB |
Output is correct |
35 |
Correct |
13 ms |
6728 KB |
Output is correct |
36 |
Correct |
208 ms |
29244 KB |
Output is correct |
37 |
Correct |
355 ms |
42976 KB |
Output is correct |
38 |
Correct |
559 ms |
53176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
4952 KB |
Output is correct |
2 |
Correct |
2 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
5040 KB |
Output is correct |
4 |
Correct |
2 ms |
4956 KB |
Output is correct |
5 |
Correct |
2 ms |
4956 KB |
Output is correct |
6 |
Correct |
2 ms |
4956 KB |
Output is correct |
7 |
Correct |
2 ms |
4952 KB |
Output is correct |
8 |
Correct |
2 ms |
4956 KB |
Output is correct |
9 |
Correct |
182 ms |
27844 KB |
Output is correct |
10 |
Correct |
10 ms |
7480 KB |
Output is correct |
11 |
Correct |
57 ms |
17348 KB |
Output is correct |
12 |
Correct |
15 ms |
8424 KB |
Output is correct |
13 |
Correct |
39 ms |
12744 KB |
Output is correct |
14 |
Correct |
3 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
186 ms |
27744 KB |
Output is correct |
17 |
Correct |
2 ms |
4952 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4952 KB |
Output is correct |
20 |
Correct |
4 ms |
4956 KB |
Output is correct |
21 |
Correct |
3 ms |
4956 KB |
Output is correct |
22 |
Correct |
2 ms |
4956 KB |
Output is correct |
23 |
Correct |
1137 ms |
86556 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
4 ms |
5464 KB |
Output is correct |
26 |
Correct |
5 ms |
5716 KB |
Output is correct |
27 |
Correct |
5 ms |
5980 KB |
Output is correct |
28 |
Correct |
275 ms |
36724 KB |
Output is correct |
29 |
Correct |
499 ms |
53176 KB |
Output is correct |
30 |
Correct |
707 ms |
68536 KB |
Output is correct |
31 |
Correct |
943 ms |
85424 KB |
Output is correct |
32 |
Correct |
2 ms |
4956 KB |
Output is correct |
33 |
Correct |
2 ms |
4956 KB |
Output is correct |
34 |
Correct |
2 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4956 KB |
Output is correct |
36 |
Correct |
2 ms |
4956 KB |
Output is correct |
37 |
Correct |
2 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
2 ms |
4956 KB |
Output is correct |
40 |
Correct |
2 ms |
4956 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
2 ms |
4956 KB |
Output is correct |
43 |
Correct |
3 ms |
5468 KB |
Output is correct |
44 |
Correct |
4 ms |
5724 KB |
Output is correct |
45 |
Correct |
182 ms |
27700 KB |
Output is correct |
46 |
Correct |
305 ms |
40020 KB |
Output is correct |
47 |
Correct |
306 ms |
40480 KB |
Output is correct |
48 |
Correct |
2 ms |
4956 KB |
Output is correct |
49 |
Correct |
2 ms |
4956 KB |
Output is correct |
50 |
Correct |
1 ms |
4956 KB |
Output is correct |
51 |
Correct |
3 ms |
4956 KB |
Output is correct |
52 |
Correct |
2 ms |
4952 KB |
Output is correct |
53 |
Correct |
2 ms |
4956 KB |
Output is correct |
54 |
Correct |
2 ms |
4956 KB |
Output is correct |
55 |
Correct |
1307 ms |
90124 KB |
Output is correct |
56 |
Correct |
2 ms |
4952 KB |
Output is correct |
57 |
Correct |
5 ms |
5724 KB |
Output is correct |
58 |
Correct |
28 ms |
7640 KB |
Output is correct |
59 |
Correct |
14 ms |
7640 KB |
Output is correct |
60 |
Correct |
530 ms |
46672 KB |
Output is correct |
61 |
Correct |
781 ms |
61516 KB |
Output is correct |
62 |
Correct |
1048 ms |
75444 KB |
Output is correct |
63 |
Correct |
1397 ms |
88884 KB |
Output is correct |
64 |
Correct |
2 ms |
5048 KB |
Output is correct |
65 |
Correct |
2 ms |
4956 KB |
Output is correct |
66 |
Correct |
2 ms |
5180 KB |
Output is correct |
67 |
Correct |
451 ms |
50516 KB |
Output is correct |
68 |
Correct |
413 ms |
50476 KB |
Output is correct |
69 |
Correct |
465 ms |
50360 KB |
Output is correct |
70 |
Correct |
6 ms |
5724 KB |
Output is correct |
71 |
Correct |
9 ms |
6492 KB |
Output is correct |
72 |
Correct |
210 ms |
27804 KB |
Output is correct |
73 |
Correct |
378 ms |
40208 KB |
Output is correct |
74 |
Correct |
568 ms |
50620 KB |
Output is correct |
75 |
Correct |
570 ms |
55264 KB |
Output is correct |
76 |
Correct |
454 ms |
50512 KB |
Output is correct |
77 |
Correct |
7 ms |
5976 KB |
Output is correct |
78 |
Correct |
14 ms |
6744 KB |
Output is correct |
79 |
Correct |
229 ms |
28956 KB |
Output is correct |
80 |
Correct |
381 ms |
41912 KB |
Output is correct |
81 |
Correct |
612 ms |
53180 KB |
Output is correct |
82 |
Correct |
2 ms |
4956 KB |
Output is correct |
83 |
Correct |
2 ms |
5188 KB |
Output is correct |
84 |
Correct |
1 ms |
4956 KB |
Output is correct |
85 |
Correct |
486 ms |
51780 KB |
Output is correct |
86 |
Correct |
496 ms |
51432 KB |
Output is correct |
87 |
Correct |
473 ms |
52152 KB |
Output is correct |
88 |
Correct |
371 ms |
45500 KB |
Output is correct |
89 |
Correct |
168 ms |
22352 KB |
Output is correct |
90 |
Correct |
399 ms |
41016 KB |
Output is correct |
91 |
Correct |
402 ms |
40636 KB |
Output is correct |
92 |
Correct |
466 ms |
50620 KB |
Output is correct |
93 |
Correct |
450 ms |
50876 KB |
Output is correct |
94 |
Correct |
581 ms |
50428 KB |
Output is correct |
95 |
Correct |
549 ms |
50616 KB |
Output is correct |
96 |
Correct |
2 ms |
4956 KB |
Output is correct |
97 |
Correct |
25 ms |
8536 KB |
Output is correct |
98 |
Correct |
84 ms |
14160 KB |
Output is correct |
99 |
Correct |
467 ms |
52416 KB |
Output is correct |
100 |
Correct |
13 ms |
6872 KB |
Output is correct |
101 |
Correct |
69 ms |
14060 KB |
Output is correct |
102 |
Correct |
158 ms |
23236 KB |
Output is correct |
103 |
Correct |
166 ms |
24164 KB |
Output is correct |
104 |
Correct |
245 ms |
30628 KB |
Output is correct |
105 |
Correct |
326 ms |
39100 KB |
Output is correct |
106 |
Correct |
426 ms |
45528 KB |
Output is correct |
107 |
Correct |
529 ms |
51944 KB |
Output is correct |
108 |
Correct |
2 ms |
4956 KB |
Output is correct |
109 |
Correct |
1 ms |
4956 KB |
Output is correct |
110 |
Correct |
2 ms |
4956 KB |
Output is correct |
111 |
Correct |
1 ms |
4956 KB |
Output is correct |
112 |
Correct |
2 ms |
4956 KB |
Output is correct |
113 |
Correct |
1 ms |
4956 KB |
Output is correct |
114 |
Correct |
1 ms |
5044 KB |
Output is correct |
115 |
Correct |
2 ms |
5048 KB |
Output is correct |
116 |
Correct |
2 ms |
4956 KB |
Output is correct |
117 |
Correct |
1 ms |
4956 KB |
Output is correct |
118 |
Correct |
2 ms |
4956 KB |
Output is correct |
119 |
Correct |
3 ms |
5468 KB |
Output is correct |
120 |
Correct |
5 ms |
5724 KB |
Output is correct |
121 |
Correct |
177 ms |
27844 KB |
Output is correct |
122 |
Correct |
295 ms |
38976 KB |
Output is correct |
123 |
Correct |
290 ms |
40124 KB |
Output is correct |
124 |
Correct |
2 ms |
4952 KB |
Output is correct |
125 |
Correct |
2 ms |
5212 KB |
Output is correct |
126 |
Correct |
2 ms |
4956 KB |
Output is correct |
127 |
Correct |
399 ms |
50744 KB |
Output is correct |
128 |
Correct |
389 ms |
51816 KB |
Output is correct |
129 |
Correct |
398 ms |
50360 KB |
Output is correct |
130 |
Correct |
5 ms |
5724 KB |
Output is correct |
131 |
Correct |
9 ms |
6492 KB |
Output is correct |
132 |
Correct |
188 ms |
27696 KB |
Output is correct |
133 |
Correct |
335 ms |
41400 KB |
Output is correct |
134 |
Correct |
529 ms |
50756 KB |
Output is correct |
135 |
Correct |
445 ms |
51128 KB |
Output is correct |
136 |
Correct |
494 ms |
51184 KB |
Output is correct |
137 |
Correct |
509 ms |
51540 KB |
Output is correct |
138 |
Correct |
654 ms |
57532 KB |
Output is correct |
139 |
Correct |
557 ms |
48608 KB |
Output is correct |
140 |
Correct |
2 ms |
5188 KB |
Output is correct |
141 |
Correct |
68 ms |
13232 KB |
Output is correct |
142 |
Correct |
32 ms |
8916 KB |
Output is correct |
143 |
Correct |
124 ms |
18760 KB |
Output is correct |
144 |
Correct |
285 ms |
30120 KB |
Output is correct |
145 |
Correct |
248 ms |
31064 KB |
Output is correct |
146 |
Correct |
348 ms |
38888 KB |
Output is correct |
147 |
Correct |
458 ms |
45064 KB |
Output is correct |
148 |
Correct |
574 ms |
50928 KB |
Output is correct |
149 |
Correct |
649 ms |
57236 KB |
Output is correct |
150 |
Correct |
592 ms |
55416 KB |
Output is correct |
151 |
Correct |
394 ms |
50620 KB |
Output is correct |
152 |
Correct |
6 ms |
5980 KB |
Output is correct |
153 |
Correct |
13 ms |
6728 KB |
Output is correct |
154 |
Correct |
208 ms |
29244 KB |
Output is correct |
155 |
Correct |
355 ms |
42976 KB |
Output is correct |
156 |
Correct |
559 ms |
53176 KB |
Output is correct |
157 |
Correct |
2 ms |
4956 KB |
Output is correct |
158 |
Correct |
2 ms |
4956 KB |
Output is correct |
159 |
Correct |
2 ms |
4952 KB |
Output is correct |
160 |
Correct |
2 ms |
4956 KB |
Output is correct |
161 |
Correct |
1744 ms |
93360 KB |
Output is correct |
162 |
Correct |
483 ms |
51800 KB |
Output is correct |
163 |
Correct |
707 ms |
78000 KB |
Output is correct |
164 |
Correct |
700 ms |
76976 KB |
Output is correct |
165 |
Correct |
1124 ms |
87684 KB |
Output is correct |
166 |
Correct |
1304 ms |
93780 KB |
Output is correct |
167 |
Correct |
183 ms |
24004 KB |
Output is correct |
168 |
Correct |
54 ms |
12984 KB |
Output is correct |
169 |
Correct |
167 ms |
26564 KB |
Output is correct |
170 |
Correct |
367 ms |
46348 KB |
Output is correct |
171 |
Correct |
558 ms |
58292 KB |
Output is correct |
172 |
Correct |
576 ms |
49544 KB |
Output is correct |
173 |
Correct |
717 ms |
58372 KB |
Output is correct |
174 |
Correct |
904 ms |
70580 KB |
Output is correct |
175 |
Correct |
1139 ms |
76252 KB |
Output is correct |
176 |
Correct |
1255 ms |
86964 KB |
Output is correct |
177 |
Correct |
1558 ms |
93884 KB |
Output is correct |