QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#883651#9238. Treedadas28 57ms48932kbC++205.0kb2025-02-05 17:43:382025-02-05 17:43:39

Judging History

This is the latest submission verdict.

  • [2025-02-05 17:43:39]
  • Judged
  • Verdict: 28
  • Time: 57ms
  • Memory: 48932kb
  • [2025-02-05 17:43:38]
  • Submitted

answer

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//	mt19937 engine((unsigned ll)time(NULL));
//	uniform_int_distribution<ll> distribution(0, (ll)1e18);
//	auto generator = bind(distribution, engine);
//	ll x = generator();
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>
// #define ordered_multiset tree<int, null_type, less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using vl = std::vector<ll>;
using vii = std::vector<pair<int, int> >;
using vvl = std::vector<vl>;
using vll = std::vector<pair<ll , ll> >;
using vd = std::vector<double>;
using vvd = std::vector<vd>;
using vs = std::vector<std::string>;
using vvs = std::vector<vs>;
using vb = std::vector<bool>;
using vvb = std::vector<vb>;
using vc = std::vector<char>;
using vvc = std::vector<vc>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
using piil = std::pair<pair<int, int>, ll>;
using mii = std::map<int, int>;
using mll = std::map<ll, ll>;
using pql = std::priority_queue<ll>;
using pqi = std::priority_queue<int>;
using pqiil = std::priority_queue<pair<pair<int, int>, ll> >;
using pqii = std::priority_queue<pair<int, int> >;

#define pb push_back
#define ps push
#define eb emplace_back
#define is insert
#define er erase
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define sf(i) sizeof(i)
#define endl "\n"
#define all(v) (v).begin(), (v).end()
#define rep(i, L, R) for(ll i = L;i<=R;i++)
#define pcis precision
#define sz(a) ((ll) a.size())

template<typename T>
struct infinity {
	static constexpr T max=std::numeric_limits<T>::max();
	static constexpr T min=std::numeric_limits<T>::min();
	static constexpr T value=std::numeric_limits<T>::max()/2;
	static constexpr T mvalue=std::numeric_limits<T>::min()/2;
};
template<typename T>constexpr T INF=infinity<T>::value;
constexpr ll lINF=INF<ll>;
constexpr int iINF = INF<int>;
constexpr ld PI = 3.1415926535897932384626;

#include "tree.h"
ll N;
vl adj[420001];
ll W[420001];

pll ruseki[420001];// L : R 있는거임
// R/L = i일 때 식

// 값 : 용량  (값은 작을수록 터질 확률이 높음)
void zensyori(ll node) {
	if (adj[node].size() == 0) {
		ruseki[0].f += W[node];// 이만큼 빡 힘을 줘야함
		return;
	}
	for (auto i : adj[node]) zensyori(i);
	ruseki[0].f += (((ll) adj[node].size())-1)*W[node];// 걍 싹다 받아서, L 하나만 내놓자.
	return;
}


// 값 : 용량  (값은 작을수록 터질 확률이 높음)
priority_queue<pll> DFS(ll node) {
	priority_queue<pll> pq;
	ll my_ryu = (((ll) adj[node].size())-1);
	for (auto i : adj[node]) {
		if (adj[i].size() == 0) continue;
		auto pq2 = DFS(i);

		ll sakki_ryu = 0;

		while (!pq2.empty() && W[node] <= pq2.top().f) {
			// 저새끼는 빼는게? 이득 아닌가
			auto [W2, ryu] = pq2.top();
			pq2.pop();
			ll w = W[node] - W2;// (w*흐르는 양)만큼 이득임
			// 여기다가 바로 안 흘리고
			// 위로 올릴수도 있나? 오 씨발 존나 그럴싸한데?
			// 아 잠만 이제 바뀌었다. 그냥 그걸 그대로 올리는 것이다 

			// min((R - (1 + sakki_ryu)*L), ryu*L) 만큼 흘릴 수 있다

			// R >= (1 + sakki_ryu + ryu)*L  -> R-(1+sakki_ryu)*L
			//  < 이면 -> ryu*L 임
			// 아니 반대임

			ruseki[0].f += -(1+sakki_ryu)*w;
			ruseki[0].s += w;
			
			assert(1 + sakki_ryu + ryu <= N);
			ruseki[1 + sakki_ryu + ryu].f -= -(1+sakki_ryu)*w;
			ruseki[1 + sakki_ryu + ryu].s -= w;

			ruseki[1 + sakki_ryu + ryu].f += ryu*w;

			my_ryu += ryu;// 저만큼 유량을 흘려줄 수 있음
			sakki_ryu += ryu;
		}

		if (pq.size() < pq2.size()) swap(pq, pq2);
		while (!pq2.empty()) pq.ps(pq2.top()), pq2.pop();
	}
	pq.ps({W[node], my_ryu});
	return pq;
}


void init(std::vector<int> P, std::vector<int> W) {
	::N = P.size();
	rep(i,0,N-1) adj[P[i]+1].pb(i+1);
	rep(i, 1, N) ::W[i] = W[i-1];
	::W[0] = 0;

	zensyori(0);
	DFS(0);

	rep(i, 1, N*2) ruseki[i].f += ruseki[i-1].f;
	rep(i, 1, N*2) ruseki[i].s += ruseki[i-1].s;

	return;
}

long long query(int _L, int _R) {
	ll L = _L;
	ll R = _R;
	ll cc = R/L;// R/L값에 따라 달라지는게 맞나?
	cc = min(cc, N*2);
	return L*ruseki[cc].f + R*ruseki[cc].s;
}

//
//void _main();
//int main() {
//	cin.tie(0);
//	ios::sync_with_stdio(false);
//	_main();
//	return 0;
//}
//void _main() {
//
//	ll N;
//	cin >> N;
//	vi P(N);
//	P[0] = -1;
//	rep(i, 1, N-1) cin >> P[i];
//	vi W(N);
//	rep(i, 0, N-1) cin >> W[i];
//
//	init(P, W);
//
//	ll Q;
//	cin >> Q;
//	while (Q--) {
//		ll l, r;
//		cin >> l >> r;
//		cout << query(l, r) << endl;
//	}
//
//
//}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 37ms
memory: 46976kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 0 2 2 4 5 4 5 8 9 10 9 8 10 14 15 14 15 18 19 20 21 18 22 21 24 24 27 22 27 30 31 31 33 30 19 20 33 38 38 40 41 41 43 44 43 44 47 48 49 50 49 50 53 54 53 48 54 58 58 60 60 62 62 64 64 66 66 67 67 70 71 72 71 72 75 70 75 78 78 80 81 80 81 84 85 86 86 88 89 90...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
682654248246
834059146585
104107877065
626344246917
578222335946
1248276814116
1306128583094
417838861293
365718115496
1302019336262

result:

ok 

Test #2:

score: 10
Accepted
time: 32ms
memory: 46816kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 0 2 2 4 5 6 7 7 9 9 11 12 11 5 13 12 6 4 13 20 21 20 21 24 25 25 27 28 27 28 29 32 32 34 35 36 36 37 34 39 41 39 35 37 42 41 42 48 48 50 50 52 52 54 54 56 57 58 58 56 59 59 63 63 65 66 65 57 66 70 70 72 73 73 75 72 75 78 78 80 80 81 83 83 84 81 29 24 84 90 9...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
2412828
1922117
1327147
965330
1085799
1564240
1690944
1688948
2415056
1441542

result:

ok 

Test #3:

score: 10
Accepted
time: 34ms
memory: 36156kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 0 0 3 4 5 4 4 5 5 10 10 10 13 13 15 15 15 18 3 5 5 18 23 24 24 25 27 27 27 27 31 32 33 32 33 33 33 38 38 38 41 41 38 32 38 38 41 48 48 50 50 50 53 53 55 55 55 48 55 60 60 55 61 64 64 64 64 53 64 55 64 72 72 72 50 48 72 78 78 80 81 81 81 81 83 86 86 86 86 88 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
57510536913265758
13893873797083323
19946610899128
612378945455168
5805050629165603
24375661619556703
36105231950324439
45342443221065693
18169686485050308
12956499749658231

result:

ok 

Test #4:

score: 10
Accepted
time: 42ms
memory: 24268kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 9 9 10 12 13 14 14 13 17 15 19 20 21 21 22 22 25 26 27 27 29 30 30 32 32 34 35 36 37 36 38 40 41 42 43 44 38 36 40 48 49 49 51 52 53 53 52 56 57 55 57 59 61 62 63 64 65 66 63 68 69 69 71 67 73 73 74 76 77 76 76 80 80 82 83 80 75 86 77 88 89 9...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
7643905133299046
28184208216232992
397398112600514
439994136720137
32751552084610538
34770551047442984
2746924426773012
1660650876324804
36635310270169815
52687563609961576

result:

ok 

Test #5:

score: 10
Accepted
time: 41ms
memory: 24780kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 9 8 11 12 13 13 12 14 15 18 19 20 21 22 23 24 23 26 27 28 29 30 30 32 31 34 35 36 35 37 37 40 41 42 43 43 45 43 47 48 47 50 51 50 48 54 55 55 57 58 59 59 61 62 61 60 62 52 67 68 69 70 70 72 73 74 71 74 75 78 78 78 78 58 83 46 61 86 73 88 89 8...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
26872827042939935
49372923666359196
9058883871784635
6777056622183544
1838319902044609
32141218683607317
3983594684931644
57790759896735111
27089846953780734
10261160977025592

result:

ok 

Test #6:

score: 10
Accepted
time: 39ms
memory: 24936kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 8 10 11 11 13 14 15 16 17 18 18 20 21 22 22 24 17 23 21 22 29 29 31 32 33 34 31 33 35 38 38 40 41 42 39 44 45 46 46 48 49 38 51 43 53 53 50 56 45 58 58 60 59 60 63 63 64 66 66 68 65 67 71 66 66 72 75 75 77 78 77 80 76 79 83 83 80 86 87 88 89 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
46240945687
75809785349
1427956109
18769152814
10917853217
38913156840
15656876405
40210377091
62339284486
12811886908

result:

ok 

Test #7:

score: 10
Accepted
time: 37ms
memory: 25156kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 3 4 6 7 8 9 10 10 12 13 14 11 16 17 18 19 20 21 21 23 24 25 25 27 24 28 30 31 32 28 34 35 36 37 22 29 23 17 31 43 43 45 46 43 48 49 47 51 51 53 46 49 56 57 58 58 60 61 62 57 64 63 66 65 45 69 70 71 72 68 23 75 76 77 73 79 80 81 82 83 84 84 85 87 88 89 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
40918849029853209
7833596601568197
5990593014536811
4352190437322498
17295263219976717
47008068426232620
954287740499985
15897745496652069
22735636717009101
8720508161191782

result:

ok 

Test #8:

score: 10
Accepted
time: 40ms
memory: 23628kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 4 6 7 8 8 9 11 12 7 14 15 15 17 16 17 17 21 22 23 17 20 14 25 28 26 30 30 32 33 31 35 36 33 38 35 40 41 41 30 38 45 31 33 48 49 50 51 33 50 53 55 56 56 58 59 60 59 62 63 64 56 66 66 68 62 60 55 62 59 74 74 76 77 77 32 80 81 82 44 58 85 85 85 88 89 89...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
18332177014668621
48287181796568495
21123963074015684
53693699485878843
2086270347806154
51638060827009153
25332123081029950
1389829310508093
14190661594976877
70996135211589918

result:

ok 

Test #9:

score: 10
Accepted
time: 35ms
memory: 23992kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 5 4 8 9 10 11 8 9 14 15 16 17 18 17 20 21 10 23 23 25 26 26 28 28 19 31 32 33 31 35 36 33 18 39 40 41 42 40 29 45 46 47 46 49 49 47 45 53 53 54 32 57 57 30 60 61 62 61 64 60 27 67 68 68 70 69 72 71 71 7 11 77 78 79 79 81 78 83 84 85 86 87 87 86 90 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
27482511519482973
54801483810360485
16427935358969097
18858137547390619
77884374862242783
26106356577065893
6900572582069509
10154611289838451
29452407535664386
51588785737271760

result:

ok 

Test #10:

score: 10
Accepted
time: 23ms
memory: 17420kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
76294866873700498
93890907422242820
93434331911152132
74666580729163472
52192075803472304
95086795576987856
59809293897104834
53869016712136914
77675882910684380
89712991728300302

result:

ok 

Subtask #2:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 1ms
memory: 6144kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
2000
0 0 1 1 4 4 6 7 6 7 10 10 12 12 14 15 14 15 18 19 19 21 18 21 24 24 26 27 26 27 30 30 32 32 34 34 36 37 38 39 39 41 37 38 36 41 46 47 48 47 48 51 51 53 54 54 56 56 58 58 60 61 61 63 64 64 66 67 66 67 70 71 72 72 74 75 76 76 75 74 70 77 63 60 77 85 85 87 87 89 89...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
608654342547
2941229875338
1940605618898
403276185532
3448641496752
6495104911064
1718579112556
396114123310
1444163326608
2170092742915

result:

wrong answer 3rd lines differ - on the 1st token, expected: '175909322571', found: '608654342547'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 7
Accepted

Test #33:

score: 7
Accepted
time: 52ms
memory: 48932kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 0 1 2 2 6 6 7 7 10 11 11 13 14 13 14 17 10 17 20 21 22 22 23 21 20 23 28 29 28 29 32 33 34 32 33 34 38 39 39 40 42 42 44 45 46 47 48 45 46 48 52 53 53 54 56 56 58 58 60 61 62 63 63 65 61 66 62 66 70 71 71 72 72 75 60 65 75 79 52 44 70 47 40 54 79 87 87 89 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
18330254280
114566555886
5123993634
1571790384
1390661403
102887513647
12142338294
532135751
48879256279
74804356884
7047438873
58553215238
26812191362
41269971650
32111371952
8116162880
57784940023
106724111433
93322831828
42829869427
28126687591
28123313538
1525...

result:

ok 

Test #34:

score: 7
Accepted
time: 54ms
memory: 25808kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 21 20 23 25 25 27 28 29 29 30 32 33 33 22 36 33 34 39 39 40 42 43 44 45 39 47 48 49 50 51 52 52 54 51 56 57 58 59 60 60 61 62 59 61 66 67 68 63 70 71 68 58 61 75 76 77 66 73 80 60 60 83 83 58 86 87 86 89 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
50233536385
3587514281
5880195973
137570322832
29902093191
26550751346
32639328031
66964630751
25701201292
103130504357
54417568193
90440614687
29659144821
30382916893
3188471716
14164945825
46749986071
1254071200
57249463618
32639228784
26502847608
103554150130
1...

result:

ok 

Test #35:

score: 7
Accepted
time: 54ms
memory: 25180kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 13 16 17 18 19 20 20 22 22 22 24 25 22 28 29 29 29 32 32 32 35 35 37 38 39 38 21 17 41 44 45 30 47 48 48 49 51 52 52 54 55 55 55 50 59 55 54 62 63 64 62 62 64 67 62 59 51 72 73 74 75 76 75 56 79 80 81 80 82 82 85 82 87 88 55 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
44679405666
7344895774
71198961182
21219279009
50500461174
7095602694
60932721243
137763754969
17105320274
37016931183
21667892444
8839528376
77671688743
31024367232
89840380380
4873771465
14736820809
142327968181
115923386349
32203682223
9608934637
87739160313
21...

result:

ok 

Test #36:

score: 7
Accepted
time: 51ms
memory: 24424kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 12 10 16 18 19 20 21 22 23 24 25 25 23 28 29 29 31 32 31 32 35 36 37 37 38 40 41 41 35 44 22 46 21 48 49 50 51 23 48 50 32 56 57 58 58 60 61 32 63 9 65 46 62 68 12 42 71 72 73 40 75 63 77 14 79 79 81 82 82 82 82 30 76 88 89 9...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
5521438976
15261272599
10728067067
3645164128
23856372857
446697418
929867368
12088150858
30035383256
7293473665
4359793115
40865552617
55353413089
7616895721
34148444820
2529872987
53772209472
39426040232
3895610150
712023248
5474833320
2807877401
21416591895
366...

result:

ok 

Test #37:

score: 7
Accepted
time: 56ms
memory: 25496kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 1 2 4 5 6 7 8 9 8 7 11 13 14 14 16 17 17 18 20 14 19 23 24 24 26 27 26 29 30 31 29 25 34 34 35 37 32 39 40 41 42 43 42 43 45 46 48 48 49 51 51 51 43 55 55 57 58 58 44 55 39 60 64 64 44 67 68 69 68 71 72 19 74 27 9 77 78 79 80 80 82 83 84 85 86 85 86 89 90 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
38153302526
130097547239
52388680982
69184293541
80459218361
14724080527
866710368
18319226622
80908501410
23324019935
32743579203
16938672359
5934264863
52906244180
23716977699
45587337949
14483777583
2954757299
19498267405
24049176238
9117766559
5805218194
21070...

result:

ok 

Test #38:

score: 7
Accepted
time: 52ms
memory: 26472kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 0 8 8 10 11 12 9 14 15 16 17 18 19 20 21 7 23 24 25 26 27 28 29 30 31 32 33 34 35 22 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
307705295
740817932
103016
93590629
636968552
4207234
494349851
813091070
510525363
215228314
109359791
1042526314
759568979
271550316
293772874
1144161018
4572297
637369864
459711939
148096492
103770009
853464064
22376976
676525710
84286852
399680890
775723872
12...

result:

ok 

Test #39:

score: 7
Accepted
time: 51ms
memory: 24100kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 2 4 7 8 8 10 10 12 13 14 15 16 17 15 16 20 21 22 21 24 18 26 13 28 19 30 14 32 33 34 35 35 37 33 39 40 41 41 26 32 45 46 47 30 49 50 31 52 52 18 55 55 36 48 48 19 49 62 62 31 65 11 67 68 68 9 71 72 73 74 75 76 77 78 78 76 81 82 82 71 36 39 87 88 87 9...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
17606249861
36754536423
31398535922
126896299427
75536620971
124572494315
61770969257
36419022307
25719602834
21613762047
19587768771
90018339815
32518184788
37664052696
132681842175
33458876552
10232954134
55087303729
27438862203
44821277009
63256973538
470954133...

result:

ok 

Test #40:

score: 7
Accepted
time: 36ms
memory: 17732kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
96203127179
56234228902
33659229298
20054091922
292186192729
55908093901
136507199146
37505723434
132422932602
44038197362
134790779646
279535770445
79001683916
226259989838
4703942916
48668597404
166838756150
7495535255
287482795199
38180299940
258644451531
31204...

result:

ok 

Subtask #5:

score: 11
Accepted

Dependency #4:

100%
Accepted

Test #41:

score: 11
Accepted
time: 50ms
memory: 36044kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 1 1 1 5 5 5 8 8 10 1 10 13 13 13 16 16 18 19 20 21 21 22 24 21 22 21 21 22 20 19 18 21 19 24 36 36 38 38 40 41 40 41 44 45 45 45 44 45 50 50 50 51 54 55 55 54 44 50 55 61 62 16 38 19 45 40 54 18 8 54 62 73 73 75 76 76 76 79 80 80 75 80 75 80 80 87 87 87 90...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
37308016868
27520015666
105114284743
68349910725
5561040201
17429312764
15950831572
165520778
15079971992
70738593703
27013455287
110087351274
72027113978
22316709889
36474494784
3580888196
439571040
13737852840
5995775604
2088737962
18587281774
13176405227
734380...

result:

ok 

Test #42:

score: 11
Accepted
time: 57ms
memory: 26208kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 13 15 17 18 19 20 21 22 23 24 25 26 27 28 28 29 31 22 26 34 30 36 37 36 38 40 41 41 43 43 45 46 47 47 39 45 43 52 53 54 55 55 56 57 59 60 61 60 63 60 65 65 67 67 69 70 71 71 73 73 75 75 77 75 76 80 80 80 83 84 84 86 86 88 89 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
6495403584
84572334
3378605212
32561868
29664062718
51002517852
34584828162
23731996380
927879810
15821103378
8753021874
52322477820
31816012212
42311688498
25771002498
20114239752
1796431848
12621360432
59817732432
14504490
4129801392
10752579846
7642337046
22911...

result:

ok 

Test #43:

score: 11
Accepted
time: 53ms
memory: 24444kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 18 19 20 20 21 23 24 25 25 27 28 29 30 31 31 33 34 24 20 37 38 34 40 41 41 43 41 43 46 46 48 46 49 46 52 53 54 55 56 57 57 56 60 43 62 63 50 65 66 67 68 68 69 67 67 73 67 75 68 68 78 78 80 78 79 78 77 85 80 87 88 88 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
71901804
5024702196
48195837016
5646955056
8656850656
479838800
16840100271
17025673564
44299049418
10839187134
31507242430
2846811719
741440640
4286254028
1094353467
13687286274
16086420469
10796751799
52507645948
5785644778
34579081609
3342263410
11796410797
803...

result:

ok 

Test #44:

score: 11
Accepted
time: 55ms
memory: 25160kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 6 8 9 9 10 12 13 14 15 15 17 17 18 20 21 22 23 22 24 26 20 25 26 30 31 32 31 31 35 36 37 32 37 33 41 40 43 36 45 46 47 48 49 38 51 52 49 54 47 46 57 58 58 57 58 62 63 62 53 57 67 48 69 69 71 47 48 51 75 76 55 78 78 80 78 79 80 80 84 65 85 40 89 8...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
24898970928
670500366
9587720694
2069127340
11207172076
73846920
6771990115
8801823609
1553803626
18948956200
3641991300
5188174400
4799180232
104892768
12547536344
5389060232
22680559356
750844356
3651620208
1693250849
1257583871
40254636704
9184218104
1611839904...

result:

ok 

Test #45:

score: 11
Accepted
time: 56ms
memory: 26560kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 3 6 6 7 8 10 8 12 13 14 9 16 17 0 19 20 21 22 23 24 15 26 27 28 29 30 12 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 2 52 53 54 55 56 57 58 59 60 61 62 25 64 65 66 67 68 69 70 71 72 73 51 75 76 77 78 79 80 81 74 5 84 85 86 87 1 89 90 91 ...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
183434625
29298288
32010366
23410920
97594452
114049140
4993065
7794990
75406710
41354128
2773890
13975586
39655566
207585
1116360
447310608
31601172
83136456
273263229
151599744
21927816
198624921
41022465
141901872
312591780
175550292
130915116
258415209
3512270...

result:

ok 

Test #46:

score: 11
Accepted
time: 50ms
memory: 23332kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 2 3 4 5 6 7 8 8 10 11 12 13 14 15 16 15 18 10 20 21 22 23 22 25 25 27 28 27 30 30 13 33 34 35 33 37 14 39 40 40 12 43 44 45 46 46 16 11 3 51 51 52 52 55 56 55 54 59 60 61 61 63 63 64 65 65 68 68 70 60 72 53 74 75 76 75 67 69 80 81 71 54 84 85 85 87 88 88 9...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
3155389490
2368517375
13890191040
5884670841
42601560098
18236083484
49659670493
9647351166
3850695779
9392279318
4952528900
8575284030
1637972826
25862840602
61598404924
50665614415
50177390201
19035681338
19928715363
19105994408
80400478153
46382397416
314410697...

result:

ok 

Subtask #6:

score: 0
Wrong Answer

Test #47:

score: 0
Wrong Answer
time: 45ms
memory: 47716kb

input:

ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0
200000
0 1 0 1 4 5 5 7 7 9 9 11 12 13 13 11 14 12 14 19 20 19 20 23 24 25 26 26 28 28 30 31 32 33 33 35 35 30 32 31 37 41 42 43 24 44 46 46 48 49 50 51 51 53 54 55 55 56 56 48 50 54 44 59 49 25 59 67 68 67 68 71 71 72 72 75 76 76 78 79 80 37 80 83 83 85 86 85 79 41 8...

output:

11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1
OK
18078556436086
9018240167103
85865453285599
84141759955702
7440759643290
31464585139096
52575911712445
43627601569247
66647750582035
1671474917650
16755522388246
24032371989270
1816874359888
82481493970645
40666941067206
67255982003442
12178441921779
8383416505396...

result:

wrong answer 3rd lines differ - on the 1st token, expected: '44399242169', found: '18078556436086'

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%