Submission #1043522

# Submission time Handle Problem Language Result Execution time Memory
1043522 2024-08-04T10:35:46 Z jcelin Radio Towers (IOI22_towers) C++17
58 / 100
941 ms 182108 KB
#pragma once 

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<pll> vpll;

#define PB push_back
#define PF push_front
#define PPB pop_back
#define PPF pop_front
#define X first
#define Y second
#define MP make_pair
#define all(x) (x).begin(), (x).end()

const int mod = 1e9 + 7; //998244353;
const int inf = (1 << 30) - 1;
const ll INF = (1ll << 62) - 1;
const int logo = 17;
const int MAXN = 1e5 + 7;
const int off = 1 << logo;
const int trsz = off << 1;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};

struct tour{
	int seg[trsz];
	
	void update(int x, int vl){
		x += off;
		seg[x] = vl;
		for(x /= 2; x; x /= 2) seg[x] = max(seg[x * 2], seg[x * 2 + 1]);
	}
	
	int query(int l, int r){
		int ret = 0;
		for(l += off, r += off; l < r; l >>= 1, r >>= 1){
			if(l & 1) ret = max(ret, seg[l++]);
			if(r & 1) ret = max(ret, seg[--r]);
		}
		return ret;
	}
	
	int spusti(int x, int vl, bool fl){
		if(x >= off) return x - off; 
		
		int pr = x * 2;
		if(fl) pr = x * 2 + 1;
		
		if(seg[pr] >= vl) return spusti(pr, vl, fl);
		return spusti(pr ^ 1, vl, fl);
	}
	
	int nadi(int l, int r, int vl, int fl){
		vi lef, rig;
		for(l += off, r += off; l < r; l >>= 1, r >>= 1){
			if(l & 1) lef.PB(l++);
			if(r & 1) rig.PB(--r);
		}
		while(rig.size()) lef.PB(rig.back()), rig.PPB();
		
		int ans = 0;
		if(fl == 0){			
			for(auto &x : lef){
				if(ans == 0 and seg[x] >= vl) ans = spusti(x, vl, 0);
			}	
		}else{				
			for(auto it = lef.rbegin(); it != lef.rend(); it++){
				if(ans == 0 and seg[*it] >= vl) ans = spusti(*it, vl, 1);
			}
		}
		
		return ans;
	}
}t;


struct tdelta{
	struct node{
		int v1, v2, ret1, ret2;
		
		node(){
			v1 = inf, v2 = -inf, ret1 = 0, ret2 = 0;
		}
	};
	
	node seg[trsz];
	
	node merge(node a, node b){
		node c;
		c.v1 = min(a.v1, b.v1);
		c.v2 = max(a.v2, b.v2);
		c.ret1 = max(a.ret1, b.ret1);
		c.ret1 = max(c.ret1, b.v2 - a.v1);
		
		c.ret2 = max(a.ret2, b.ret2);
		c.ret2 = max(c.ret2, a.v2 - b.v1);
		return c;
	}
	
	void update(int x, int vl){
		x += off;
		seg[x].v1 = seg[x].v2 = vl;
		for(x /= 2; x; x /= 2) seg[x] = merge(seg[x * 2], seg[x * 2 + 1]);
	}
	
	ii query(int l, int r){
		node ret;
		vi lef, rig;
		for(l += off, r += off; l < r; l >>= 1, r >>= 1){
			if(l & 1) lef.PB(l++);
			if(r & 1) rig.PB(--r);
		}
		while(rig.size()) lef.PB(rig.back()), rig.PPB();
		for(auto &x : lef) ret = merge(ret, seg[x]);
		return {ret.ret1, ret.ret2};
	}
}del;

bool submit;

struct per{
	struct node{
		node *L, *R;
		int cnt, mi, mx;
		
		node(){
			L = R = 0;
			cnt = mi = mx = 0;
		}
		
		node(node *_L, node *_R, int _cnt, int _mi, int _mx){
			L = _L, R = _R, cnt = _cnt, mi = _mi, mx = _mx;
		}
	};
	
	typedef node* pnode;
	pnode rt[MAXN];
	set<pnode> st;
	
	pnode l(pnode x){return x ? x -> L : 0;}
	pnode r(pnode x){return x ? x -> R : 0;}
	int c(pnode x){return x ? x -> cnt : 0;}
	int sm(pnode x){return x ? x -> mi : 0;}
	int bg(pnode x){return x ? x -> mx : 0;}

	void update(pnode &x, int lo, int hi, int a, int b, int vl){
		if(lo >= b or hi <= a) return;
		if(!submit) st.insert(x);
		x = new node(l(x), r(x), c(x), sm(x), bg(x));
		if(!submit) st.insert(x);
		if(lo >= a and hi <= b){
			if(vl){
				x -> cnt = 1;
				x -> mi = lo;
				x -> mx = lo;
			}else{					
				x -> cnt = 0;
				x -> mi = inf;
				x -> mx = -inf;
			}
			return;
		}	
		int mid = (lo + hi) / 2;
		update(x -> L, lo, mid, a, b, vl);
		update(x -> R, mid, hi, a, b, vl);
		
		x -> mi = min(sm(x -> L), sm(x -> R));
		x -> mx = max(bg(x -> L), bg(x -> R));
		x -> cnt = c(x -> L) + c(x -> R);
	}
	
	int query(pnode &x, int lo, int hi, int a, int b){
		if(lo >= b or hi <= a or !x) return 0;
		if(lo >= a and hi <= b) return c(x);
		int mid = (lo + hi) / 2;
		return query(x -> L, lo, mid, a, b) + query(x -> R, mid, hi, a, b);
	}
	
	ii merge(ii a, ii b){
		return {min(a.X, b.X), max(a.Y, b.Y)};
	}
	
	ii qry(pnode &x, int lo, int hi, int a, int b){
		if(lo >= b or hi <= a or !x) return {inf, -inf};
		if(lo >= a and hi <= b) return {sm(x), bg(x)};
		int mid = (lo + hi) / 2;
		return merge(qry(x -> L, lo, mid, a, b), qry(x -> R, mid, hi, a, b));
	}
	
	void update(int tim, int a, int b, int vl){
		update(rt[tim], 0, off, a, b, vl);
	}
	
	void res(){
		for(auto &x : st) delete x;
		st.clear();
	}
	
	int query(int tim, int l, int r){
		return query(rt[tim], 0, off, l, r);
	}
	
	ii query2(int tim, int l, int r){
		return qry(rt[tim], 0, off, l, r);
	}
}p;


int pm[MAXN], pv[MAXN], vl[MAXN], arr[MAXN];
vii st;
vi upd[MAXN], vals;

void init(int n, vi aa){
	submit = 1;
	for(int i=0; i<n; i++) arr[i + 1] = aa[i];
	st.clear();
	arr[0] = 2 * inf;
	arr[n + 1] = 2 * inf;
	t.update(0, 2 * inf);
	t.update(n + 1, 2 * inf);
	st.PB({-1, -inf});
	for(int i=1; i<=n; i++){
		while(st.back().Y > arr[i]) st.PPB();
		pm[i] = st.back().X;
		st.PB({i, arr[i]});
		t.update(i, arr[i]);
		del.update(i, arr[i]);
	}
	
	st.clear();
	st.PB({n + 2, -inf});
	for(int i=n; i; i--){
		while(st.back().Y > arr[i]) st.PPB();
		pv[i] = st.back().X;
		st.PB({i, arr[i]});
	}
	
	
	for(int i=1; i<=n; i++){
		int a = pm[i], b = pv[i];
		int op = min(t.query(a + 1, i), t.query(i + 1, b));
		op = max(op, arr[i]);
		vl[i] = op - arr[i];
		vals.PB(vl[i]);
	}
	vals.PB(0);
	vals.PB(inf);
	sort(all(vals));
	vals.erase(unique(all(vals)), vals.end());
	for(int i=1; i<=n; i++){
		vl[i] = lower_bound(all(vals), vl[i]) - vals.begin();
		upd[vl[i] + 1].PB(i);
	}
	
	p.rt[0] = NULL;
	for(int i=1; i<=n; i++) p.update(0, i, i + 1, 1);
	
	for(int i=1; i<(int)vals.size(); i++){
		p.rt[i] = p.rt[i - 1];
		for(auto &x : upd[i]) p.update(i, x, x + 1, 0);
	}
}

int max_towers(int l, int r, int d){
	l++, r++;
	
	auto it = lower_bound(all(vals), d) - vals.begin();
	
	int lef, rig, sum = p.query(it, l, r + 1);
	if(sum == 0){
		if(l != r and t.query(l + 1, r) >= max(arr[l], arr[r]) + d) return 2;
		return 1;
	}
	tie(lef, rig) = p.query2(it, l, r + 1);
	
	int opt = t.nadi(l, lef, arr[lef] + d, 1);
	if(opt) if(del.query(l, opt + 1).X >= d) sum++;
	
	opt = t.nadi(rig + 1, r + 1, arr[rig] + d, 0);
	if(opt) if(del.query(opt, r + 1).Y >= d) sum++;
	return sum;
}

void zavrsi(){
	p.res();
}

Compilation message

towers.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
# Verdict Execution time Memory Grader output
1 Correct 383 ms 111808 KB Output is correct
2 Correct 837 ms 181188 KB Output is correct
3 Correct 758 ms 181188 KB Output is correct
4 Correct 800 ms 181284 KB Output is correct
5 Correct 774 ms 181444 KB Output is correct
6 Correct 792 ms 181444 KB Output is correct
7 Correct 779 ms 181468 KB Output is correct
8 Correct 1 ms 9048 KB Output is correct
9 Correct 4 ms 12632 KB Output is correct
10 Correct 5 ms 12632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 9816 KB Output is correct
2 Correct 5 ms 12632 KB Output is correct
3 Correct 6 ms 12648 KB Output is correct
4 Correct 5 ms 12632 KB Output is correct
5 Correct 5 ms 12488 KB Output is correct
6 Correct 8 ms 12632 KB Output is correct
7 Correct 6 ms 12632 KB Output is correct
8 Correct 8 ms 12632 KB Output is correct
9 Correct 6 ms 12632 KB Output is correct
10 Correct 5 ms 12632 KB Output is correct
11 Correct 6 ms 12624 KB Output is correct
12 Correct 2 ms 9048 KB Output is correct
13 Correct 5 ms 12632 KB Output is correct
14 Correct 4 ms 12632 KB Output is correct
15 Correct 4 ms 12632 KB Output is correct
16 Correct 5 ms 12544 KB Output is correct
17 Correct 8 ms 12560 KB Output is correct
18 Correct 4 ms 12636 KB Output is correct
19 Correct 4 ms 12632 KB Output is correct
20 Correct 5 ms 12688 KB Output is correct
21 Correct 5 ms 12636 KB Output is correct
22 Correct 6 ms 12640 KB Output is correct
23 Correct 5 ms 12636 KB Output is correct
24 Correct 5 ms 12636 KB Output is correct
25 Correct 3 ms 10676 KB Output is correct
26 Correct 5 ms 12632 KB Output is correct
27 Correct 4 ms 12632 KB Output is correct
28 Correct 7 ms 12632 KB Output is correct
29 Correct 6 ms 12636 KB Output is correct
30 Correct 6 ms 12688 KB Output is correct
31 Correct 6 ms 12632 KB Output is correct
32 Correct 6 ms 12636 KB Output is correct
33 Correct 5 ms 12696 KB Output is correct
34 Correct 7 ms 12888 KB Output is correct
35 Correct 5 ms 12632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 9816 KB Output is correct
2 Correct 5 ms 12632 KB Output is correct
3 Correct 6 ms 12648 KB Output is correct
4 Correct 5 ms 12632 KB Output is correct
5 Correct 5 ms 12488 KB Output is correct
6 Correct 8 ms 12632 KB Output is correct
7 Correct 6 ms 12632 KB Output is correct
8 Correct 8 ms 12632 KB Output is correct
9 Correct 6 ms 12632 KB Output is correct
10 Correct 5 ms 12632 KB Output is correct
11 Correct 6 ms 12624 KB Output is correct
12 Correct 2 ms 9048 KB Output is correct
13 Correct 5 ms 12632 KB Output is correct
14 Correct 4 ms 12632 KB Output is correct
15 Correct 4 ms 12632 KB Output is correct
16 Correct 5 ms 12544 KB Output is correct
17 Correct 8 ms 12560 KB Output is correct
18 Correct 4 ms 12636 KB Output is correct
19 Correct 4 ms 12632 KB Output is correct
20 Correct 5 ms 12688 KB Output is correct
21 Correct 5 ms 12636 KB Output is correct
22 Correct 6 ms 12640 KB Output is correct
23 Correct 5 ms 12636 KB Output is correct
24 Correct 5 ms 12636 KB Output is correct
25 Correct 3 ms 10676 KB Output is correct
26 Correct 5 ms 12632 KB Output is correct
27 Correct 4 ms 12632 KB Output is correct
28 Correct 7 ms 12632 KB Output is correct
29 Correct 6 ms 12636 KB Output is correct
30 Correct 6 ms 12688 KB Output is correct
31 Correct 6 ms 12632 KB Output is correct
32 Correct 6 ms 12636 KB Output is correct
33 Correct 5 ms 12696 KB Output is correct
34 Correct 7 ms 12888 KB Output is correct
35 Correct 5 ms 12632 KB Output is correct
36 Correct 114 ms 121368 KB Output is correct
37 Correct 195 ms 181580 KB Output is correct
38 Correct 193 ms 181524 KB Output is correct
39 Correct 220 ms 182028 KB Output is correct
40 Correct 202 ms 181960 KB Output is correct
41 Correct 199 ms 181848 KB Output is correct
42 Correct 200 ms 181960 KB Output is correct
43 Correct 157 ms 181360 KB Output is correct
44 Correct 176 ms 181448 KB Output is correct
45 Correct 171 ms 181128 KB Output is correct
46 Correct 171 ms 181140 KB Output is correct
47 Correct 194 ms 181468 KB Output is correct
48 Correct 197 ms 181820 KB Output is correct
49 Correct 198 ms 181848 KB Output is correct
50 Correct 175 ms 181256 KB Output is correct
51 Correct 160 ms 181444 KB Output is correct
52 Correct 185 ms 181448 KB Output is correct
53 Correct 182 ms 181960 KB Output is correct
54 Correct 203 ms 181960 KB Output is correct
55 Correct 169 ms 181444 KB Output is correct
56 Correct 196 ms 180856 KB Output is correct
57 Correct 200 ms 175560 KB Output is correct
58 Correct 192 ms 181576 KB Output is correct
59 Correct 209 ms 181576 KB Output is correct
60 Correct 207 ms 181924 KB Output is correct
61 Correct 216 ms 181960 KB Output is correct
62 Correct 189 ms 182028 KB Output is correct
63 Correct 230 ms 181864 KB Output is correct
64 Correct 164 ms 181464 KB Output is correct
65 Correct 189 ms 181380 KB Output is correct
66 Correct 167 ms 181136 KB Output is correct
67 Correct 171 ms 181336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 691 ms 180236 KB Output is correct
2 Correct 844 ms 181528 KB Output is correct
3 Correct 897 ms 181416 KB Output is correct
4 Correct 863 ms 181960 KB Output is correct
5 Correct 897 ms 181960 KB Output is correct
6 Correct 879 ms 181856 KB Output is correct
7 Correct 834 ms 181864 KB Output is correct
8 Correct 788 ms 181444 KB Output is correct
9 Correct 806 ms 181444 KB Output is correct
10 Correct 893 ms 181188 KB Output is correct
11 Correct 901 ms 181188 KB Output is correct
12 Correct 746 ms 181444 KB Output is correct
13 Correct 739 ms 181444 KB Output is correct
14 Correct 1 ms 9048 KB Output is correct
15 Correct 4 ms 12632 KB Output is correct
16 Correct 4 ms 12632 KB Output is correct
17 Correct 174 ms 181404 KB Output is correct
18 Correct 193 ms 181960 KB Output is correct
19 Correct 192 ms 181984 KB Output is correct
20 Correct 160 ms 181444 KB Output is correct
21 Correct 167 ms 181444 KB Output is correct
22 Correct 182 ms 181448 KB Output is correct
23 Correct 204 ms 181960 KB Output is correct
24 Correct 204 ms 182036 KB Output is correct
25 Correct 171 ms 181444 KB Output is correct
26 Correct 171 ms 180940 KB Output is correct
27 Correct 4 ms 12632 KB Output is correct
28 Correct 4 ms 12632 KB Output is correct
29 Correct 5 ms 12632 KB Output is correct
30 Correct 4 ms 12632 KB Output is correct
31 Correct 4 ms 12632 KB Output is correct
32 Correct 4 ms 12632 KB Output is correct
33 Correct 7 ms 12632 KB Output is correct
34 Correct 5 ms 12632 KB Output is correct
35 Correct 4 ms 12632 KB Output is correct
36 Correct 4 ms 12632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 233 ms 50256 KB Output is correct
2 Correct 816 ms 181448 KB Output is correct
3 Correct 812 ms 181444 KB Output is correct
4 Correct 854 ms 181960 KB Output is correct
5 Correct 884 ms 182108 KB Output is correct
6 Correct 870 ms 181920 KB Output is correct
7 Correct 852 ms 181960 KB Output is correct
8 Correct 871 ms 181444 KB Output is correct
9 Correct 828 ms 181308 KB Output is correct
10 Correct 778 ms 181188 KB Output is correct
11 Correct 768 ms 181184 KB Output is correct
12 Correct 171 ms 181448 KB Output is correct
13 Correct 194 ms 181960 KB Output is correct
14 Correct 183 ms 181900 KB Output is correct
15 Correct 153 ms 181444 KB Output is correct
16 Correct 168 ms 180944 KB Output is correct
17 Correct 193 ms 175560 KB Output is correct
18 Correct 213 ms 181352 KB Output is correct
19 Correct 180 ms 181704 KB Output is correct
20 Correct 193 ms 181960 KB Output is correct
21 Correct 186 ms 181964 KB Output is correct
22 Correct 193 ms 181960 KB Output is correct
23 Correct 189 ms 181988 KB Output is correct
24 Correct 154 ms 181444 KB Output is correct
25 Correct 168 ms 181580 KB Output is correct
26 Correct 158 ms 180944 KB Output is correct
27 Correct 183 ms 181420 KB Output is correct
28 Correct 4 ms 12656 KB Output is correct
29 Correct 5 ms 12632 KB Output is correct
30 Correct 5 ms 12548 KB Output is correct
31 Correct 5 ms 12632 KB Output is correct
32 Correct 5 ms 12632 KB Output is correct
33 Correct 2 ms 10768 KB Output is correct
34 Correct 4 ms 12632 KB Output is correct
35 Correct 4 ms 12632 KB Output is correct
36 Correct 4 ms 12632 KB Output is correct
37 Correct 5 ms 12632 KB Output is correct
38 Correct 5 ms 12632 KB Output is correct
39 Correct 4 ms 12632 KB Output is correct
40 Correct 5 ms 12632 KB Output is correct
41 Correct 4 ms 12632 KB Output is correct
42 Correct 4 ms 12632 KB Output is correct
43 Correct 4 ms 12632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 9816 KB Output is correct
2 Correct 5 ms 12632 KB Output is correct
3 Correct 6 ms 12648 KB Output is correct
4 Correct 5 ms 12632 KB Output is correct
5 Correct 5 ms 12488 KB Output is correct
6 Correct 8 ms 12632 KB Output is correct
7 Correct 6 ms 12632 KB Output is correct
8 Correct 8 ms 12632 KB Output is correct
9 Correct 6 ms 12632 KB Output is correct
10 Correct 5 ms 12632 KB Output is correct
11 Correct 6 ms 12624 KB Output is correct
12 Correct 2 ms 9048 KB Output is correct
13 Correct 5 ms 12632 KB Output is correct
14 Correct 4 ms 12632 KB Output is correct
15 Correct 4 ms 12632 KB Output is correct
16 Correct 5 ms 12544 KB Output is correct
17 Correct 8 ms 12560 KB Output is correct
18 Correct 4 ms 12636 KB Output is correct
19 Correct 4 ms 12632 KB Output is correct
20 Correct 5 ms 12688 KB Output is correct
21 Correct 5 ms 12636 KB Output is correct
22 Correct 6 ms 12640 KB Output is correct
23 Correct 5 ms 12636 KB Output is correct
24 Correct 5 ms 12636 KB Output is correct
25 Correct 3 ms 10676 KB Output is correct
26 Correct 5 ms 12632 KB Output is correct
27 Correct 4 ms 12632 KB Output is correct
28 Correct 7 ms 12632 KB Output is correct
29 Correct 6 ms 12636 KB Output is correct
30 Correct 6 ms 12688 KB Output is correct
31 Correct 6 ms 12632 KB Output is correct
32 Correct 6 ms 12636 KB Output is correct
33 Correct 5 ms 12696 KB Output is correct
34 Correct 7 ms 12888 KB Output is correct
35 Correct 5 ms 12632 KB Output is correct
36 Correct 114 ms 121368 KB Output is correct
37 Correct 195 ms 181580 KB Output is correct
38 Correct 193 ms 181524 KB Output is correct
39 Correct 220 ms 182028 KB Output is correct
40 Correct 202 ms 181960 KB Output is correct
41 Correct 199 ms 181848 KB Output is correct
42 Correct 200 ms 181960 KB Output is correct
43 Correct 157 ms 181360 KB Output is correct
44 Correct 176 ms 181448 KB Output is correct
45 Correct 171 ms 181128 KB Output is correct
46 Correct 171 ms 181140 KB Output is correct
47 Correct 194 ms 181468 KB Output is correct
48 Correct 197 ms 181820 KB Output is correct
49 Correct 198 ms 181848 KB Output is correct
50 Correct 175 ms 181256 KB Output is correct
51 Correct 160 ms 181444 KB Output is correct
52 Correct 185 ms 181448 KB Output is correct
53 Correct 182 ms 181960 KB Output is correct
54 Correct 203 ms 181960 KB Output is correct
55 Correct 169 ms 181444 KB Output is correct
56 Correct 196 ms 180856 KB Output is correct
57 Correct 200 ms 175560 KB Output is correct
58 Correct 192 ms 181576 KB Output is correct
59 Correct 209 ms 181576 KB Output is correct
60 Correct 207 ms 181924 KB Output is correct
61 Correct 216 ms 181960 KB Output is correct
62 Correct 189 ms 182028 KB Output is correct
63 Correct 230 ms 181864 KB Output is correct
64 Correct 164 ms 181464 KB Output is correct
65 Correct 189 ms 181380 KB Output is correct
66 Correct 167 ms 181136 KB Output is correct
67 Correct 171 ms 181336 KB Output is correct
68 Correct 691 ms 180236 KB Output is correct
69 Correct 844 ms 181528 KB Output is correct
70 Correct 897 ms 181416 KB Output is correct
71 Correct 863 ms 181960 KB Output is correct
72 Correct 897 ms 181960 KB Output is correct
73 Correct 879 ms 181856 KB Output is correct
74 Correct 834 ms 181864 KB Output is correct
75 Correct 788 ms 181444 KB Output is correct
76 Correct 806 ms 181444 KB Output is correct
77 Correct 893 ms 181188 KB Output is correct
78 Correct 901 ms 181188 KB Output is correct
79 Correct 746 ms 181444 KB Output is correct
80 Correct 739 ms 181444 KB Output is correct
81 Correct 1 ms 9048 KB Output is correct
82 Correct 4 ms 12632 KB Output is correct
83 Correct 4 ms 12632 KB Output is correct
84 Correct 174 ms 181404 KB Output is correct
85 Correct 193 ms 181960 KB Output is correct
86 Correct 192 ms 181984 KB Output is correct
87 Correct 160 ms 181444 KB Output is correct
88 Correct 167 ms 181444 KB Output is correct
89 Correct 182 ms 181448 KB Output is correct
90 Correct 204 ms 181960 KB Output is correct
91 Correct 204 ms 182036 KB Output is correct
92 Correct 171 ms 181444 KB Output is correct
93 Correct 171 ms 180940 KB Output is correct
94 Correct 4 ms 12632 KB Output is correct
95 Correct 4 ms 12632 KB Output is correct
96 Correct 5 ms 12632 KB Output is correct
97 Correct 4 ms 12632 KB Output is correct
98 Correct 4 ms 12632 KB Output is correct
99 Correct 4 ms 12632 KB Output is correct
100 Correct 7 ms 12632 KB Output is correct
101 Correct 5 ms 12632 KB Output is correct
102 Correct 4 ms 12632 KB Output is correct
103 Correct 4 ms 12632 KB Output is correct
104 Correct 790 ms 162084 KB Output is correct
105 Correct 921 ms 181336 KB Output is correct
106 Correct 931 ms 181448 KB Output is correct
107 Correct 861 ms 182044 KB Output is correct
108 Incorrect 941 ms 181828 KB 19976th lines differ - on the 1st token, expected: '2', found: '1'
109 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 383 ms 111808 KB Output is correct
2 Correct 837 ms 181188 KB Output is correct
3 Correct 758 ms 181188 KB Output is correct
4 Correct 800 ms 181284 KB Output is correct
5 Correct 774 ms 181444 KB Output is correct
6 Correct 792 ms 181444 KB Output is correct
7 Correct 779 ms 181468 KB Output is correct
8 Correct 1 ms 9048 KB Output is correct
9 Correct 4 ms 12632 KB Output is correct
10 Correct 5 ms 12632 KB Output is correct
11 Correct 2 ms 9816 KB Output is correct
12 Correct 5 ms 12632 KB Output is correct
13 Correct 6 ms 12648 KB Output is correct
14 Correct 5 ms 12632 KB Output is correct
15 Correct 5 ms 12488 KB Output is correct
16 Correct 8 ms 12632 KB Output is correct
17 Correct 6 ms 12632 KB Output is correct
18 Correct 8 ms 12632 KB Output is correct
19 Correct 6 ms 12632 KB Output is correct
20 Correct 5 ms 12632 KB Output is correct
21 Correct 6 ms 12624 KB Output is correct
22 Correct 2 ms 9048 KB Output is correct
23 Correct 5 ms 12632 KB Output is correct
24 Correct 4 ms 12632 KB Output is correct
25 Correct 4 ms 12632 KB Output is correct
26 Correct 5 ms 12544 KB Output is correct
27 Correct 8 ms 12560 KB Output is correct
28 Correct 4 ms 12636 KB Output is correct
29 Correct 4 ms 12632 KB Output is correct
30 Correct 5 ms 12688 KB Output is correct
31 Correct 5 ms 12636 KB Output is correct
32 Correct 6 ms 12640 KB Output is correct
33 Correct 5 ms 12636 KB Output is correct
34 Correct 5 ms 12636 KB Output is correct
35 Correct 3 ms 10676 KB Output is correct
36 Correct 5 ms 12632 KB Output is correct
37 Correct 4 ms 12632 KB Output is correct
38 Correct 7 ms 12632 KB Output is correct
39 Correct 6 ms 12636 KB Output is correct
40 Correct 6 ms 12688 KB Output is correct
41 Correct 6 ms 12632 KB Output is correct
42 Correct 6 ms 12636 KB Output is correct
43 Correct 5 ms 12696 KB Output is correct
44 Correct 7 ms 12888 KB Output is correct
45 Correct 5 ms 12632 KB Output is correct
46 Correct 114 ms 121368 KB Output is correct
47 Correct 195 ms 181580 KB Output is correct
48 Correct 193 ms 181524 KB Output is correct
49 Correct 220 ms 182028 KB Output is correct
50 Correct 202 ms 181960 KB Output is correct
51 Correct 199 ms 181848 KB Output is correct
52 Correct 200 ms 181960 KB Output is correct
53 Correct 157 ms 181360 KB Output is correct
54 Correct 176 ms 181448 KB Output is correct
55 Correct 171 ms 181128 KB Output is correct
56 Correct 171 ms 181140 KB Output is correct
57 Correct 194 ms 181468 KB Output is correct
58 Correct 197 ms 181820 KB Output is correct
59 Correct 198 ms 181848 KB Output is correct
60 Correct 175 ms 181256 KB Output is correct
61 Correct 160 ms 181444 KB Output is correct
62 Correct 185 ms 181448 KB Output is correct
63 Correct 182 ms 181960 KB Output is correct
64 Correct 203 ms 181960 KB Output is correct
65 Correct 169 ms 181444 KB Output is correct
66 Correct 196 ms 180856 KB Output is correct
67 Correct 200 ms 175560 KB Output is correct
68 Correct 192 ms 181576 KB Output is correct
69 Correct 209 ms 181576 KB Output is correct
70 Correct 207 ms 181924 KB Output is correct
71 Correct 216 ms 181960 KB Output is correct
72 Correct 189 ms 182028 KB Output is correct
73 Correct 230 ms 181864 KB Output is correct
74 Correct 164 ms 181464 KB Output is correct
75 Correct 189 ms 181380 KB Output is correct
76 Correct 167 ms 181136 KB Output is correct
77 Correct 171 ms 181336 KB Output is correct
78 Correct 691 ms 180236 KB Output is correct
79 Correct 844 ms 181528 KB Output is correct
80 Correct 897 ms 181416 KB Output is correct
81 Correct 863 ms 181960 KB Output is correct
82 Correct 897 ms 181960 KB Output is correct
83 Correct 879 ms 181856 KB Output is correct
84 Correct 834 ms 181864 KB Output is correct
85 Correct 788 ms 181444 KB Output is correct
86 Correct 806 ms 181444 KB Output is correct
87 Correct 893 ms 181188 KB Output is correct
88 Correct 901 ms 181188 KB Output is correct
89 Correct 746 ms 181444 KB Output is correct
90 Correct 739 ms 181444 KB Output is correct
91 Correct 1 ms 9048 KB Output is correct
92 Correct 4 ms 12632 KB Output is correct
93 Correct 4 ms 12632 KB Output is correct
94 Correct 174 ms 181404 KB Output is correct
95 Correct 193 ms 181960 KB Output is correct
96 Correct 192 ms 181984 KB Output is correct
97 Correct 160 ms 181444 KB Output is correct
98 Correct 167 ms 181444 KB Output is correct
99 Correct 182 ms 181448 KB Output is correct
100 Correct 204 ms 181960 KB Output is correct
101 Correct 204 ms 182036 KB Output is correct
102 Correct 171 ms 181444 KB Output is correct
103 Correct 171 ms 180940 KB Output is correct
104 Correct 4 ms 12632 KB Output is correct
105 Correct 4 ms 12632 KB Output is correct
106 Correct 5 ms 12632 KB Output is correct
107 Correct 4 ms 12632 KB Output is correct
108 Correct 4 ms 12632 KB Output is correct
109 Correct 4 ms 12632 KB Output is correct
110 Correct 7 ms 12632 KB Output is correct
111 Correct 5 ms 12632 KB Output is correct
112 Correct 4 ms 12632 KB Output is correct
113 Correct 4 ms 12632 KB Output is correct
114 Correct 233 ms 50256 KB Output is correct
115 Correct 816 ms 181448 KB Output is correct
116 Correct 812 ms 181444 KB Output is correct
117 Correct 854 ms 181960 KB Output is correct
118 Correct 884 ms 182108 KB Output is correct
119 Correct 870 ms 181920 KB Output is correct
120 Correct 852 ms 181960 KB Output is correct
121 Correct 871 ms 181444 KB Output is correct
122 Correct 828 ms 181308 KB Output is correct
123 Correct 778 ms 181188 KB Output is correct
124 Correct 768 ms 181184 KB Output is correct
125 Correct 171 ms 181448 KB Output is correct
126 Correct 194 ms 181960 KB Output is correct
127 Correct 183 ms 181900 KB Output is correct
128 Correct 153 ms 181444 KB Output is correct
129 Correct 168 ms 180944 KB Output is correct
130 Correct 193 ms 175560 KB Output is correct
131 Correct 213 ms 181352 KB Output is correct
132 Correct 180 ms 181704 KB Output is correct
133 Correct 193 ms 181960 KB Output is correct
134 Correct 186 ms 181964 KB Output is correct
135 Correct 193 ms 181960 KB Output is correct
136 Correct 189 ms 181988 KB Output is correct
137 Correct 154 ms 181444 KB Output is correct
138 Correct 168 ms 181580 KB Output is correct
139 Correct 158 ms 180944 KB Output is correct
140 Correct 183 ms 181420 KB Output is correct
141 Correct 4 ms 12656 KB Output is correct
142 Correct 5 ms 12632 KB Output is correct
143 Correct 5 ms 12548 KB Output is correct
144 Correct 5 ms 12632 KB Output is correct
145 Correct 5 ms 12632 KB Output is correct
146 Correct 2 ms 10768 KB Output is correct
147 Correct 4 ms 12632 KB Output is correct
148 Correct 4 ms 12632 KB Output is correct
149 Correct 4 ms 12632 KB Output is correct
150 Correct 5 ms 12632 KB Output is correct
151 Correct 5 ms 12632 KB Output is correct
152 Correct 4 ms 12632 KB Output is correct
153 Correct 5 ms 12632 KB Output is correct
154 Correct 4 ms 12632 KB Output is correct
155 Correct 4 ms 12632 KB Output is correct
156 Correct 4 ms 12632 KB Output is correct
157 Correct 790 ms 162084 KB Output is correct
158 Correct 921 ms 181336 KB Output is correct
159 Correct 931 ms 181448 KB Output is correct
160 Correct 861 ms 182044 KB Output is correct
161 Incorrect 941 ms 181828 KB 19976th lines differ - on the 1st token, expected: '2', found: '1'
162 Halted 0 ms 0 KB -