답안 #754355

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
754355 2023-06-07T14:32:40 Z tolbi 분수 공원 (IOI21_parks) C++17
70 / 100
1776 ms 56468 KB
#pragma optimize("Bismillahirrahmanirrahim")
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
#define author tolbi
#include <bits/stdc++.h>
using namespace std;
template<typename X, typename Y> istream& operator>>(istream& in, pair<X,Y> &pr) {return in>>pr.first>>pr.second;}
template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr) {return os<<pr.first<<" "<<pr.second;}
template<typename X> istream& operator>>(istream& in, vector<X> &arr) {for(auto &it : arr) in>>it; return in;}
template<typename X> ostream& operator<<(ostream& os, vector<X> arr) {for(auto &it : arr) os<<it<<" "; return os;}
template<typename X, size_t Y> istream& operator>>(istream& in, array<X,Y> &arr) {for(auto &it : arr) in>>it; return in;}
template<typename X, size_t Y> ostream& operator<<(ostream& os, array<X,Y> arr) {for(auto &it : arr) os<<it<<" "; return os;}
template<typename T> vector<int32_t> normalize(vector<T> &arr){vector<int> rv;rv.resize(arr.size());for (int i = 0; i < rv.size(); ++i){rv[i]=arr[i];}return rv;}
#define endl '\n'
#define vint(x) vector<int> x
#define deci(x) int x;cin>>x;
#define decstr(x) string x;cin>>x;
#define cinarr(x) for (auto &it : x) cin>>it;
#define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl;
#define sortarr(x) sort(x.begin(),x.end())
#define sortrarr(x) sort(x.rbegin(),x.rend())
#define det(x) cout<<"NO\0YES"+x*3<<endl;
#define INF LONG_MAX
#define rev(x) reverse(x.begin(),x.end());
#define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define tol(bi) (1LL<<((int)(bi)))
const int MOD = 1e9+7;
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
#include "parks.h"
struct DSU{
	vector<int> par;
	DSU(int n){
		par.resize(n);
		iota(par.begin(), par.end(), 0ll);
	}
	int find(int node){
		if (par[node]==node) return node;
		return par[node]=find(par[node]);
	}
	void merge(int a, int b){
		a=find(a);
		b=find(b);
		if (ayahya()%2) swap(a,b);
		par[a]=b;
	}
};
int construct_roads(vector<int> x, vector<int> y) {
	map<pair<int,int>,int> mp;
	int n = x.size();
	for (int i = 0; i < n; ++i)
	{
		mp[{x[i],y[i]}]=i;
	}
	map<pair<int,int>,int> dikey;
	map<pair<int,int>,int> yatay;
	vector<bool> yat;
	vector<int> u;
	vector<int> v;
	vector<int> a;
	vector<int> b;
	DSU dsu(n);
	vector<int> sirr;

	for (int i = 0; i < n; i++){
		if (x[i]==2) sirr.push_back(i);
	}
	for (int i = 0; i < n; ++i)
	{
		if (x[i]==6) sirr.push_back(i);
	}
	for (int i = 0; i < n; ++i){
		if (x[i]==4) sirr.push_back(i);
	}
	for (int i = 0; i < n; ++i)
	{
		if (x[i]>6) sirr.push_back(i);
	}
	for (int j = 0; j < n; j++){
		int i = sirr[j];
		int xv = x[i];
		int yv = y[i];
		if (mp.count({xv+2,yv})){
			if (dsu.find(i)!=dsu.find(mp[{xv+2,yv}])){
				dsu.merge(i,mp[{xv+2,yv}]);
				yatay[{xv,yv}]=u.size();
				u.push_back(i);
				v.push_back(mp[{xv+2,yv}]);
				yat.push_back(true);
				a.push_back(-23);
				b.push_back(-23);
			}
		}
		if (mp.count({xv,yv+2})){
			if (dsu.find(i)!=dsu.find(mp[{xv,yv+2}])){
				dsu.merge(i,mp[{xv,yv+2}]);
				dikey[{xv,yv}]=u.size();
				u.push_back(i);
				v.push_back(mp[{xv,yv+2}]);
				yat.push_back(false);
				a.push_back(-23);
				b.push_back(-23);
			}
		}
	}
	if (u.size()!=n-1) return 0;
	map<pair<int,int>,bool> kap;
	int mini = *min_element(x.begin(), x.end());
	int minj = *min_element(y.begin(), y.end());
	int mani = *max_element(x.begin(), x.end());
	int manj = *max_element(y.begin(), y.end());
	vector<int> sir;
	vector<int> viss(u.size(),false);
	for (int i = 0; i < u.size(); i++){
		if (x[u[i]]==mini && !yat[i]){
			a[i]=x[u[i]]-1;
			b[i]=y[u[i]]+1;
			viss[i]=true;
			continue;
		}
		if (x[u[i]]==mani && !yat[i]){
			a[i]=x[u[i]]+1;
			b[i]=y[u[i]]+1;
			viss[i]=true;
			continue;
		}
		if (y[u[i]]==minj & yat[i]){
			a[i]=x[u[i]]+1;
			b[i]=y[u[i]]-1;
			viss[i]=true;
			continue;
		}
		if (y[u[i]]==manj && yat[i]){
			a[i]=x[u[i]]+1;
			b[i]=y[u[i]]+1;
			viss[i]=true;
			continue;
		}
	}
	for (int i = 0; i < u.size(); ++i)
	{
		if (viss[i]) continue;
		int xv = x[u[i]];
		int yv = y[u[i]];
		int ss = yatay.count({xv,yv}) + dikey.count({xv,yv}) + yatay.count({xv-2,yv}) + dikey.count({xv,yv-2});
		if (ss==4){
			sir.push_back(i);
			viss[i]=true;
		}
	}
	for (int i = 0; i < u.size(); ++i)
	{
		if (viss[i]) continue;
		int xv = x[u[i]];
		int yv = y[u[i]];
		int ss = yatay.count({xv,yv}) + dikey.count({xv,yv}) + yatay.count({xv-2,yv}) + dikey.count({xv,yv-2});
		int kk = yatay.count({xv,yv}) + yatay.count({xv-2,yv});
		if (ss>=3 && (kk>(ss-kk)) == yat[i]){
			sir.push_back(i);
			viss[i]=true;
		}
	}
	for (int i = 0; i < u.size(); ++i)
	{
		if (viss[i]) continue;
		sir.push_back(i);
	}
	for (int i = 0; i < sir.size(); i++){
		queue<int> q;
		q.push(sir[i]);
		while (q.size()){
			int ed = q.front();
			q.pop();
			if (a[ed]!=-23) continue;
			if (yat[ed]){
				if (!kap[{x[u[ed]]+1,y[u[ed]]+1}]){
					kap[{x[u[ed]]+1,y[u[ed]]+1}]=true;
					a[ed]=x[u[ed]]+1;
					b[ed]=y[u[ed]]+1;
				}
				else {
					if (kap[{x[u[ed]]+1,y[u[ed]]-1}]) return 0;
					kap[{x[u[ed]]+1,y[u[ed]]-1}]=true;
					a[ed]=x[u[ed]]+1;
					b[ed]=y[u[ed]]-1;
				}
			}
			else {
				if (!kap[{x[u[ed]]+1,y[u[ed]]+1}]){
					kap[{x[u[ed]]+1,y[u[ed]]+1}]=true;
					a[ed]=x[u[ed]]+1;
					b[ed]=y[u[ed]]+1;
				}
				else {
					if (kap[{x[u[ed]]-1,y[u[ed]]+1}]) return 0;
					kap[{x[u[ed]]-1,y[u[ed]]+1}]=true;
					a[ed]=x[u[ed]]-1;
					b[ed]=y[u[ed]]+1;
				}
			}
			pair<int,int> pr;
			pr={a[ed]-1,b[ed]-1};
			if (yatay.count(pr) && yatay[pr]!=ed && a[yatay[pr]]==-23){
				q.push(yatay[pr]);
			}
			pr={a[ed]-1,b[ed]+1};
			if (yatay.count(pr) && yatay[pr]!=ed && a[yatay[pr]]==-23){
				q.push(yatay[pr]);
			}			
			pr={a[ed]-1,b[ed]-1};
			if (dikey.count(pr) && dikey[pr]!=ed && a[dikey[pr]]==-23){
				q.push(dikey[pr]);
			}			
			pr={a[ed]+1,b[ed]-1};
			if (dikey.count(pr) && dikey[pr]!=ed && a[dikey[pr]]==-23){
				q.push(dikey[pr]);
			}
		}
	}
	build(u,v,a,b);
	return 1;
}

Compilation message

parks.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      | 
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:112:14: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  112 |  if (u.size()!=n-1) return 0;
      |      ~~~~~~~~^~~~~
parks.cpp:120:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  120 |  for (int i = 0; i < u.size(); i++){
      |                  ~~^~~~~~~~~~
parks.cpp:133:14: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
  133 |   if (y[u[i]]==minj & yat[i]){
parks.cpp:146:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  146 |  for (int i = 0; i < u.size(); ++i)
      |                  ~~^~~~~~~~~~
parks.cpp:157:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  157 |  for (int i = 0; i < u.size(); ++i)
      |                  ~~^~~~~~~~~~
parks.cpp:169:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  169 |  for (int i = 0; i < u.size(); ++i)
      |                  ~~^~~~~~~~~~
parks.cpp:174:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  174 |  for (int i = 0; i < sir.size(); i++){
      |                  ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 234 ms 20532 KB Output is correct
10 Correct 13 ms 2516 KB Output is correct
11 Correct 76 ms 11176 KB Output is correct
12 Correct 19 ms 3688 KB Output is correct
13 Correct 49 ms 7696 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 234 ms 20496 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 234 ms 20532 KB Output is correct
10 Correct 13 ms 2516 KB Output is correct
11 Correct 76 ms 11176 KB Output is correct
12 Correct 19 ms 3688 KB Output is correct
13 Correct 49 ms 7696 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 234 ms 20496 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 304 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 304 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 893 ms 47324 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 3 ms 564 KB Output is correct
26 Correct 4 ms 724 KB Output is correct
27 Correct 6 ms 980 KB Output is correct
28 Correct 297 ms 19240 KB Output is correct
29 Correct 540 ms 28460 KB Output is correct
30 Correct 693 ms 38060 KB Output is correct
31 Correct 972 ms 47468 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 304 KB Output is correct
34 Correct 1 ms 300 KB Output is correct
35 Correct 1 ms 304 KB Output is correct
36 Correct 1 ms 300 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 3 ms 568 KB Output is correct
44 Correct 4 ms 824 KB Output is correct
45 Correct 383 ms 22596 KB Output is correct
46 Correct 578 ms 32908 KB Output is correct
47 Correct 609 ms 32884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 234 ms 20532 KB Output is correct
10 Correct 13 ms 2516 KB Output is correct
11 Correct 76 ms 11176 KB Output is correct
12 Correct 19 ms 3688 KB Output is correct
13 Correct 49 ms 7696 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 234 ms 20496 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 304 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 304 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 893 ms 47324 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 3 ms 564 KB Output is correct
26 Correct 4 ms 724 KB Output is correct
27 Correct 6 ms 980 KB Output is correct
28 Correct 297 ms 19240 KB Output is correct
29 Correct 540 ms 28460 KB Output is correct
30 Correct 693 ms 38060 KB Output is correct
31 Correct 972 ms 47468 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 304 KB Output is correct
34 Correct 1 ms 300 KB Output is correct
35 Correct 1 ms 304 KB Output is correct
36 Correct 1 ms 300 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 3 ms 568 KB Output is correct
44 Correct 4 ms 824 KB Output is correct
45 Correct 383 ms 22596 KB Output is correct
46 Correct 578 ms 32908 KB Output is correct
47 Correct 609 ms 32884 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 828 ms 45172 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 4 ms 700 KB Output is correct
58 Correct 12 ms 1748 KB Output is correct
59 Correct 14 ms 2004 KB Output is correct
60 Correct 303 ms 22740 KB Output is correct
61 Correct 512 ms 30788 KB Output is correct
62 Correct 617 ms 37568 KB Output is correct
63 Correct 844 ms 44992 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 520 ms 40644 KB Output is correct
68 Correct 531 ms 40612 KB Output is correct
69 Correct 541 ms 40556 KB Output is correct
70 Correct 5 ms 980 KB Output is correct
71 Correct 10 ms 1624 KB Output is correct
72 Correct 444 ms 23964 KB Output is correct
73 Correct 710 ms 35916 KB Output is correct
74 Correct 1057 ms 47428 KB Output is correct
75 Correct 808 ms 43436 KB Output is correct
76 Correct 603 ms 40564 KB Output is correct
77 Correct 6 ms 1108 KB Output is correct
78 Correct 12 ms 1852 KB Output is correct
79 Correct 424 ms 23376 KB Output is correct
80 Correct 613 ms 35140 KB Output is correct
81 Correct 1046 ms 46540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 234 ms 20532 KB Output is correct
10 Correct 13 ms 2516 KB Output is correct
11 Correct 76 ms 11176 KB Output is correct
12 Correct 19 ms 3688 KB Output is correct
13 Correct 49 ms 7696 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 234 ms 20496 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1053 ms 54104 KB Output is correct
21 Correct 1339 ms 56200 KB Output is correct
22 Correct 1109 ms 56276 KB Output is correct
23 Correct 611 ms 39104 KB Output is correct
24 Correct 324 ms 19604 KB Output is correct
25 Correct 696 ms 34992 KB Output is correct
26 Correct 675 ms 35028 KB Output is correct
27 Correct 1517 ms 55316 KB Output is correct
28 Correct 1431 ms 55268 KB Output is correct
29 Correct 1434 ms 55328 KB Output is correct
30 Correct 1494 ms 55368 KB Output is correct
31 Correct 0 ms 308 KB Output is correct
32 Correct 62 ms 4552 KB Output is correct
33 Correct 117 ms 10412 KB Output is correct
34 Correct 1460 ms 56468 KB Output is correct
35 Correct 16 ms 2004 KB Output is correct
36 Correct 103 ms 9128 KB Output is correct
37 Correct 276 ms 18136 KB Output is correct
38 Correct 513 ms 22936 KB Output is correct
39 Correct 777 ms 31216 KB Output is correct
40 Correct 1079 ms 39916 KB Output is correct
41 Correct 1343 ms 48276 KB Output is correct
42 Correct 1685 ms 56440 KB Output is correct
43 Correct 1 ms 304 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 1 ms 304 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 300 KB Output is correct
54 Correct 3 ms 596 KB Output is correct
55 Correct 4 ms 852 KB Output is correct
56 Correct 346 ms 23312 KB Output is correct
57 Correct 598 ms 33892 KB Output is correct
58 Correct 554 ms 33992 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 300 KB Output is correct
62 Correct 565 ms 42152 KB Output is correct
63 Correct 566 ms 42128 KB Output is correct
64 Correct 630 ms 41988 KB Output is correct
65 Correct 6 ms 952 KB Output is correct
66 Correct 10 ms 1600 KB Output is correct
67 Correct 388 ms 24576 KB Output is correct
68 Correct 711 ms 37120 KB Output is correct
69 Correct 1049 ms 48940 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 234 ms 20532 KB Output is correct
10 Correct 13 ms 2516 KB Output is correct
11 Correct 76 ms 11176 KB Output is correct
12 Correct 19 ms 3688 KB Output is correct
13 Correct 49 ms 7696 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 234 ms 20496 KB Output is correct
17 Correct 593 ms 40660 KB Output is correct
18 Correct 939 ms 49280 KB Output is correct
19 Correct 1256 ms 56192 KB Output is correct
20 Correct 1642 ms 54220 KB Output is correct
21 Correct 1359 ms 48708 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 148 ms 9100 KB Output is correct
24 Correct 33 ms 3796 KB Output is correct
25 Correct 179 ms 13100 KB Output is correct
26 Correct 333 ms 21520 KB Output is correct
27 Correct 687 ms 28228 KB Output is correct
28 Correct 916 ms 35372 KB Output is correct
29 Correct 1252 ms 42736 KB Output is correct
30 Correct 1408 ms 49500 KB Output is correct
31 Correct 1776 ms 56328 KB Output is correct
32 Correct 810 ms 44816 KB Output is correct
33 Correct 631 ms 42172 KB Output is correct
34 Correct 7 ms 1108 KB Output is correct
35 Correct 12 ms 1900 KB Output is correct
36 Correct 393 ms 24048 KB Output is correct
37 Correct 677 ms 36400 KB Output is correct
38 Correct 1089 ms 48144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 234 ms 20532 KB Output is correct
10 Correct 13 ms 2516 KB Output is correct
11 Correct 76 ms 11176 KB Output is correct
12 Correct 19 ms 3688 KB Output is correct
13 Correct 49 ms 7696 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 234 ms 20496 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 304 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 304 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 893 ms 47324 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 3 ms 564 KB Output is correct
26 Correct 4 ms 724 KB Output is correct
27 Correct 6 ms 980 KB Output is correct
28 Correct 297 ms 19240 KB Output is correct
29 Correct 540 ms 28460 KB Output is correct
30 Correct 693 ms 38060 KB Output is correct
31 Correct 972 ms 47468 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 304 KB Output is correct
34 Correct 1 ms 300 KB Output is correct
35 Correct 1 ms 304 KB Output is correct
36 Correct 1 ms 300 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 3 ms 568 KB Output is correct
44 Correct 4 ms 824 KB Output is correct
45 Correct 383 ms 22596 KB Output is correct
46 Correct 578 ms 32908 KB Output is correct
47 Correct 609 ms 32884 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 828 ms 45172 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 4 ms 700 KB Output is correct
58 Correct 12 ms 1748 KB Output is correct
59 Correct 14 ms 2004 KB Output is correct
60 Correct 303 ms 22740 KB Output is correct
61 Correct 512 ms 30788 KB Output is correct
62 Correct 617 ms 37568 KB Output is correct
63 Correct 844 ms 44992 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 520 ms 40644 KB Output is correct
68 Correct 531 ms 40612 KB Output is correct
69 Correct 541 ms 40556 KB Output is correct
70 Correct 5 ms 980 KB Output is correct
71 Correct 10 ms 1624 KB Output is correct
72 Correct 444 ms 23964 KB Output is correct
73 Correct 710 ms 35916 KB Output is correct
74 Correct 1057 ms 47428 KB Output is correct
75 Correct 808 ms 43436 KB Output is correct
76 Correct 603 ms 40564 KB Output is correct
77 Correct 6 ms 1108 KB Output is correct
78 Correct 12 ms 1852 KB Output is correct
79 Correct 424 ms 23376 KB Output is correct
80 Correct 613 ms 35140 KB Output is correct
81 Correct 1046 ms 46540 KB Output is correct
82 Correct 1 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1053 ms 54104 KB Output is correct
86 Correct 1339 ms 56200 KB Output is correct
87 Correct 1109 ms 56276 KB Output is correct
88 Correct 611 ms 39104 KB Output is correct
89 Correct 324 ms 19604 KB Output is correct
90 Correct 696 ms 34992 KB Output is correct
91 Correct 675 ms 35028 KB Output is correct
92 Correct 1517 ms 55316 KB Output is correct
93 Correct 1431 ms 55268 KB Output is correct
94 Correct 1434 ms 55328 KB Output is correct
95 Correct 1494 ms 55368 KB Output is correct
96 Correct 0 ms 308 KB Output is correct
97 Correct 62 ms 4552 KB Output is correct
98 Correct 117 ms 10412 KB Output is correct
99 Correct 1460 ms 56468 KB Output is correct
100 Correct 16 ms 2004 KB Output is correct
101 Correct 103 ms 9128 KB Output is correct
102 Correct 276 ms 18136 KB Output is correct
103 Correct 513 ms 22936 KB Output is correct
104 Correct 777 ms 31216 KB Output is correct
105 Correct 1079 ms 39916 KB Output is correct
106 Correct 1343 ms 48276 KB Output is correct
107 Correct 1685 ms 56440 KB Output is correct
108 Correct 1 ms 304 KB Output is correct
109 Correct 0 ms 212 KB Output is correct
110 Correct 1 ms 212 KB Output is correct
111 Correct 1 ms 212 KB Output is correct
112 Correct 1 ms 212 KB Output is correct
113 Correct 1 ms 212 KB Output is correct
114 Correct 1 ms 300 KB Output is correct
115 Correct 1 ms 304 KB Output is correct
116 Correct 1 ms 212 KB Output is correct
117 Correct 1 ms 212 KB Output is correct
118 Correct 1 ms 300 KB Output is correct
119 Correct 3 ms 596 KB Output is correct
120 Correct 4 ms 852 KB Output is correct
121 Correct 346 ms 23312 KB Output is correct
122 Correct 598 ms 33892 KB Output is correct
123 Correct 554 ms 33992 KB Output is correct
124 Correct 1 ms 212 KB Output is correct
125 Correct 1 ms 212 KB Output is correct
126 Correct 1 ms 300 KB Output is correct
127 Correct 565 ms 42152 KB Output is correct
128 Correct 566 ms 42128 KB Output is correct
129 Correct 630 ms 41988 KB Output is correct
130 Correct 6 ms 952 KB Output is correct
131 Correct 10 ms 1600 KB Output is correct
132 Correct 388 ms 24576 KB Output is correct
133 Correct 711 ms 37120 KB Output is correct
134 Correct 1049 ms 48940 KB Output is correct
135 Correct 593 ms 40660 KB Output is correct
136 Correct 939 ms 49280 KB Output is correct
137 Correct 1256 ms 56192 KB Output is correct
138 Correct 1642 ms 54220 KB Output is correct
139 Correct 1359 ms 48708 KB Output is correct
140 Correct 1 ms 212 KB Output is correct
141 Correct 148 ms 9100 KB Output is correct
142 Correct 33 ms 3796 KB Output is correct
143 Correct 179 ms 13100 KB Output is correct
144 Correct 333 ms 21520 KB Output is correct
145 Correct 687 ms 28228 KB Output is correct
146 Correct 916 ms 35372 KB Output is correct
147 Correct 1252 ms 42736 KB Output is correct
148 Correct 1408 ms 49500 KB Output is correct
149 Correct 1776 ms 56328 KB Output is correct
150 Correct 810 ms 44816 KB Output is correct
151 Correct 631 ms 42172 KB Output is correct
152 Correct 7 ms 1108 KB Output is correct
153 Correct 12 ms 1900 KB Output is correct
154 Correct 393 ms 24048 KB Output is correct
155 Correct 677 ms 36400 KB Output is correct
156 Correct 1089 ms 48144 KB Output is correct
157 Correct 1 ms 212 KB Output is correct
158 Correct 1 ms 212 KB Output is correct
159 Correct 1 ms 212 KB Output is correct
160 Correct 1 ms 300 KB Output is correct
161 Incorrect 1158 ms 37684 KB Solution announced impossible, but it is possible.
162 Halted 0 ms 0 KB -