Submission #492809

# Submission time Handle Problem Language Result Execution time Memory
492809 2021-12-09T02:48:14 Z fhvirus Building Skyscrapers (CEOI19_skyscrapers) C++17
100 / 100
1354 ms 326528 KB
// Knapsack DP is harder than FFT.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll;
#define ff first
#define ss second
#define pb emplace_back
#define AI(x) begin(x),end(x)
template<class I>bool chmax(I&a,I b){return a<b?(a=b,true):false;}
template<class I>bool chmin(I&a,I b){return b<a?(a=b,true):false;} 
#ifdef OWO
#define debug(args...) SDF(#args, args)
#define OIU(args...) ostream& operator<<(ostream&O,args)
#define LKJ(S,B,E,F) template<class...T>OIU(S<T...>s){O<<B;int c=0;for(auto i:s)O<<(c++?", ":"")<<F;return O<<E;}
LKJ(vector,'[',']',i)LKJ(deque,'[',']',i)LKJ(set,'{','}',i)LKJ(multiset,'{','}',i)LKJ(unordered_set,'{','}',i)LKJ(map,'{','}',i.ff<<':'<<i.ss)LKJ(unordered_map,'{','}',i.ff<<':'<<i.ss)
template<class...T>void SDF(const char* s,T...a){int c=sizeof...(T);if(!c){cerr<<"\033[1;32mvoid\033[0m\n";return;}(cerr<<"\033[1;32m("<<s<<") = (",...,(cerr<<a<<(--c?", ":")\033[0m\n")));}
template<class T,size_t N>OIU(array<T,N>a){return O<<vector<T>(AI(a));}template<class...T>OIU(pair<T...>p){return O<<'('<<p.ff<<','<<p.ss<<')';}template<class...T>OIU(tuple<T...>t){return O<<'(',apply([&O](T...s){int c=0;(...,(O<<(c++?", ":"")<<s));},t),O<<')';}
#else
#pragma GCC optimize("Ofast")
#define debug(...) ((void)0)
#endif

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
namespace Map {
	// from https://gist.github.com/Chillee/3bd6ee4429abb4a2e7c19959fb1490ae#file-hash-table-cpp
	struct chash {
    const int RANDOM = (long long)(make_unique<char>().get()) ^ chrono::high_resolution_clock::now().time_since_epoch().count();
    static unsigned long long hash_f(pii p) {
			unsigned long long x = p.first * 1000696969LL + p.second;
      x += 0x9e3779b97f4a7c15;
      x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
      x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
      return x ^ (x >> 31);
    }
    unsigned long long operator()(pii x) const { return hash_f(x) ^ RANDOM; }
	};
	typedef gp_hash_table<pii, int, chash> gp;
}

const int kN = 150051;
const int kB = kN * 9;
int n, t;
pii pos[kB];
Map::gp ids;

int tot = 0;
int skyToBlock[kN];
int blockToSky[kB];
bool built[kB];
int component[kB];
vector<int> inComponent[kB];
vector<int> G4[kB], G8[kB];
int infinity;

void newBlock(int r, int c) {
	pii p(r, c);
	auto it = ids.find(p);
	if (it != end(ids)) return;
	ids[p] = ++tot;
	pos[tot] = p;
	component[tot] = tot;
	inComponent[tot].pb(tot);
}

bool isAP(int i) {
	debug(i, pos[i]);
	static bool has[3][3];
	static  int com[3][3];
	static  int cu, cd, cl, cr, ci;
	for (int &j: G8[i]) {
		int x = pos[j].ff - pos[i].ff + 1;
		int y = pos[j].ss - pos[i].ss + 1;
		has[x][y] = built[j];
		com[x][y] = component[j];
	}
	cu = com[0][1]; cd = com[2][1];
	cl = com[1][0]; cr = com[1][2];
	// debug(cu, cd, cl, cr);
	// debug(has[0][0], has[0][1], has[0][2]);
	// debug(has[1][0], has[1][1], has[1][2]);
	// debug(has[2][0], has[2][1], has[2][2]);
	
	if (!has[0][1] and !has[1][2] and cu == cr and has[0][2] and
			(has[0][0] or has[1][0] or has[2][0] or has[2][1] or has[2][2]))
		return true;
	if (!has[0][1] and !has[1][0] and cu == cl and has[0][0] and
			(has[0][2] or has[1][2] or has[2][0] or has[2][1] or has[2][2]))
		return true;
	if (!has[2][1] and !has[1][2] and cd == cr and has[2][2] and
			(has[0][0] or has[1][0] or has[2][0] or has[0][1] or has[0][2]))
		return true;
	if (!has[2][1] and !has[1][0] and cd == cl and has[2][0] and
			(has[0][2] or has[1][2] or has[2][2] or has[0][0] or has[0][1]))
		return true;

	if (!has[0][1] and !has[2][1] and cu == cd and
			(has[0][0] or has[1][0] or has[2][0]) and
			(has[0][2] or has[1][2] or has[2][2]))
		return true;
	if (!has[1][0] and !has[1][2] and cl == cr and
			(has[0][0] or has[0][1] or has[0][2]) and
			(has[2][0] or has[2][1] or has[2][2]))
		return true;

	ci = component[infinity];
	if (cu == ci or cd == ci or cl == ci or cr == ci)
		return false;

	return true;
}
bool canErase[kB];
set<int, greater<int>> choose;
void updateSky(int i) {
	bool ap = isAP(skyToBlock[i]);
	if (ap and canErase[i])
		choose.erase(i);
	if (!ap and !canErase[i])
		choose.insert(i);
	canErase[i] = !ap;
}

// tissue is just a random name for timestamp
int lastUpdate[kB], tissue;
void merge(int i, int j, bool u) {
	if (i == j) return;
	if (inComponent[i].size() < inComponent[j].size())
		swap(i, j);

	for (int &v: inComponent[j]) {
		component[v] = i;
		inComponent[i].pb(v);
	}

	if (u) {
		++tissue;
		for (int &v: inComponent[j])
			for (int &w: G8[v])
				if (built[w] and lastUpdate[w] < tissue) {
					debug(w, built[w], pos[w], skyToBlock[w]);
					lastUpdate[w] = tissue;
					updateSky(blockToSky[w]);
				}
	}

	inComponent[j].clear();
}
void remove(int i) {
	built[i] = false;
	for (int &j: G4[i]) if (!built[j])
		merge(component[i], component[j], true);
}

bool vis[kB];
void dfs(int u, int &reach) {
	++reach; vis[u] = true;
	for (int &v: G8[u])
		if (built[v] and !vis[v])
			dfs(v, reach);
}

signed main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

	cin >> n >> t;

	pii minPos(1e9 + 7, 1e9 + 7);
	for (int r, c, i = 1; i <= n; ++i) {
		cin >> r >> c;
		for (int dx = -1; dx <= 1; ++dx)
			for (int dy = -1; dy <= 1; ++dy)
				newBlock(r + dx, c + dy);
		int id = ids[pii(r, c)];
		skyToBlock[i] = id;
		blockToSky[id] = i;
		built[id] = true;
		minPos = min(minPos, pii(r, c));
	}
	--minPos.ff;
	infinity = ids[minPos];
	debug("Done 1");

	for (int i = 1; i <= tot; ++i) {
		auto &[r, c] = pos[i];
		for (int dx = -1; dx <= 1; ++dx)
			for (int dy = -1; dy <= 1; ++dy) {
				if (dx == 0 and dy == 0) continue;
				pii np(r + dx, c + dy);
				auto it = ids.find(np);
				if (it == end(ids)) continue;
				int j = ids[np];

				G8[i].pb(j);
				if (dx == 0 or dy == 0) {
					G4[i].pb(j);
					if (!built[i] and !built[j])
						merge(component[i], component[j], false);
				}
			}
	}
	//for (int i = 1; i <= n; ++i)
	//	debug(i, skyToBlock[i], pos[skyToBlock[i]]);
	//for (int i = 1; i <= tot; ++i)
	//	debug(i, pos[i], built[i], G4[i], G8[i]);
	debug("Done 2");

	int reach = 0;
	dfs(skyToBlock[1], reach);
	if (reach != n) {
		cout << "NO\n";
		return 0;
	}
	debug("Done 3");

	for (int i = 1; i <= n; ++i)
		updateSky(i);

	cout << "YES\n";
	vector<int> ans;
	for (int i = 1; i <= n; ++i) {
		//debug(choose);
		int u = *begin(choose);
		choose.erase(u);
		ans.pb(u);
		remove(skyToBlock[u]);
	}

	reverse(AI(ans));
	for (int &u: ans)
		cout << u << '\n';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 51 ms 95508 KB ans=YES N=1
2 Correct 51 ms 95432 KB ans=YES N=4
3 Correct 53 ms 95392 KB ans=NO N=4
4 Correct 53 ms 95532 KB ans=YES N=5
5 Correct 51 ms 95400 KB ans=YES N=9
6 Correct 61 ms 95504 KB ans=YES N=5
7 Correct 53 ms 95476 KB ans=NO N=9
8 Correct 58 ms 95436 KB ans=NO N=10
9 Correct 49 ms 95400 KB ans=YES N=10
10 Correct 50 ms 95400 KB ans=YES N=10
11 Correct 49 ms 95428 KB ans=YES N=10
12 Correct 51 ms 95400 KB ans=YES N=9
13 Correct 53 ms 95504 KB ans=YES N=9
14 Correct 49 ms 95464 KB ans=YES N=8
15 Correct 51 ms 95468 KB ans=YES N=8
16 Correct 51 ms 95380 KB ans=NO N=2
# Verdict Execution time Memory Grader output
1 Correct 51 ms 95508 KB ans=YES N=1
2 Correct 51 ms 95432 KB ans=YES N=4
3 Correct 53 ms 95392 KB ans=NO N=4
4 Correct 53 ms 95532 KB ans=YES N=5
5 Correct 51 ms 95400 KB ans=YES N=9
6 Correct 61 ms 95504 KB ans=YES N=5
7 Correct 53 ms 95476 KB ans=NO N=9
8 Correct 58 ms 95436 KB ans=NO N=10
9 Correct 49 ms 95400 KB ans=YES N=10
10 Correct 50 ms 95400 KB ans=YES N=10
11 Correct 49 ms 95428 KB ans=YES N=10
12 Correct 51 ms 95400 KB ans=YES N=9
13 Correct 53 ms 95504 KB ans=YES N=9
14 Correct 49 ms 95464 KB ans=YES N=8
15 Correct 51 ms 95468 KB ans=YES N=8
16 Correct 51 ms 95380 KB ans=NO N=2
17 Correct 52 ms 95428 KB ans=YES N=17
18 Correct 50 ms 95516 KB ans=YES N=25
19 Correct 49 ms 95512 KB ans=YES N=100
20 Correct 55 ms 95544 KB ans=YES N=185
21 Correct 52 ms 95604 KB ans=NO N=174
22 Correct 50 ms 95468 KB ans=YES N=90
23 Correct 48 ms 95440 KB ans=YES N=63
24 Correct 49 ms 95412 KB ans=YES N=87
25 Correct 49 ms 95428 KB ans=YES N=183
26 Correct 49 ms 95516 KB ans=YES N=188
27 Correct 50 ms 95516 KB ans=YES N=183
28 Correct 49 ms 95488 KB ans=YES N=189
29 Correct 49 ms 95524 KB ans=YES N=200
30 Correct 50 ms 95564 KB ans=YES N=190
31 Correct 50 ms 95556 KB ans=YES N=187
32 Correct 49 ms 95556 KB ans=YES N=187
33 Correct 49 ms 95556 KB ans=YES N=182
34 Correct 50 ms 95640 KB ans=YES N=184
35 Correct 50 ms 95592 KB ans=YES N=188
36 Correct 52 ms 95600 KB ans=YES N=181
37 Correct 49 ms 95632 KB ans=YES N=188
38 Correct 51 ms 95568 KB ans=YES N=191
39 Correct 49 ms 95556 KB ans=YES N=196
40 Correct 50 ms 95520 KB ans=YES N=196
41 Correct 50 ms 95576 KB ans=YES N=196
42 Correct 50 ms 95476 KB ans=YES N=196
43 Correct 52 ms 95540 KB ans=YES N=195
# Verdict Execution time Memory Grader output
1 Correct 51 ms 95508 KB ans=YES N=1
2 Correct 51 ms 95432 KB ans=YES N=4
3 Correct 53 ms 95392 KB ans=NO N=4
4 Correct 53 ms 95532 KB ans=YES N=5
5 Correct 51 ms 95400 KB ans=YES N=9
6 Correct 61 ms 95504 KB ans=YES N=5
7 Correct 53 ms 95476 KB ans=NO N=9
8 Correct 58 ms 95436 KB ans=NO N=10
9 Correct 49 ms 95400 KB ans=YES N=10
10 Correct 50 ms 95400 KB ans=YES N=10
11 Correct 49 ms 95428 KB ans=YES N=10
12 Correct 51 ms 95400 KB ans=YES N=9
13 Correct 53 ms 95504 KB ans=YES N=9
14 Correct 49 ms 95464 KB ans=YES N=8
15 Correct 51 ms 95468 KB ans=YES N=8
16 Correct 51 ms 95380 KB ans=NO N=2
17 Correct 52 ms 95428 KB ans=YES N=17
18 Correct 50 ms 95516 KB ans=YES N=25
19 Correct 49 ms 95512 KB ans=YES N=100
20 Correct 55 ms 95544 KB ans=YES N=185
21 Correct 52 ms 95604 KB ans=NO N=174
22 Correct 50 ms 95468 KB ans=YES N=90
23 Correct 48 ms 95440 KB ans=YES N=63
24 Correct 49 ms 95412 KB ans=YES N=87
25 Correct 49 ms 95428 KB ans=YES N=183
26 Correct 49 ms 95516 KB ans=YES N=188
27 Correct 50 ms 95516 KB ans=YES N=183
28 Correct 49 ms 95488 KB ans=YES N=189
29 Correct 49 ms 95524 KB ans=YES N=200
30 Correct 50 ms 95564 KB ans=YES N=190
31 Correct 50 ms 95556 KB ans=YES N=187
32 Correct 49 ms 95556 KB ans=YES N=187
33 Correct 49 ms 95556 KB ans=YES N=182
34 Correct 50 ms 95640 KB ans=YES N=184
35 Correct 50 ms 95592 KB ans=YES N=188
36 Correct 52 ms 95600 KB ans=YES N=181
37 Correct 49 ms 95632 KB ans=YES N=188
38 Correct 51 ms 95568 KB ans=YES N=191
39 Correct 49 ms 95556 KB ans=YES N=196
40 Correct 50 ms 95520 KB ans=YES N=196
41 Correct 50 ms 95576 KB ans=YES N=196
42 Correct 50 ms 95476 KB ans=YES N=196
43 Correct 52 ms 95540 KB ans=YES N=195
44 Correct 61 ms 98584 KB ans=NO N=1934
45 Correct 54 ms 96524 KB ans=NO N=1965
46 Correct 53 ms 95936 KB ans=YES N=1824
47 Correct 53 ms 96096 KB ans=YES N=1981
48 Correct 53 ms 95924 KB ans=YES N=1814
49 Correct 55 ms 96136 KB ans=YES N=1854
50 Correct 57 ms 96072 KB ans=YES N=1831
51 Correct 54 ms 96128 KB ans=YES N=2000
52 Correct 54 ms 96204 KB ans=YES N=1847
53 Correct 56 ms 96300 KB ans=YES N=1819
54 Correct 55 ms 96048 KB ans=YES N=1986
55 Correct 56 ms 96680 KB ans=YES N=2000
56 Correct 59 ms 96680 KB ans=YES N=1834
57 Correct 62 ms 96708 KB ans=YES N=1860
58 Correct 56 ms 96756 KB ans=YES N=1898
59 Correct 56 ms 96580 KB ans=YES N=1832
60 Correct 58 ms 96956 KB ans=YES N=1929
61 Correct 54 ms 96068 KB ans=YES N=1919
62 Correct 57 ms 96616 KB ans=YES N=1882
63 Correct 64 ms 96964 KB ans=YES N=1922
64 Correct 54 ms 96264 KB ans=YES N=1989
65 Correct 53 ms 96540 KB ans=YES N=1978
66 Correct 58 ms 96732 KB ans=YES N=1867
67 Correct 59 ms 96480 KB ans=YES N=1942
# Verdict Execution time Memory Grader output
1 Correct 64 ms 98576 KB ans=NO N=1934
2 Correct 55 ms 96452 KB ans=NO N=1965
3 Correct 53 ms 95996 KB ans=YES N=1824
4 Correct 55 ms 96028 KB ans=YES N=1981
5 Correct 51 ms 96008 KB ans=YES N=1814
6 Correct 57 ms 96064 KB ans=YES N=1854
7 Correct 55 ms 96068 KB ans=YES N=1831
8 Correct 56 ms 96260 KB ans=YES N=2000
9 Correct 58 ms 96320 KB ans=YES N=1847
10 Correct 59 ms 96196 KB ans=YES N=1819
11 Correct 54 ms 96112 KB ans=YES N=1986
12 Correct 62 ms 96640 KB ans=YES N=2000
13 Correct 56 ms 96720 KB ans=YES N=1834
14 Correct 63 ms 96724 KB ans=YES N=1860
15 Correct 58 ms 96812 KB ans=YES N=1898
16 Correct 57 ms 96676 KB ans=YES N=1832
17 Correct 59 ms 96896 KB ans=YES N=1929
18 Correct 55 ms 96068 KB ans=YES N=1919
19 Correct 56 ms 96580 KB ans=YES N=1882
20 Correct 58 ms 97044 KB ans=YES N=1922
21 Correct 60 ms 96196 KB ans=YES N=1989
22 Correct 57 ms 96576 KB ans=YES N=1978
23 Correct 55 ms 96764 KB ans=YES N=1867
# Verdict Execution time Memory Grader output
1 Correct 51 ms 95508 KB ans=YES N=1
2 Correct 51 ms 95432 KB ans=YES N=4
3 Correct 53 ms 95392 KB ans=NO N=4
4 Correct 53 ms 95532 KB ans=YES N=5
5 Correct 51 ms 95400 KB ans=YES N=9
6 Correct 61 ms 95504 KB ans=YES N=5
7 Correct 53 ms 95476 KB ans=NO N=9
8 Correct 58 ms 95436 KB ans=NO N=10
9 Correct 49 ms 95400 KB ans=YES N=10
10 Correct 50 ms 95400 KB ans=YES N=10
11 Correct 49 ms 95428 KB ans=YES N=10
12 Correct 51 ms 95400 KB ans=YES N=9
13 Correct 53 ms 95504 KB ans=YES N=9
14 Correct 49 ms 95464 KB ans=YES N=8
15 Correct 51 ms 95468 KB ans=YES N=8
16 Correct 51 ms 95380 KB ans=NO N=2
17 Correct 52 ms 95428 KB ans=YES N=17
18 Correct 50 ms 95516 KB ans=YES N=25
19 Correct 49 ms 95512 KB ans=YES N=100
20 Correct 55 ms 95544 KB ans=YES N=185
21 Correct 52 ms 95604 KB ans=NO N=174
22 Correct 50 ms 95468 KB ans=YES N=90
23 Correct 48 ms 95440 KB ans=YES N=63
24 Correct 49 ms 95412 KB ans=YES N=87
25 Correct 49 ms 95428 KB ans=YES N=183
26 Correct 49 ms 95516 KB ans=YES N=188
27 Correct 50 ms 95516 KB ans=YES N=183
28 Correct 49 ms 95488 KB ans=YES N=189
29 Correct 49 ms 95524 KB ans=YES N=200
30 Correct 50 ms 95564 KB ans=YES N=190
31 Correct 50 ms 95556 KB ans=YES N=187
32 Correct 49 ms 95556 KB ans=YES N=187
33 Correct 49 ms 95556 KB ans=YES N=182
34 Correct 50 ms 95640 KB ans=YES N=184
35 Correct 50 ms 95592 KB ans=YES N=188
36 Correct 52 ms 95600 KB ans=YES N=181
37 Correct 49 ms 95632 KB ans=YES N=188
38 Correct 51 ms 95568 KB ans=YES N=191
39 Correct 49 ms 95556 KB ans=YES N=196
40 Correct 50 ms 95520 KB ans=YES N=196
41 Correct 50 ms 95576 KB ans=YES N=196
42 Correct 50 ms 95476 KB ans=YES N=196
43 Correct 52 ms 95540 KB ans=YES N=195
44 Correct 61 ms 98584 KB ans=NO N=1934
45 Correct 54 ms 96524 KB ans=NO N=1965
46 Correct 53 ms 95936 KB ans=YES N=1824
47 Correct 53 ms 96096 KB ans=YES N=1981
48 Correct 53 ms 95924 KB ans=YES N=1814
49 Correct 55 ms 96136 KB ans=YES N=1854
50 Correct 57 ms 96072 KB ans=YES N=1831
51 Correct 54 ms 96128 KB ans=YES N=2000
52 Correct 54 ms 96204 KB ans=YES N=1847
53 Correct 56 ms 96300 KB ans=YES N=1819
54 Correct 55 ms 96048 KB ans=YES N=1986
55 Correct 56 ms 96680 KB ans=YES N=2000
56 Correct 59 ms 96680 KB ans=YES N=1834
57 Correct 62 ms 96708 KB ans=YES N=1860
58 Correct 56 ms 96756 KB ans=YES N=1898
59 Correct 56 ms 96580 KB ans=YES N=1832
60 Correct 58 ms 96956 KB ans=YES N=1929
61 Correct 54 ms 96068 KB ans=YES N=1919
62 Correct 57 ms 96616 KB ans=YES N=1882
63 Correct 64 ms 96964 KB ans=YES N=1922
64 Correct 54 ms 96264 KB ans=YES N=1989
65 Correct 53 ms 96540 KB ans=YES N=1978
66 Correct 58 ms 96732 KB ans=YES N=1867
67 Correct 59 ms 96480 KB ans=YES N=1942
68 Correct 167 ms 115032 KB ans=NO N=66151
69 Correct 567 ms 171052 KB ans=NO N=64333
70 Correct 228 ms 113912 KB ans=YES N=69316
71 Correct 209 ms 113412 KB ans=YES N=66695
72 Correct 220 ms 114852 KB ans=YES N=68436
73 Correct 237 ms 115200 KB ans=YES N=70000
74 Correct 246 ms 114264 KB ans=YES N=68501
75 Correct 251 ms 115904 KB ans=YES N=70000
76 Correct 265 ms 116820 KB ans=YES N=65009
77 Correct 416 ms 132256 KB ans=YES N=67007
78 Correct 449 ms 134944 KB ans=YES N=66357
79 Correct 501 ms 138184 KB ans=YES N=65430
80 Correct 502 ms 136548 KB ans=YES N=65790
81 Correct 435 ms 134288 KB ans=YES N=66020
82 Correct 520 ms 134560 KB ans=YES N=65809
83 Correct 308 ms 118124 KB ans=YES N=65651
84 Correct 588 ms 155480 KB ans=YES N=68040
85 Correct 511 ms 141472 KB ans=YES N=66570
86 Correct 237 ms 115684 KB ans=YES N=65421
87 Correct 287 ms 115428 KB ans=YES N=68351
88 Correct 214 ms 113424 KB ans=YES N=67027
89 Correct 284 ms 129760 KB ans=YES N=68879
90 Correct 293 ms 117540 KB ans=YES N=67256
91 Correct 562 ms 135872 KB ans=YES N=148315
92 Correct 1314 ms 303380 KB ans=NO N=142745
93 Correct 1354 ms 326392 KB ans=NO N=148443
94 Correct 523 ms 135996 KB ans=YES N=148328
95 Correct 536 ms 138176 KB ans=YES N=147855
96 Correct 546 ms 136644 KB ans=YES N=150000
97 Correct 532 ms 135572 KB ans=YES N=144725
98 Correct 547 ms 136268 KB ans=YES N=149445
99 Correct 493 ms 135916 KB ans=YES N=144455
100 Correct 510 ms 135376 KB ans=YES N=143487
101 Correct 596 ms 138540 KB ans=YES N=149688
102 Correct 923 ms 171064 KB ans=YES N=141481
103 Correct 1260 ms 201864 KB ans=YES N=147430
104 Correct 851 ms 150172 KB ans=YES N=142247
105 Correct 984 ms 168348 KB ans=YES N=149941
106 Correct 1201 ms 195924 KB ans=YES N=141635
107 Correct 1179 ms 184808 KB ans=YES N=142896
108 Correct 1250 ms 197408 KB ans=YES N=142069
109 Correct 682 ms 140724 KB ans=YES N=142378
110 Correct 929 ms 176212 KB ans=YES N=150000
111 Correct 1182 ms 227776 KB ans=YES N=141452
112 Correct 1079 ms 229360 KB ans=YES N=134453
113 Correct 1260 ms 229548 KB ans=YES N=144172
# Verdict Execution time Memory Grader output
1 Correct 187 ms 115112 KB ans=NO N=66151
2 Correct 561 ms 171064 KB ans=NO N=64333
3 Correct 234 ms 114048 KB ans=YES N=69316
4 Correct 245 ms 113508 KB ans=YES N=66695
5 Correct 237 ms 114896 KB ans=YES N=68436
6 Correct 243 ms 115240 KB ans=YES N=70000
7 Correct 238 ms 114276 KB ans=YES N=68501
8 Correct 252 ms 115788 KB ans=YES N=70000
9 Correct 269 ms 116632 KB ans=YES N=65009
10 Correct 409 ms 132260 KB ans=YES N=67007
11 Correct 446 ms 134968 KB ans=YES N=66357
12 Correct 494 ms 138224 KB ans=YES N=65430
13 Correct 471 ms 136584 KB ans=YES N=65790
14 Correct 451 ms 134352 KB ans=YES N=66020
15 Correct 400 ms 134532 KB ans=YES N=65809
16 Correct 278 ms 118116 KB ans=YES N=65651
17 Correct 569 ms 155476 KB ans=YES N=68040
18 Correct 503 ms 141316 KB ans=YES N=66570
19 Correct 268 ms 115680 KB ans=YES N=65421
20 Correct 273 ms 115500 KB ans=YES N=68351
21 Correct 223 ms 113432 KB ans=YES N=67027
22 Correct 282 ms 129696 KB ans=YES N=68879
23 Correct 283 ms 117420 KB ans=YES N=67256
# Verdict Execution time Memory Grader output
1 Correct 64 ms 98576 KB ans=NO N=1934
2 Correct 55 ms 96452 KB ans=NO N=1965
3 Correct 53 ms 95996 KB ans=YES N=1824
4 Correct 55 ms 96028 KB ans=YES N=1981
5 Correct 51 ms 96008 KB ans=YES N=1814
6 Correct 57 ms 96064 KB ans=YES N=1854
7 Correct 55 ms 96068 KB ans=YES N=1831
8 Correct 56 ms 96260 KB ans=YES N=2000
9 Correct 58 ms 96320 KB ans=YES N=1847
10 Correct 59 ms 96196 KB ans=YES N=1819
11 Correct 54 ms 96112 KB ans=YES N=1986
12 Correct 62 ms 96640 KB ans=YES N=2000
13 Correct 56 ms 96720 KB ans=YES N=1834
14 Correct 63 ms 96724 KB ans=YES N=1860
15 Correct 58 ms 96812 KB ans=YES N=1898
16 Correct 57 ms 96676 KB ans=YES N=1832
17 Correct 59 ms 96896 KB ans=YES N=1929
18 Correct 55 ms 96068 KB ans=YES N=1919
19 Correct 56 ms 96580 KB ans=YES N=1882
20 Correct 58 ms 97044 KB ans=YES N=1922
21 Correct 60 ms 96196 KB ans=YES N=1989
22 Correct 57 ms 96576 KB ans=YES N=1978
23 Correct 55 ms 96764 KB ans=YES N=1867
24 Correct 187 ms 115112 KB ans=NO N=66151
25 Correct 561 ms 171064 KB ans=NO N=64333
26 Correct 234 ms 114048 KB ans=YES N=69316
27 Correct 245 ms 113508 KB ans=YES N=66695
28 Correct 237 ms 114896 KB ans=YES N=68436
29 Correct 243 ms 115240 KB ans=YES N=70000
30 Correct 238 ms 114276 KB ans=YES N=68501
31 Correct 252 ms 115788 KB ans=YES N=70000
32 Correct 269 ms 116632 KB ans=YES N=65009
33 Correct 409 ms 132260 KB ans=YES N=67007
34 Correct 446 ms 134968 KB ans=YES N=66357
35 Correct 494 ms 138224 KB ans=YES N=65430
36 Correct 471 ms 136584 KB ans=YES N=65790
37 Correct 451 ms 134352 KB ans=YES N=66020
38 Correct 400 ms 134532 KB ans=YES N=65809
39 Correct 278 ms 118116 KB ans=YES N=65651
40 Correct 569 ms 155476 KB ans=YES N=68040
41 Correct 503 ms 141316 KB ans=YES N=66570
42 Correct 268 ms 115680 KB ans=YES N=65421
43 Correct 273 ms 115500 KB ans=YES N=68351
44 Correct 223 ms 113432 KB ans=YES N=67027
45 Correct 282 ms 129696 KB ans=YES N=68879
46 Correct 283 ms 117420 KB ans=YES N=67256
47 Correct 558 ms 135808 KB ans=YES N=148315
48 Correct 1272 ms 303484 KB ans=NO N=142745
49 Correct 1320 ms 326528 KB ans=NO N=148443
50 Correct 512 ms 136068 KB ans=YES N=148328
51 Correct 522 ms 138092 KB ans=YES N=147855
52 Correct 567 ms 136620 KB ans=YES N=150000
53 Correct 565 ms 135460 KB ans=YES N=144725
54 Correct 590 ms 136240 KB ans=YES N=149445
55 Correct 545 ms 135848 KB ans=YES N=144455
56 Correct 509 ms 135452 KB ans=YES N=143487
57 Correct 570 ms 138584 KB ans=YES N=149688
58 Correct 1108 ms 170996 KB ans=YES N=141481
59 Correct 1298 ms 201912 KB ans=YES N=147430
60 Correct 839 ms 150044 KB ans=YES N=142247
61 Correct 1033 ms 168464 KB ans=YES N=149941
62 Correct 1145 ms 195996 KB ans=YES N=141635
63 Correct 1147 ms 184876 KB ans=YES N=142896
64 Correct 1188 ms 197348 KB ans=YES N=142069
65 Correct 742 ms 140652 KB ans=YES N=142378
66 Correct 950 ms 176248 KB ans=YES N=150000
67 Correct 1200 ms 227540 KB ans=YES N=141452
68 Correct 1014 ms 229356 KB ans=YES N=134453
69 Correct 1111 ms 229612 KB ans=YES N=144172