Submission #657303

# Submission time Handle Problem Language Result Execution time Memory
657303 2022-11-09T13:11:11 Z PoPularPlusPlus Food Court (JOI21_foodcourt) C++17
100 / 100
631 ms 58804 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long 
#define pb(e) push_back(e)
#define sv(a) sort(a.begin(),a.end())
#define sa(a,n) sort(a,a+n)
#define mp(a,b) make_pair(a,b)
#define vf first
#define vs second
#define ar array
#define all(x) x.begin(),x.end()
const int inf = 0x3f3f3f3f;
const int mod = 1000000007; 
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
bool remender(ll a , ll b){return a%b;}

//freopen("problemname.in", "r", stdin);
//freopen("problemname.out", "w", stdout);

struct item {
	ll a , b;
};

struct Seg {
	vector<item> v;
	vector<ll> arr;
	vector<ll> neg;
	int siz;
	
	item nutral = {0,0};
	
	item merge(item x , item y , ll& negg){
		ll a = min(x.b , y.a);
		y.a -= a;
		negg += a;
		x.b -= a;
		x.a += y.a;
		x.b += y.b;
		return x;
	}
	
	void init(int n){
		siz = 1;
		while(siz < n)siz *= 2;
		
		v.assign(siz * 2 , nutral);
		arr.assign(siz * 2 , 0);
		neg.assign(siz * 2 , 0);
	}
	
	pair<ll,ll> find(int i , int x , int lx , int rx){
		if(rx - lx == 1){
			arr[x] -= v[x].a;
			neg[x] += v[x].a + (arr[x] < 0 ? arr[x] : 0);
			arr[x] = max(arr[x] , 0LL);
			arr[x] += v[x].b;
			v[x] = nutral;
			return mp(arr[x],neg[x]);
		}
		int m = (lx + rx)/2;
		v[2 * x + 1] = merge(v[2 * x + 1] , v[x] , neg[2 * x + 1]);
		v[2 * x + 2] = merge(v[2 * x + 2] , v[x] , neg[2 * x + 2]);
		v[x] = nutral;
		neg[2 * x + 1] += neg[x];
		neg[2 * x + 2] += neg[x];
		neg[x] = 0;
		if(i < m){
			return find(i , 2 * x + 1 , lx , m);
		}
		else return find(i , 2 * x + 2 , m , rx);
	}
	
	pair<ll,ll> find(int i){
		return find(i , 0 , 0 , siz);
	}
	
	void range(int l , int r , item it , int x , int lx , int rx){
		if(l >= rx || r <= lx)return;
		if(lx >= l && rx <= r){
			v[x] = merge(v[x] , it , neg[x]);
			return;
		}
		v[2 * x + 1] = merge(v[2 * x + 1] , v[x] , neg[2 * x + 1]);
		v[2 * x + 2] = merge(v[2 * x + 2] , v[x] , neg[2 * x + 2]);
		v[x] = nutral;
		neg[2 * x + 1] += neg[x];
		neg[2 * x + 2] += neg[x];
		neg[x] = 0;
		int m = (lx + rx)/2;
		range(l , r , it , 2 * x + 1 , lx , m);
		range(l , r , it , 2 * x + 2 , m , rx);
	}
	
	void range(int l , int r , item it){
		range(l , r , it , 0 , 0 , siz);
	}
};

struct Seg2 {
		
	vector<pair<int,ll>> v1;	
	int siz;
	vector<ll> lazy;
	vector<ll> mn;
	vector<ll> mn1;
	ll nutral = 1e18;
	
	void init(int n){
		siz = 1;
		while(siz < n)siz *= 2;
		
		lazy.assign(siz * 2 , 0);
		mn.assign(siz * 2 , nutral);
		mn1.assign(siz * 2 , nutral);
	}
	
	void build(vector<ll>& a , int x , int lx , int rx){
		if(rx - lx == 1){
			if(lx < (int)a.size()){
				mn[x] = a[lx];
				mn1[x] = a[lx];
			}
			return;
		}
		int m = (lx + rx)/2;
		build(a , 2 * x + 1 , lx , m);
		build(a , 2 * x + 2 , m , rx);
		mn1[x] = min(mn1[2 * x + 1] , mn1[2 * x + 2]);
	}
	
	void build(vector<ll>& a){
		build(a,0,0,siz);
	}
	
	void set(int i , ll v , int x , int lx, int rx){
		if(rx - lx == 1){
			mn[x] = v;
			mn1[x] = v - lazy[x];
			return;
		}
		int m = (lx + rx)/2;
		if(i < m){
			set(i , v , 2 * x + 1 , lx , m);
		}
		else {
			set(i , v , 2 * x + 2 , m , rx);
		}
		mn1[x] = min(mn1[2 * x + 1] , mn1[2 * x + 2]) - lazy[x];
	}
	
	void set(int i , ll v){
		set(i , v , 0 , 0 , siz);
	}
	
	void range(int l , int r , ll v , int x , int lx, int rx){
		if(rx - lx > 1){
			lazy[2 * x + 1] += lazy[x];
			lazy[2 * x + 2] += lazy[x];
			mn1[x] -= lazy[x];
			//cout << b << ' ' << lx << ' ' << rx << ' ' << v << ' ' << mn1[x] << ' ' << x << ' ' ;
			lazy[x] = 0;
		}
		else mn1[x] = mn[x] - lazy[x];
		if(l >= rx || lx >= r){
			return;
		}
		if(rx - lx == 1){
			//cout << lx << ' ' << rx << ' ';
			//cout << lx << ' ' << v << ' ' << mn1[x] << '\n';
			lazy[x] += v;
			mn1[x] = mn[x] - lazy[x];
			if(lazy[x] >= mn[x]){
				v1.pb(mp(lx,lazy[x]));
			}
			//cout << lazy[x] << ' ' << v << ' ' << mn1[x] << ' ' << lx << ' ' << rx << '\n';
			return;
		}
		if(lx >= l && rx <= r && v < mn1[x]){
			//cout << lx << ' ' << rx << ' ';
			//cout << lazy[2 * x + 1] << ' ' << lazy[2 * x + 2] << ' ';
			//cout << b << ' ' << lx << ' '  << rx << ' ' << v << ' ' << mn1[x] << ' ' << lazy[x] <<  '\n';
			//cout << lx << ' ' << rx << ' ' << v << ' ' << mn1[x] << '\n';
			lazy[2 * x + 1] += v;
			lazy[2 * x + 2] += v;
			mn1[x] -= v;
			return;
		}
		//if(b)cout << "came";
		int m = (lx + rx)/2;
		//cout << lx << ' ' << rx << ' ';
		range(l , r , v , 2 * x + 1 , lx , m);
		range(l , r , v , 2 * x + 2 , m , rx);
		mn1[x] = min(mn1[2 *x + 1] , mn1[2 * x + 2]);
	}
	
	void range(int l , int r , ll v){
		v1.clear();
		range(l , r , v , 0 , 0 , siz);
	}
};

void solve(){
	int n , m , q;
	cin >> n >> m >> q;
	Seg st;
	st.init(n);
	item it;
	int ans[q];
	vector<pair<ll,int>> v[n];
	for(int i = 0; i < n; i++){
		v[i].pb(mp(1e18 , 1e9));
	}
	vector<pair<pair<int,int> , pair<int,int>>> queries;
	for(int i = 0; i < q; i++){
		int ti;
		cin >> ti;
		if(ti == 1){
			int l , r, c , k;
			cin >> l >> r >> c >> k;
			it.a = 0;
			it.b = k;
			st.range(l-1 , r , it);
			ans[i] = -1;
			queries.pb(mp(mp(l-1 , r) , mp(c,  k)));
		}
		else if(ti == 2){
			int l , r , k;
			cin >> l >> r >> k;
			it.a = k;
			it.b = 0;
			st.range(l -1 , r , it);
			ans[i] = -1;
		}
		else {
			ll a , b;
			cin >> a >> b;
			pair<ll,ll> x = st.find(a-1);
			if(x.vf >= b){
				v[a-1].pb(mp(b + x.vs , i));
				ans[i] = -2;
			}
			else ans[i] = 0;
		}
	}
	int pos[n];
	memset(pos , 0 , sizeof pos);
	vector<ll> a(n);
	for(int i = 0; i < n; i++){
		sv(v[i]);
		a[i] = v[i][0].vf;
	}
	Seg2 st2;
	st2.init(n);
	st2.build(a);
	
	for(auto i : queries){
		st2.range(i.vf.vf , i.vf.vs , i.vs.vs);
		for(auto j : st2.v1){
			while(v[j.vf][pos[j.vf]].vf <= j.vs){
				ans[v[j.vf][pos[j.vf]].vs] = i.vs.vf;
				pos[j.vf]++;
			}
			st2.set(j.vf , v[j.vf][pos[j.vf]].vf);
		}
		//cout << '\n';
	}
	for(int i = 0; i < q; i++){
		if(ans[i] != -1)
		cout << ans[i] << '\n';
	}
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
	//int t;cin >> t;while(t--)
	solve();
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 3 ms 736 KB Output is correct
3 Correct 2 ms 716 KB Output is correct
4 Correct 2 ms 724 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 3 ms 724 KB Output is correct
8 Correct 2 ms 744 KB Output is correct
9 Correct 2 ms 724 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 3 ms 724 KB Output is correct
12 Correct 2 ms 740 KB Output is correct
13 Correct 2 ms 724 KB Output is correct
14 Correct 2 ms 716 KB Output is correct
15 Correct 2 ms 716 KB Output is correct
16 Correct 2 ms 724 KB Output is correct
17 Correct 2 ms 596 KB Output is correct
18 Correct 3 ms 724 KB Output is correct
19 Correct 3 ms 712 KB Output is correct
20 Correct 4 ms 712 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 3 ms 736 KB Output is correct
3 Correct 2 ms 716 KB Output is correct
4 Correct 2 ms 724 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 3 ms 724 KB Output is correct
8 Correct 2 ms 744 KB Output is correct
9 Correct 2 ms 724 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 3 ms 724 KB Output is correct
12 Correct 2 ms 740 KB Output is correct
13 Correct 2 ms 724 KB Output is correct
14 Correct 2 ms 716 KB Output is correct
15 Correct 2 ms 716 KB Output is correct
16 Correct 2 ms 724 KB Output is correct
17 Correct 2 ms 596 KB Output is correct
18 Correct 3 ms 724 KB Output is correct
19 Correct 3 ms 712 KB Output is correct
20 Correct 4 ms 712 KB Output is correct
21 Correct 3 ms 724 KB Output is correct
22 Correct 3 ms 744 KB Output is correct
23 Correct 3 ms 724 KB Output is correct
24 Correct 3 ms 744 KB Output is correct
25 Correct 2 ms 340 KB Output is correct
26 Correct 1 ms 364 KB Output is correct
27 Correct 3 ms 724 KB Output is correct
28 Correct 4 ms 744 KB Output is correct
29 Correct 3 ms 724 KB Output is correct
30 Correct 2 ms 724 KB Output is correct
31 Correct 3 ms 720 KB Output is correct
32 Correct 3 ms 724 KB Output is correct
33 Correct 2 ms 724 KB Output is correct
34 Correct 2 ms 716 KB Output is correct
35 Correct 2 ms 724 KB Output is correct
36 Correct 4 ms 724 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 3 ms 724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 74 ms 13844 KB Output is correct
2 Correct 71 ms 13932 KB Output is correct
3 Correct 70 ms 13748 KB Output is correct
4 Correct 91 ms 13668 KB Output is correct
5 Correct 97 ms 13900 KB Output is correct
6 Correct 69 ms 13976 KB Output is correct
7 Correct 17 ms 2004 KB Output is correct
8 Correct 21 ms 2040 KB Output is correct
9 Correct 97 ms 13828 KB Output is correct
10 Correct 80 ms 13848 KB Output is correct
11 Correct 93 ms 13848 KB Output is correct
12 Correct 72 ms 13884 KB Output is correct
13 Correct 63 ms 12304 KB Output is correct
14 Correct 83 ms 13972 KB Output is correct
15 Correct 79 ms 12848 KB Output is correct
16 Correct 83 ms 14168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 440 ms 52460 KB Output is correct
2 Correct 328 ms 49540 KB Output is correct
3 Correct 518 ms 56328 KB Output is correct
4 Correct 393 ms 53460 KB Output is correct
5 Correct 367 ms 49592 KB Output is correct
6 Correct 506 ms 56584 KB Output is correct
7 Correct 81 ms 7968 KB Output is correct
8 Correct 84 ms 8332 KB Output is correct
9 Correct 574 ms 57788 KB Output is correct
10 Correct 631 ms 57784 KB Output is correct
11 Correct 478 ms 56220 KB Output is correct
12 Correct 474 ms 56016 KB Output is correct
13 Correct 495 ms 55960 KB Output is correct
14 Correct 514 ms 55936 KB Output is correct
15 Correct 499 ms 55868 KB Output is correct
16 Correct 467 ms 56032 KB Output is correct
17 Correct 487 ms 56080 KB Output is correct
18 Correct 484 ms 56000 KB Output is correct
19 Correct 477 ms 55976 KB Output is correct
20 Correct 461 ms 55912 KB Output is correct
21 Correct 494 ms 55932 KB Output is correct
22 Correct 476 ms 55876 KB Output is correct
23 Correct 465 ms 55868 KB Output is correct
24 Correct 525 ms 56048 KB Output is correct
25 Correct 394 ms 51932 KB Output is correct
26 Correct 420 ms 55980 KB Output is correct
27 Correct 393 ms 56300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 3 ms 736 KB Output is correct
3 Correct 2 ms 716 KB Output is correct
4 Correct 2 ms 724 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 3 ms 724 KB Output is correct
8 Correct 2 ms 744 KB Output is correct
9 Correct 2 ms 724 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 3 ms 724 KB Output is correct
12 Correct 2 ms 740 KB Output is correct
13 Correct 2 ms 724 KB Output is correct
14 Correct 2 ms 716 KB Output is correct
15 Correct 2 ms 716 KB Output is correct
16 Correct 2 ms 724 KB Output is correct
17 Correct 2 ms 596 KB Output is correct
18 Correct 3 ms 724 KB Output is correct
19 Correct 3 ms 712 KB Output is correct
20 Correct 4 ms 712 KB Output is correct
21 Correct 74 ms 13844 KB Output is correct
22 Correct 71 ms 13932 KB Output is correct
23 Correct 70 ms 13748 KB Output is correct
24 Correct 91 ms 13668 KB Output is correct
25 Correct 97 ms 13900 KB Output is correct
26 Correct 69 ms 13976 KB Output is correct
27 Correct 17 ms 2004 KB Output is correct
28 Correct 21 ms 2040 KB Output is correct
29 Correct 97 ms 13828 KB Output is correct
30 Correct 80 ms 13848 KB Output is correct
31 Correct 93 ms 13848 KB Output is correct
32 Correct 72 ms 13884 KB Output is correct
33 Correct 63 ms 12304 KB Output is correct
34 Correct 83 ms 13972 KB Output is correct
35 Correct 79 ms 12848 KB Output is correct
36 Correct 83 ms 14168 KB Output is correct
37 Correct 98 ms 13412 KB Output is correct
38 Correct 78 ms 13340 KB Output is correct
39 Correct 15 ms 1748 KB Output is correct
40 Correct 17 ms 1872 KB Output is correct
41 Correct 96 ms 14032 KB Output is correct
42 Correct 127 ms 14020 KB Output is correct
43 Correct 94 ms 14096 KB Output is correct
44 Correct 88 ms 14008 KB Output is correct
45 Correct 91 ms 14108 KB Output is correct
46 Correct 95 ms 14096 KB Output is correct
47 Correct 62 ms 13980 KB Output is correct
48 Correct 101 ms 14020 KB Output is correct
49 Correct 65 ms 11964 KB Output is correct
50 Correct 81 ms 13588 KB Output is correct
51 Correct 114 ms 14060 KB Output is correct
52 Correct 99 ms 14020 KB Output is correct
53 Correct 69 ms 13148 KB Output is correct
54 Correct 76 ms 14224 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 105 ms 14672 KB Output is correct
2 Correct 107 ms 14436 KB Output is correct
3 Correct 126 ms 15192 KB Output is correct
4 Correct 84 ms 13892 KB Output is correct
5 Correct 89 ms 14616 KB Output is correct
6 Correct 105 ms 15240 KB Output is correct
7 Correct 23 ms 2764 KB Output is correct
8 Correct 22 ms 2768 KB Output is correct
9 Correct 107 ms 15096 KB Output is correct
10 Correct 72 ms 13600 KB Output is correct
11 Correct 103 ms 15100 KB Output is correct
12 Correct 113 ms 15168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 3 ms 736 KB Output is correct
3 Correct 2 ms 716 KB Output is correct
4 Correct 2 ms 724 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 3 ms 724 KB Output is correct
8 Correct 2 ms 744 KB Output is correct
9 Correct 2 ms 724 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 3 ms 724 KB Output is correct
12 Correct 2 ms 740 KB Output is correct
13 Correct 2 ms 724 KB Output is correct
14 Correct 2 ms 716 KB Output is correct
15 Correct 2 ms 716 KB Output is correct
16 Correct 2 ms 724 KB Output is correct
17 Correct 2 ms 596 KB Output is correct
18 Correct 3 ms 724 KB Output is correct
19 Correct 3 ms 712 KB Output is correct
20 Correct 4 ms 712 KB Output is correct
21 Correct 3 ms 724 KB Output is correct
22 Correct 3 ms 744 KB Output is correct
23 Correct 3 ms 724 KB Output is correct
24 Correct 3 ms 744 KB Output is correct
25 Correct 2 ms 340 KB Output is correct
26 Correct 1 ms 364 KB Output is correct
27 Correct 3 ms 724 KB Output is correct
28 Correct 4 ms 744 KB Output is correct
29 Correct 3 ms 724 KB Output is correct
30 Correct 2 ms 724 KB Output is correct
31 Correct 3 ms 720 KB Output is correct
32 Correct 3 ms 724 KB Output is correct
33 Correct 2 ms 724 KB Output is correct
34 Correct 2 ms 716 KB Output is correct
35 Correct 2 ms 724 KB Output is correct
36 Correct 4 ms 724 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 3 ms 724 KB Output is correct
39 Correct 74 ms 13844 KB Output is correct
40 Correct 71 ms 13932 KB Output is correct
41 Correct 70 ms 13748 KB Output is correct
42 Correct 91 ms 13668 KB Output is correct
43 Correct 97 ms 13900 KB Output is correct
44 Correct 69 ms 13976 KB Output is correct
45 Correct 17 ms 2004 KB Output is correct
46 Correct 21 ms 2040 KB Output is correct
47 Correct 97 ms 13828 KB Output is correct
48 Correct 80 ms 13848 KB Output is correct
49 Correct 93 ms 13848 KB Output is correct
50 Correct 72 ms 13884 KB Output is correct
51 Correct 63 ms 12304 KB Output is correct
52 Correct 83 ms 13972 KB Output is correct
53 Correct 79 ms 12848 KB Output is correct
54 Correct 83 ms 14168 KB Output is correct
55 Correct 98 ms 13412 KB Output is correct
56 Correct 78 ms 13340 KB Output is correct
57 Correct 15 ms 1748 KB Output is correct
58 Correct 17 ms 1872 KB Output is correct
59 Correct 96 ms 14032 KB Output is correct
60 Correct 127 ms 14020 KB Output is correct
61 Correct 94 ms 14096 KB Output is correct
62 Correct 88 ms 14008 KB Output is correct
63 Correct 91 ms 14108 KB Output is correct
64 Correct 95 ms 14096 KB Output is correct
65 Correct 62 ms 13980 KB Output is correct
66 Correct 101 ms 14020 KB Output is correct
67 Correct 65 ms 11964 KB Output is correct
68 Correct 81 ms 13588 KB Output is correct
69 Correct 114 ms 14060 KB Output is correct
70 Correct 99 ms 14020 KB Output is correct
71 Correct 69 ms 13148 KB Output is correct
72 Correct 76 ms 14224 KB Output is correct
73 Correct 105 ms 14672 KB Output is correct
74 Correct 107 ms 14436 KB Output is correct
75 Correct 126 ms 15192 KB Output is correct
76 Correct 84 ms 13892 KB Output is correct
77 Correct 89 ms 14616 KB Output is correct
78 Correct 105 ms 15240 KB Output is correct
79 Correct 23 ms 2764 KB Output is correct
80 Correct 22 ms 2768 KB Output is correct
81 Correct 107 ms 15096 KB Output is correct
82 Correct 72 ms 13600 KB Output is correct
83 Correct 103 ms 15100 KB Output is correct
84 Correct 113 ms 15168 KB Output is correct
85 Correct 89 ms 13448 KB Output is correct
86 Correct 112 ms 14592 KB Output is correct
87 Correct 99 ms 14120 KB Output is correct
88 Correct 99 ms 14736 KB Output is correct
89 Correct 65 ms 12796 KB Output is correct
90 Correct 92 ms 14596 KB Output is correct
91 Correct 77 ms 12548 KB Output is correct
92 Correct 77 ms 12536 KB Output is correct
93 Correct 92 ms 14536 KB Output is correct
94 Correct 97 ms 14532 KB Output is correct
95 Correct 94 ms 14036 KB Output is correct
96 Correct 91 ms 14556 KB Output is correct
97 Correct 93 ms 14532 KB Output is correct
98 Correct 76 ms 12820 KB Output is correct
99 Correct 71 ms 14516 KB Output is correct
100 Correct 78 ms 13460 KB Output is correct
101 Correct 88 ms 14580 KB Output is correct
102 Correct 79 ms 14660 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 596 KB Output is correct
2 Correct 3 ms 736 KB Output is correct
3 Correct 2 ms 716 KB Output is correct
4 Correct 2 ms 724 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 3 ms 724 KB Output is correct
8 Correct 2 ms 744 KB Output is correct
9 Correct 2 ms 724 KB Output is correct
10 Correct 2 ms 724 KB Output is correct
11 Correct 3 ms 724 KB Output is correct
12 Correct 2 ms 740 KB Output is correct
13 Correct 2 ms 724 KB Output is correct
14 Correct 2 ms 716 KB Output is correct
15 Correct 2 ms 716 KB Output is correct
16 Correct 2 ms 724 KB Output is correct
17 Correct 2 ms 596 KB Output is correct
18 Correct 3 ms 724 KB Output is correct
19 Correct 3 ms 712 KB Output is correct
20 Correct 4 ms 712 KB Output is correct
21 Correct 3 ms 724 KB Output is correct
22 Correct 3 ms 744 KB Output is correct
23 Correct 3 ms 724 KB Output is correct
24 Correct 3 ms 744 KB Output is correct
25 Correct 2 ms 340 KB Output is correct
26 Correct 1 ms 364 KB Output is correct
27 Correct 3 ms 724 KB Output is correct
28 Correct 4 ms 744 KB Output is correct
29 Correct 3 ms 724 KB Output is correct
30 Correct 2 ms 724 KB Output is correct
31 Correct 3 ms 720 KB Output is correct
32 Correct 3 ms 724 KB Output is correct
33 Correct 2 ms 724 KB Output is correct
34 Correct 2 ms 716 KB Output is correct
35 Correct 2 ms 724 KB Output is correct
36 Correct 4 ms 724 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 3 ms 724 KB Output is correct
39 Correct 74 ms 13844 KB Output is correct
40 Correct 71 ms 13932 KB Output is correct
41 Correct 70 ms 13748 KB Output is correct
42 Correct 91 ms 13668 KB Output is correct
43 Correct 97 ms 13900 KB Output is correct
44 Correct 69 ms 13976 KB Output is correct
45 Correct 17 ms 2004 KB Output is correct
46 Correct 21 ms 2040 KB Output is correct
47 Correct 97 ms 13828 KB Output is correct
48 Correct 80 ms 13848 KB Output is correct
49 Correct 93 ms 13848 KB Output is correct
50 Correct 72 ms 13884 KB Output is correct
51 Correct 63 ms 12304 KB Output is correct
52 Correct 83 ms 13972 KB Output is correct
53 Correct 79 ms 12848 KB Output is correct
54 Correct 83 ms 14168 KB Output is correct
55 Correct 440 ms 52460 KB Output is correct
56 Correct 328 ms 49540 KB Output is correct
57 Correct 518 ms 56328 KB Output is correct
58 Correct 393 ms 53460 KB Output is correct
59 Correct 367 ms 49592 KB Output is correct
60 Correct 506 ms 56584 KB Output is correct
61 Correct 81 ms 7968 KB Output is correct
62 Correct 84 ms 8332 KB Output is correct
63 Correct 574 ms 57788 KB Output is correct
64 Correct 631 ms 57784 KB Output is correct
65 Correct 478 ms 56220 KB Output is correct
66 Correct 474 ms 56016 KB Output is correct
67 Correct 495 ms 55960 KB Output is correct
68 Correct 514 ms 55936 KB Output is correct
69 Correct 499 ms 55868 KB Output is correct
70 Correct 467 ms 56032 KB Output is correct
71 Correct 487 ms 56080 KB Output is correct
72 Correct 484 ms 56000 KB Output is correct
73 Correct 477 ms 55976 KB Output is correct
74 Correct 461 ms 55912 KB Output is correct
75 Correct 494 ms 55932 KB Output is correct
76 Correct 476 ms 55876 KB Output is correct
77 Correct 465 ms 55868 KB Output is correct
78 Correct 525 ms 56048 KB Output is correct
79 Correct 394 ms 51932 KB Output is correct
80 Correct 420 ms 55980 KB Output is correct
81 Correct 393 ms 56300 KB Output is correct
82 Correct 98 ms 13412 KB Output is correct
83 Correct 78 ms 13340 KB Output is correct
84 Correct 15 ms 1748 KB Output is correct
85 Correct 17 ms 1872 KB Output is correct
86 Correct 96 ms 14032 KB Output is correct
87 Correct 127 ms 14020 KB Output is correct
88 Correct 94 ms 14096 KB Output is correct
89 Correct 88 ms 14008 KB Output is correct
90 Correct 91 ms 14108 KB Output is correct
91 Correct 95 ms 14096 KB Output is correct
92 Correct 62 ms 13980 KB Output is correct
93 Correct 101 ms 14020 KB Output is correct
94 Correct 65 ms 11964 KB Output is correct
95 Correct 81 ms 13588 KB Output is correct
96 Correct 114 ms 14060 KB Output is correct
97 Correct 99 ms 14020 KB Output is correct
98 Correct 69 ms 13148 KB Output is correct
99 Correct 76 ms 14224 KB Output is correct
100 Correct 105 ms 14672 KB Output is correct
101 Correct 107 ms 14436 KB Output is correct
102 Correct 126 ms 15192 KB Output is correct
103 Correct 84 ms 13892 KB Output is correct
104 Correct 89 ms 14616 KB Output is correct
105 Correct 105 ms 15240 KB Output is correct
106 Correct 23 ms 2764 KB Output is correct
107 Correct 22 ms 2768 KB Output is correct
108 Correct 107 ms 15096 KB Output is correct
109 Correct 72 ms 13600 KB Output is correct
110 Correct 103 ms 15100 KB Output is correct
111 Correct 113 ms 15168 KB Output is correct
112 Correct 89 ms 13448 KB Output is correct
113 Correct 112 ms 14592 KB Output is correct
114 Correct 99 ms 14120 KB Output is correct
115 Correct 99 ms 14736 KB Output is correct
116 Correct 65 ms 12796 KB Output is correct
117 Correct 92 ms 14596 KB Output is correct
118 Correct 77 ms 12548 KB Output is correct
119 Correct 77 ms 12536 KB Output is correct
120 Correct 92 ms 14536 KB Output is correct
121 Correct 97 ms 14532 KB Output is correct
122 Correct 94 ms 14036 KB Output is correct
123 Correct 91 ms 14556 KB Output is correct
124 Correct 93 ms 14532 KB Output is correct
125 Correct 76 ms 12820 KB Output is correct
126 Correct 71 ms 14516 KB Output is correct
127 Correct 78 ms 13460 KB Output is correct
128 Correct 88 ms 14580 KB Output is correct
129 Correct 79 ms 14660 KB Output is correct
130 Correct 547 ms 56420 KB Output is correct
131 Correct 327 ms 49484 KB Output is correct
132 Correct 476 ms 56892 KB Output is correct
133 Correct 528 ms 56336 KB Output is correct
134 Correct 430 ms 55048 KB Output is correct
135 Correct 562 ms 57372 KB Output is correct
136 Correct 546 ms 58804 KB Output is correct
137 Correct 520 ms 58788 KB Output is correct
138 Correct 498 ms 56784 KB Output is correct
139 Correct 501 ms 56736 KB Output is correct
140 Correct 481 ms 56596 KB Output is correct
141 Correct 478 ms 56608 KB Output is correct
142 Correct 481 ms 56504 KB Output is correct
143 Correct 504 ms 56676 KB Output is correct
144 Correct 503 ms 56812 KB Output is correct
145 Correct 464 ms 56684 KB Output is correct
146 Correct 498 ms 56592 KB Output is correct
147 Correct 475 ms 56648 KB Output is correct
148 Correct 456 ms 56476 KB Output is correct
149 Correct 472 ms 56612 KB Output is correct
150 Correct 315 ms 56184 KB Output is correct
151 Correct 397 ms 56576 KB Output is correct
152 Correct 404 ms 56548 KB Output is correct
153 Correct 377 ms 57192 KB Output is correct