#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx,avx2,fma")
#include"bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class x>
using ordered_set = tree<x, null_type,less<x>, rb_tree_tag,tree_order_statistics_node_update>;
#define int long long
#define endl '\n'
#define mod 1000000007
//\
#define mod 1686876991
#define MN -1000000001
const int maxn = 150001;
const int dx[] = {-1, 1, 0, 0, 1, 1, -1, -1};
const int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1};
// 0 4 6 2 3 5 1 7 0 1 2 3 4 5 6 7
const int roundx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int roundy[] = {0, 1, 1, 1, 0, -1, -1, -1};
int ddd[] = {0,4,6,2,3,5,1,7};
struct cell {int x, y, id;};
struct neal {
static uint64_t splitmix64(uint64_t x)
{
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const
{
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
// #define HASH(a,b) (1000000000ll*b+a)
long long HASH (int a, int b) {
return (long long)a + 1000000000ll*b;
}
int n, t, ID = 0, buf;
int x[maxn], y[maxn];
cell cells[maxn];
int dsu[4 * maxn];
vector<pair<int,int>> vec[4 * maxn];
bool out[4 * maxn];
bool FF[4*maxn][8];
pair<int,int> mp[4 * maxn];
unordered_set<long long> S;
unordered_map<int,int> Empty, Full; // maps cell to dsu
set<cell> active, expendable;
bool operator < (const cell& a, const cell& b) {
return a.id > b.id;
}
int Find (int x) {
return dsu[x] == x ? x : dsu[x] = Find(dsu[x]);
}
void check (const cell &c) {
auto [u, v, id] = c;
int prev = -1;
bool artic = 0, sep = 0;
vector<int> to_reset;
bool isout = 0;
for (int d = 0 ; d < 4 ; d++) {
int u2 = u + dx[d];
int v2 = v + dy[d];
if (Empty.count(HASH(u2,v2))) {
int cmp = Find(Empty[HASH(u2,v2)]);
if (out[cmp]) isout = 1;
}
}
if (!isout) {expendable.erase(c);return;}
for (int d = 0 ; d < 8 ; d++) {
int u2 = u + roundx[d];
int v2 = v + roundy[d];
if (S.count(HASH(u2,v2))) FF[id][d] = 1;
else FF[id][d] = 0;
}
for (int w = 0 ; w < 9 ; w++) {
int d = w%8;
int u2 = u + roundx[d];
int v2 = v + roundy[d];
if (FF[id][d]) sep = 1;
else {
if (d & 1) {
continue;
}
int cmp = Find(Empty[HASH(u2,v2)]);
if (mp[cmp].first != MN and sep == 1) {
auto [pu, pv] = mp[cmp];
bool bad = 0;
for (int ww = w ; ; ww++) {
int d2 = ww % 8;
int u3 = u + roundx[d2];
int v3 = v + roundy[d2];
if (u3 == pu and v3 == pv) {
break;
}
else {
if (FF[id][d2]) {
bad = 1;
break;
}
}
}
if (bad) artic = 1;
}
mp[cmp] = {u2, v2};
to_reset.push_back(cmp);
sep = 0;
prev = cmp;
}
}
for (int cmp : to_reset) {
mp[cmp] = {MN,-1};
}
if (isout and !artic) expendable.insert(c);
else expendable.erase(c);
}
void Union (int a, int b) {
int x = Find(a), y = Find(b);
if (x == y) return;
if (vec[x].size() < vec[y].size()) {
out[y] |= out[x];
dsu[x] = y;
for (auto [u, v] : vec[x]) {
vec[y].push_back({u, v});
for (int d = 0 ; d < 8 ; d++) {
if (Full.count(HASH(u + dx[d],v + dy[d]))) check(cells[Full[HASH(u + dx[d],v + dy[d])]]);
}
}
vec[x].clear();
} else {
out[x] |= out[y];
dsu[y] = x;
for (auto [u, v] : vec[y]) {
vec[x].push_back({u, v});
for (int d = 0 ; d < 8 ; d++) {
if (Full.count(HASH(u + dx[d],v + dy[d]))) check(cells[Full[HASH(u + dx[d],v + dy[d])]]);
}
}
vec[y].clear();
}
}
signed main () {
cin.tie(0)->sync_with_stdio(0);
Empty.reserve(4*262144);
Full.reserve(4*262144);
Empty.max_load_factor(0.25);
Full.max_load_factor(0.25);
cin >> n >> t;
for (auto& [i, j] : mp) i = j = MN;
for (int i = 0 ; i < n ; i++) {
cin >> x[i] >> y[i];
cells[i] = {x[i], y[i], i};
Full[HASH(x[i],y[i])] = i;
S.insert(HASH(x[i], y[i]));
active.insert(cells[i]);
}
if (n > 1) {
for (int i = 0 ; i < n ; i++) {
bool good = 0;
for (int d = 0 ; d < 8 ; d++) {
int u = x[i] + dx[d];
int v = y[i] + dy[d];
good |= Full.count(HASH(u,v));
}
if (!good) {
cout << "NO\n";
return 0;
}
}
}
/* set at leat one node as out (for reference) */ {
pair<int,int> mn = {x[0], y[0]};
for (int i = 0 ; i < n ; i++) {
mn = min(mn, {x[i], y[i]});
}
auto [u, v] = mn; u--;
int id = Empty[HASH(u,v)] = ID++;
dsu[id] = id;
vec[id].push_back({u, v});
out[id] = 1;
}
for (int i = 0 ; i < n ; i++) {
for (int d = 0 ; d < 8 ; d++) {
int u = x[i] + dx[d];
int v = y[i] + dy[d];
if (!S.count(HASH(u,v)) and !Empty.count(HASH(u,v))) {
int id = Empty[HASH(u,v)] = ID++;
dsu[id] = id;
vec[id].push_back({u, v});
}
}
}
for (int i = 0 ; i < n ; i++) {
for (int d = 0 ; d < 8 ; d++) {
int u = x[i] + dx[d];
int v = y[i] + dy[d];
if (!S.count(HASH(u,v))) {
for (int d2 = 0 ; d2 < 4 ; d2++) {
int u2 = u + dx[d2];
int v2 = v + dy[d2];
if (Empty.count(HASH(u2,v2))) {
Union(Empty[HASH(u,v)], Empty[HASH(u2,v2)]);
}
}
} else {
FF[Full[HASH(u, v)]][ddd[d]] = 1;
}
}
}
for (int i = 0 ; i < n ; i++) check(cells[i]);
cout << "YES\n";
vector<int> ans;
while (expendable.size()) {
auto [a, b, c] = *expendable.begin();
expendable.erase(expendable.begin());
ans.push_back(c + 1);
Full.erase(HASH(a,b));
S.erase(HASH(a, b));
int id = Empty[HASH(a,b)] = ID++;
dsu[id] = id;
vec[id].push_back({a, b});
for (int d = 0 ; d < 4 ; d++) {
int u = a + dx[d];
int v = b + dy[d];
if (Empty.count(HASH(u,v))) {
Union(Empty[HASH(u,v)], id);
}
}
for (int d = 0 ; d < 8 ; d++) {
int u = a + dx[d];
int v = b + dy[d];
if (S.count(HASH(u,v))) {
FF[Full[HASH(u, v)]][ddd[d]] = 0;
}
}
for (int d = 0 ; d < 8 ; d++) {
int u = a + dx[d];
int v = b + dy[d];
if (S.count(HASH(u,v))) {
check(cells[Full[HASH(u,v)]]);
}
}
}
reverse(ans.begin(), ans.end());
for (int i : ans) cout << i << "\n";
}
Compilation message
skyscrapers.cpp:17:1: warning: multi-line comment [-Wcomment]
17 | //\
| ^
skyscrapers.cpp: In function 'void check(const cell&)':
skyscrapers.cpp:75:9: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
75 | int prev = -1;
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
40276 KB |
ans=YES N=1 |
2 |
Correct |
26 ms |
40404 KB |
ans=YES N=4 |
3 |
Correct |
22 ms |
40352 KB |
ans=NO N=4 |
4 |
Correct |
26 ms |
40332 KB |
ans=YES N=5 |
5 |
Correct |
23 ms |
40360 KB |
ans=YES N=9 |
6 |
Correct |
22 ms |
40368 KB |
ans=YES N=5 |
7 |
Correct |
22 ms |
40276 KB |
ans=NO N=9 |
8 |
Correct |
23 ms |
40344 KB |
ans=NO N=10 |
9 |
Correct |
24 ms |
40404 KB |
ans=YES N=10 |
10 |
Correct |
23 ms |
40384 KB |
ans=YES N=10 |
11 |
Correct |
23 ms |
40340 KB |
ans=YES N=10 |
12 |
Correct |
29 ms |
40316 KB |
ans=YES N=9 |
13 |
Correct |
24 ms |
40404 KB |
ans=YES N=9 |
14 |
Correct |
38 ms |
40328 KB |
ans=YES N=8 |
15 |
Correct |
22 ms |
40404 KB |
ans=YES N=8 |
16 |
Correct |
23 ms |
40348 KB |
ans=NO N=2 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
40276 KB |
ans=YES N=1 |
2 |
Correct |
26 ms |
40404 KB |
ans=YES N=4 |
3 |
Correct |
22 ms |
40352 KB |
ans=NO N=4 |
4 |
Correct |
26 ms |
40332 KB |
ans=YES N=5 |
5 |
Correct |
23 ms |
40360 KB |
ans=YES N=9 |
6 |
Correct |
22 ms |
40368 KB |
ans=YES N=5 |
7 |
Correct |
22 ms |
40276 KB |
ans=NO N=9 |
8 |
Correct |
23 ms |
40344 KB |
ans=NO N=10 |
9 |
Correct |
24 ms |
40404 KB |
ans=YES N=10 |
10 |
Correct |
23 ms |
40384 KB |
ans=YES N=10 |
11 |
Correct |
23 ms |
40340 KB |
ans=YES N=10 |
12 |
Correct |
29 ms |
40316 KB |
ans=YES N=9 |
13 |
Correct |
24 ms |
40404 KB |
ans=YES N=9 |
14 |
Correct |
38 ms |
40328 KB |
ans=YES N=8 |
15 |
Correct |
22 ms |
40404 KB |
ans=YES N=8 |
16 |
Correct |
23 ms |
40348 KB |
ans=NO N=2 |
17 |
Correct |
22 ms |
40336 KB |
ans=YES N=17 |
18 |
Correct |
24 ms |
40300 KB |
ans=YES N=25 |
19 |
Correct |
23 ms |
40436 KB |
ans=YES N=100 |
20 |
Correct |
24 ms |
40404 KB |
ans=YES N=185 |
21 |
Correct |
24 ms |
40404 KB |
ans=NO N=174 |
22 |
Correct |
25 ms |
40348 KB |
ans=YES N=90 |
23 |
Correct |
24 ms |
40404 KB |
ans=YES N=63 |
24 |
Correct |
25 ms |
40344 KB |
ans=YES N=87 |
25 |
Correct |
24 ms |
40348 KB |
ans=YES N=183 |
26 |
Correct |
25 ms |
40404 KB |
ans=YES N=188 |
27 |
Correct |
27 ms |
40448 KB |
ans=YES N=183 |
28 |
Correct |
25 ms |
40432 KB |
ans=YES N=189 |
29 |
Correct |
24 ms |
40412 KB |
ans=YES N=200 |
30 |
Correct |
29 ms |
40476 KB |
ans=YES N=190 |
31 |
Correct |
26 ms |
40404 KB |
ans=YES N=187 |
32 |
Correct |
24 ms |
40380 KB |
ans=YES N=187 |
33 |
Correct |
24 ms |
40460 KB |
ans=YES N=182 |
34 |
Correct |
25 ms |
40504 KB |
ans=YES N=184 |
35 |
Correct |
25 ms |
40516 KB |
ans=YES N=188 |
36 |
Correct |
29 ms |
40476 KB |
ans=YES N=181 |
37 |
Correct |
26 ms |
40404 KB |
ans=YES N=188 |
38 |
Correct |
26 ms |
40404 KB |
ans=YES N=191 |
39 |
Correct |
25 ms |
40392 KB |
ans=YES N=196 |
40 |
Correct |
25 ms |
40404 KB |
ans=YES N=196 |
41 |
Correct |
24 ms |
40364 KB |
ans=YES N=196 |
42 |
Correct |
23 ms |
40404 KB |
ans=YES N=196 |
43 |
Correct |
26 ms |
40404 KB |
ans=YES N=195 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
40276 KB |
ans=YES N=1 |
2 |
Correct |
26 ms |
40404 KB |
ans=YES N=4 |
3 |
Correct |
22 ms |
40352 KB |
ans=NO N=4 |
4 |
Correct |
26 ms |
40332 KB |
ans=YES N=5 |
5 |
Correct |
23 ms |
40360 KB |
ans=YES N=9 |
6 |
Correct |
22 ms |
40368 KB |
ans=YES N=5 |
7 |
Correct |
22 ms |
40276 KB |
ans=NO N=9 |
8 |
Correct |
23 ms |
40344 KB |
ans=NO N=10 |
9 |
Correct |
24 ms |
40404 KB |
ans=YES N=10 |
10 |
Correct |
23 ms |
40384 KB |
ans=YES N=10 |
11 |
Correct |
23 ms |
40340 KB |
ans=YES N=10 |
12 |
Correct |
29 ms |
40316 KB |
ans=YES N=9 |
13 |
Correct |
24 ms |
40404 KB |
ans=YES N=9 |
14 |
Correct |
38 ms |
40328 KB |
ans=YES N=8 |
15 |
Correct |
22 ms |
40404 KB |
ans=YES N=8 |
16 |
Correct |
23 ms |
40348 KB |
ans=NO N=2 |
17 |
Correct |
22 ms |
40336 KB |
ans=YES N=17 |
18 |
Correct |
24 ms |
40300 KB |
ans=YES N=25 |
19 |
Correct |
23 ms |
40436 KB |
ans=YES N=100 |
20 |
Correct |
24 ms |
40404 KB |
ans=YES N=185 |
21 |
Correct |
24 ms |
40404 KB |
ans=NO N=174 |
22 |
Correct |
25 ms |
40348 KB |
ans=YES N=90 |
23 |
Correct |
24 ms |
40404 KB |
ans=YES N=63 |
24 |
Correct |
25 ms |
40344 KB |
ans=YES N=87 |
25 |
Correct |
24 ms |
40348 KB |
ans=YES N=183 |
26 |
Correct |
25 ms |
40404 KB |
ans=YES N=188 |
27 |
Correct |
27 ms |
40448 KB |
ans=YES N=183 |
28 |
Correct |
25 ms |
40432 KB |
ans=YES N=189 |
29 |
Correct |
24 ms |
40412 KB |
ans=YES N=200 |
30 |
Correct |
29 ms |
40476 KB |
ans=YES N=190 |
31 |
Correct |
26 ms |
40404 KB |
ans=YES N=187 |
32 |
Correct |
24 ms |
40380 KB |
ans=YES N=187 |
33 |
Correct |
24 ms |
40460 KB |
ans=YES N=182 |
34 |
Correct |
25 ms |
40504 KB |
ans=YES N=184 |
35 |
Correct |
25 ms |
40516 KB |
ans=YES N=188 |
36 |
Correct |
29 ms |
40476 KB |
ans=YES N=181 |
37 |
Correct |
26 ms |
40404 KB |
ans=YES N=188 |
38 |
Correct |
26 ms |
40404 KB |
ans=YES N=191 |
39 |
Correct |
25 ms |
40392 KB |
ans=YES N=196 |
40 |
Correct |
25 ms |
40404 KB |
ans=YES N=196 |
41 |
Correct |
24 ms |
40364 KB |
ans=YES N=196 |
42 |
Correct |
23 ms |
40404 KB |
ans=YES N=196 |
43 |
Correct |
26 ms |
40404 KB |
ans=YES N=195 |
44 |
Correct |
25 ms |
40628 KB |
ans=NO N=1934 |
45 |
Correct |
28 ms |
40680 KB |
ans=NO N=1965 |
46 |
Correct |
35 ms |
40884 KB |
ans=YES N=1824 |
47 |
Correct |
36 ms |
40924 KB |
ans=YES N=1981 |
48 |
Correct |
33 ms |
40812 KB |
ans=YES N=1814 |
49 |
Correct |
37 ms |
40892 KB |
ans=YES N=1854 |
50 |
Correct |
37 ms |
40872 KB |
ans=YES N=1831 |
51 |
Correct |
38 ms |
40908 KB |
ans=YES N=2000 |
52 |
Correct |
46 ms |
41036 KB |
ans=YES N=1847 |
53 |
Correct |
42 ms |
41080 KB |
ans=YES N=1819 |
54 |
Correct |
35 ms |
40860 KB |
ans=YES N=1986 |
55 |
Correct |
46 ms |
41300 KB |
ans=YES N=2000 |
56 |
Correct |
48 ms |
41516 KB |
ans=YES N=1834 |
57 |
Correct |
47 ms |
41420 KB |
ans=YES N=1860 |
58 |
Correct |
50 ms |
41576 KB |
ans=YES N=1898 |
59 |
Correct |
49 ms |
41260 KB |
ans=YES N=1832 |
60 |
Correct |
60 ms |
41812 KB |
ans=YES N=1929 |
61 |
Correct |
40 ms |
41052 KB |
ans=YES N=1919 |
62 |
Correct |
46 ms |
41452 KB |
ans=YES N=1882 |
63 |
Correct |
52 ms |
41928 KB |
ans=YES N=1922 |
64 |
Correct |
40 ms |
41156 KB |
ans=YES N=1989 |
65 |
Correct |
61 ms |
41416 KB |
ans=YES N=1978 |
66 |
Correct |
40 ms |
41436 KB |
ans=YES N=1867 |
67 |
Correct |
45 ms |
41216 KB |
ans=YES N=1942 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
40676 KB |
ans=NO N=1934 |
2 |
Correct |
27 ms |
40608 KB |
ans=NO N=1965 |
3 |
Correct |
36 ms |
40808 KB |
ans=YES N=1824 |
4 |
Correct |
39 ms |
40928 KB |
ans=YES N=1981 |
5 |
Correct |
36 ms |
40832 KB |
ans=YES N=1814 |
6 |
Correct |
39 ms |
40948 KB |
ans=YES N=1854 |
7 |
Correct |
34 ms |
40880 KB |
ans=YES N=1831 |
8 |
Correct |
39 ms |
40916 KB |
ans=YES N=2000 |
9 |
Correct |
40 ms |
41032 KB |
ans=YES N=1847 |
10 |
Correct |
45 ms |
41084 KB |
ans=YES N=1819 |
11 |
Correct |
39 ms |
40836 KB |
ans=YES N=1986 |
12 |
Correct |
48 ms |
41292 KB |
ans=YES N=2000 |
13 |
Correct |
47 ms |
41516 KB |
ans=YES N=1834 |
14 |
Correct |
49 ms |
41460 KB |
ans=YES N=1860 |
15 |
Correct |
55 ms |
41488 KB |
ans=YES N=1898 |
16 |
Correct |
46 ms |
41428 KB |
ans=YES N=1832 |
17 |
Correct |
63 ms |
41780 KB |
ans=YES N=1929 |
18 |
Correct |
40 ms |
41004 KB |
ans=YES N=1919 |
19 |
Correct |
47 ms |
41372 KB |
ans=YES N=1882 |
20 |
Correct |
51 ms |
41980 KB |
ans=YES N=1922 |
21 |
Correct |
40 ms |
41080 KB |
ans=YES N=1989 |
22 |
Correct |
47 ms |
41420 KB |
ans=YES N=1978 |
23 |
Correct |
38 ms |
41420 KB |
ans=YES N=1867 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
40276 KB |
ans=YES N=1 |
2 |
Correct |
26 ms |
40404 KB |
ans=YES N=4 |
3 |
Correct |
22 ms |
40352 KB |
ans=NO N=4 |
4 |
Correct |
26 ms |
40332 KB |
ans=YES N=5 |
5 |
Correct |
23 ms |
40360 KB |
ans=YES N=9 |
6 |
Correct |
22 ms |
40368 KB |
ans=YES N=5 |
7 |
Correct |
22 ms |
40276 KB |
ans=NO N=9 |
8 |
Correct |
23 ms |
40344 KB |
ans=NO N=10 |
9 |
Correct |
24 ms |
40404 KB |
ans=YES N=10 |
10 |
Correct |
23 ms |
40384 KB |
ans=YES N=10 |
11 |
Correct |
23 ms |
40340 KB |
ans=YES N=10 |
12 |
Correct |
29 ms |
40316 KB |
ans=YES N=9 |
13 |
Correct |
24 ms |
40404 KB |
ans=YES N=9 |
14 |
Correct |
38 ms |
40328 KB |
ans=YES N=8 |
15 |
Correct |
22 ms |
40404 KB |
ans=YES N=8 |
16 |
Correct |
23 ms |
40348 KB |
ans=NO N=2 |
17 |
Correct |
22 ms |
40336 KB |
ans=YES N=17 |
18 |
Correct |
24 ms |
40300 KB |
ans=YES N=25 |
19 |
Correct |
23 ms |
40436 KB |
ans=YES N=100 |
20 |
Correct |
24 ms |
40404 KB |
ans=YES N=185 |
21 |
Correct |
24 ms |
40404 KB |
ans=NO N=174 |
22 |
Correct |
25 ms |
40348 KB |
ans=YES N=90 |
23 |
Correct |
24 ms |
40404 KB |
ans=YES N=63 |
24 |
Correct |
25 ms |
40344 KB |
ans=YES N=87 |
25 |
Correct |
24 ms |
40348 KB |
ans=YES N=183 |
26 |
Correct |
25 ms |
40404 KB |
ans=YES N=188 |
27 |
Correct |
27 ms |
40448 KB |
ans=YES N=183 |
28 |
Correct |
25 ms |
40432 KB |
ans=YES N=189 |
29 |
Correct |
24 ms |
40412 KB |
ans=YES N=200 |
30 |
Correct |
29 ms |
40476 KB |
ans=YES N=190 |
31 |
Correct |
26 ms |
40404 KB |
ans=YES N=187 |
32 |
Correct |
24 ms |
40380 KB |
ans=YES N=187 |
33 |
Correct |
24 ms |
40460 KB |
ans=YES N=182 |
34 |
Correct |
25 ms |
40504 KB |
ans=YES N=184 |
35 |
Correct |
25 ms |
40516 KB |
ans=YES N=188 |
36 |
Correct |
29 ms |
40476 KB |
ans=YES N=181 |
37 |
Correct |
26 ms |
40404 KB |
ans=YES N=188 |
38 |
Correct |
26 ms |
40404 KB |
ans=YES N=191 |
39 |
Correct |
25 ms |
40392 KB |
ans=YES N=196 |
40 |
Correct |
25 ms |
40404 KB |
ans=YES N=196 |
41 |
Correct |
24 ms |
40364 KB |
ans=YES N=196 |
42 |
Correct |
23 ms |
40404 KB |
ans=YES N=196 |
43 |
Correct |
26 ms |
40404 KB |
ans=YES N=195 |
44 |
Correct |
25 ms |
40628 KB |
ans=NO N=1934 |
45 |
Correct |
28 ms |
40680 KB |
ans=NO N=1965 |
46 |
Correct |
35 ms |
40884 KB |
ans=YES N=1824 |
47 |
Correct |
36 ms |
40924 KB |
ans=YES N=1981 |
48 |
Correct |
33 ms |
40812 KB |
ans=YES N=1814 |
49 |
Correct |
37 ms |
40892 KB |
ans=YES N=1854 |
50 |
Correct |
37 ms |
40872 KB |
ans=YES N=1831 |
51 |
Correct |
38 ms |
40908 KB |
ans=YES N=2000 |
52 |
Correct |
46 ms |
41036 KB |
ans=YES N=1847 |
53 |
Correct |
42 ms |
41080 KB |
ans=YES N=1819 |
54 |
Correct |
35 ms |
40860 KB |
ans=YES N=1986 |
55 |
Correct |
46 ms |
41300 KB |
ans=YES N=2000 |
56 |
Correct |
48 ms |
41516 KB |
ans=YES N=1834 |
57 |
Correct |
47 ms |
41420 KB |
ans=YES N=1860 |
58 |
Correct |
50 ms |
41576 KB |
ans=YES N=1898 |
59 |
Correct |
49 ms |
41260 KB |
ans=YES N=1832 |
60 |
Correct |
60 ms |
41812 KB |
ans=YES N=1929 |
61 |
Correct |
40 ms |
41052 KB |
ans=YES N=1919 |
62 |
Correct |
46 ms |
41452 KB |
ans=YES N=1882 |
63 |
Correct |
52 ms |
41928 KB |
ans=YES N=1922 |
64 |
Correct |
40 ms |
41156 KB |
ans=YES N=1989 |
65 |
Correct |
61 ms |
41416 KB |
ans=YES N=1978 |
66 |
Correct |
40 ms |
41436 KB |
ans=YES N=1867 |
67 |
Correct |
45 ms |
41216 KB |
ans=YES N=1942 |
68 |
Correct |
95 ms |
51968 KB |
ans=NO N=66151 |
69 |
Correct |
76 ms |
51544 KB |
ans=NO N=64333 |
70 |
Correct |
770 ms |
57528 KB |
ans=YES N=69316 |
71 |
Correct |
722 ms |
56964 KB |
ans=YES N=66695 |
72 |
Correct |
714 ms |
57484 KB |
ans=YES N=68436 |
73 |
Correct |
784 ms |
57956 KB |
ans=YES N=70000 |
74 |
Correct |
775 ms |
57892 KB |
ans=YES N=68501 |
75 |
Correct |
828 ms |
58504 KB |
ans=YES N=70000 |
76 |
Correct |
808 ms |
58268 KB |
ans=YES N=65009 |
77 |
Correct |
1462 ms |
69340 KB |
ans=YES N=67007 |
78 |
Correct |
1789 ms |
78032 KB |
ans=YES N=66357 |
79 |
Correct |
1837 ms |
81596 KB |
ans=YES N=65430 |
80 |
Correct |
1838 ms |
78672 KB |
ans=YES N=65790 |
81 |
Correct |
1608 ms |
75360 KB |
ans=YES N=66020 |
82 |
Correct |
1401 ms |
70816 KB |
ans=YES N=65809 |
83 |
Correct |
998 ms |
61952 KB |
ans=YES N=65651 |
84 |
Correct |
2067 ms |
105572 KB |
ans=YES N=68040 |
85 |
Correct |
1870 ms |
85348 KB |
ans=YES N=66570 |
86 |
Correct |
727 ms |
57972 KB |
ans=YES N=65421 |
87 |
Correct |
927 ms |
60528 KB |
ans=YES N=68351 |
88 |
Correct |
586 ms |
56936 KB |
ans=YES N=67027 |
89 |
Correct |
1918 ms |
70900 KB |
ans=YES N=68879 |
90 |
Correct |
1090 ms |
59996 KB |
ans=YES N=67256 |
91 |
Correct |
1739 ms |
78324 KB |
ans=YES N=148315 |
92 |
Correct |
163 ms |
65088 KB |
ans=NO N=142745 |
93 |
Correct |
172 ms |
66112 KB |
ans=NO N=148443 |
94 |
Correct |
1658 ms |
76796 KB |
ans=YES N=148328 |
95 |
Correct |
1675 ms |
76868 KB |
ans=YES N=147855 |
96 |
Correct |
1717 ms |
77344 KB |
ans=YES N=150000 |
97 |
Correct |
1622 ms |
76084 KB |
ans=YES N=144725 |
98 |
Correct |
1681 ms |
76964 KB |
ans=YES N=149445 |
99 |
Correct |
1740 ms |
76352 KB |
ans=YES N=144455 |
100 |
Correct |
1615 ms |
76016 KB |
ans=YES N=143487 |
101 |
Correct |
1750 ms |
77612 KB |
ans=YES N=149688 |
102 |
Execution timed out |
3573 ms |
115080 KB |
Time limit exceeded |
103 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
74 ms |
51860 KB |
ans=NO N=66151 |
2 |
Correct |
77 ms |
51548 KB |
ans=NO N=64333 |
3 |
Correct |
688 ms |
57540 KB |
ans=YES N=69316 |
4 |
Correct |
659 ms |
57016 KB |
ans=YES N=66695 |
5 |
Correct |
681 ms |
57584 KB |
ans=YES N=68436 |
6 |
Correct |
737 ms |
57944 KB |
ans=YES N=70000 |
7 |
Correct |
701 ms |
57688 KB |
ans=YES N=68501 |
8 |
Correct |
734 ms |
58452 KB |
ans=YES N=70000 |
9 |
Correct |
701 ms |
58456 KB |
ans=YES N=65009 |
10 |
Correct |
1318 ms |
69168 KB |
ans=YES N=67007 |
11 |
Correct |
1625 ms |
78012 KB |
ans=YES N=66357 |
12 |
Correct |
1708 ms |
81572 KB |
ans=YES N=65430 |
13 |
Correct |
1640 ms |
78760 KB |
ans=YES N=65790 |
14 |
Correct |
1489 ms |
75400 KB |
ans=YES N=66020 |
15 |
Correct |
1294 ms |
70876 KB |
ans=YES N=65809 |
16 |
Correct |
926 ms |
62044 KB |
ans=YES N=65651 |
17 |
Correct |
1944 ms |
105572 KB |
ans=YES N=68040 |
18 |
Correct |
1764 ms |
85240 KB |
ans=YES N=66570 |
19 |
Correct |
697 ms |
58060 KB |
ans=YES N=65421 |
20 |
Correct |
849 ms |
60480 KB |
ans=YES N=68351 |
21 |
Correct |
523 ms |
56992 KB |
ans=YES N=67027 |
22 |
Correct |
1866 ms |
70928 KB |
ans=YES N=68879 |
23 |
Correct |
1031 ms |
60016 KB |
ans=YES N=67256 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
40676 KB |
ans=NO N=1934 |
2 |
Correct |
27 ms |
40608 KB |
ans=NO N=1965 |
3 |
Correct |
36 ms |
40808 KB |
ans=YES N=1824 |
4 |
Correct |
39 ms |
40928 KB |
ans=YES N=1981 |
5 |
Correct |
36 ms |
40832 KB |
ans=YES N=1814 |
6 |
Correct |
39 ms |
40948 KB |
ans=YES N=1854 |
7 |
Correct |
34 ms |
40880 KB |
ans=YES N=1831 |
8 |
Correct |
39 ms |
40916 KB |
ans=YES N=2000 |
9 |
Correct |
40 ms |
41032 KB |
ans=YES N=1847 |
10 |
Correct |
45 ms |
41084 KB |
ans=YES N=1819 |
11 |
Correct |
39 ms |
40836 KB |
ans=YES N=1986 |
12 |
Correct |
48 ms |
41292 KB |
ans=YES N=2000 |
13 |
Correct |
47 ms |
41516 KB |
ans=YES N=1834 |
14 |
Correct |
49 ms |
41460 KB |
ans=YES N=1860 |
15 |
Correct |
55 ms |
41488 KB |
ans=YES N=1898 |
16 |
Correct |
46 ms |
41428 KB |
ans=YES N=1832 |
17 |
Correct |
63 ms |
41780 KB |
ans=YES N=1929 |
18 |
Correct |
40 ms |
41004 KB |
ans=YES N=1919 |
19 |
Correct |
47 ms |
41372 KB |
ans=YES N=1882 |
20 |
Correct |
51 ms |
41980 KB |
ans=YES N=1922 |
21 |
Correct |
40 ms |
41080 KB |
ans=YES N=1989 |
22 |
Correct |
47 ms |
41420 KB |
ans=YES N=1978 |
23 |
Correct |
38 ms |
41420 KB |
ans=YES N=1867 |
24 |
Correct |
74 ms |
51860 KB |
ans=NO N=66151 |
25 |
Correct |
77 ms |
51548 KB |
ans=NO N=64333 |
26 |
Correct |
688 ms |
57540 KB |
ans=YES N=69316 |
27 |
Correct |
659 ms |
57016 KB |
ans=YES N=66695 |
28 |
Correct |
681 ms |
57584 KB |
ans=YES N=68436 |
29 |
Correct |
737 ms |
57944 KB |
ans=YES N=70000 |
30 |
Correct |
701 ms |
57688 KB |
ans=YES N=68501 |
31 |
Correct |
734 ms |
58452 KB |
ans=YES N=70000 |
32 |
Correct |
701 ms |
58456 KB |
ans=YES N=65009 |
33 |
Correct |
1318 ms |
69168 KB |
ans=YES N=67007 |
34 |
Correct |
1625 ms |
78012 KB |
ans=YES N=66357 |
35 |
Correct |
1708 ms |
81572 KB |
ans=YES N=65430 |
36 |
Correct |
1640 ms |
78760 KB |
ans=YES N=65790 |
37 |
Correct |
1489 ms |
75400 KB |
ans=YES N=66020 |
38 |
Correct |
1294 ms |
70876 KB |
ans=YES N=65809 |
39 |
Correct |
926 ms |
62044 KB |
ans=YES N=65651 |
40 |
Correct |
1944 ms |
105572 KB |
ans=YES N=68040 |
41 |
Correct |
1764 ms |
85240 KB |
ans=YES N=66570 |
42 |
Correct |
697 ms |
58060 KB |
ans=YES N=65421 |
43 |
Correct |
849 ms |
60480 KB |
ans=YES N=68351 |
44 |
Correct |
523 ms |
56992 KB |
ans=YES N=67027 |
45 |
Correct |
1866 ms |
70928 KB |
ans=YES N=68879 |
46 |
Correct |
1031 ms |
60016 KB |
ans=YES N=67256 |
47 |
Correct |
1674 ms |
78128 KB |
ans=YES N=148315 |
48 |
Correct |
188 ms |
65060 KB |
ans=NO N=142745 |
49 |
Correct |
179 ms |
66028 KB |
ans=NO N=148443 |
50 |
Correct |
1624 ms |
76708 KB |
ans=YES N=148328 |
51 |
Correct |
1703 ms |
76848 KB |
ans=YES N=147855 |
52 |
Correct |
1733 ms |
77120 KB |
ans=YES N=150000 |
53 |
Correct |
1629 ms |
76196 KB |
ans=YES N=144725 |
54 |
Correct |
1729 ms |
77052 KB |
ans=YES N=149445 |
55 |
Correct |
1856 ms |
76356 KB |
ans=YES N=144455 |
56 |
Correct |
1920 ms |
76052 KB |
ans=YES N=143487 |
57 |
Correct |
1761 ms |
77612 KB |
ans=YES N=149688 |
58 |
Execution timed out |
3596 ms |
115004 KB |
Time limit exceeded |
59 |
Halted |
0 ms |
0 KB |
- |