QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#666117#7899. Say Hello to the Futurerlc202204AC ✓110ms9420kbC++146.0kb2024-10-22 16:41:142024-10-22 16:41:22

Judging History

你现在查看的是最新测评结果

  • [2024-10-22 16:41:22]
  • 评测
  • 测评结果:AC
  • 用时:110ms
  • 内存:9420kb
  • [2024-10-22 16:41:14]
  • 提交

answer

#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 2e5 + 5;
const int mod = 998244353;

int n, a[N] = {0};

int f[N] = {0}, g[N] = {0};
int d[N] = {0};

void add(int &x, int y) {
	x = (x + y) % mod;
}
void sub(int &x, int y) {
	x = (x - y + mod) % mod;
} 

void slv1(int l, int r, int *dp) {
	if (l + 1 == r) {
		if (a[l] == 1)
			add(dp[l], dp[l - 1]);
		return;
	}
	int mid = (l + r) / 2;
	slv1(l, mid, dp);
	int mx = 0;
	for (int i = l - 1; i <= r; i++)	
		d[i] = 0;
	for (int i = mid - 1, j = mid; i >= l; i--) {
		mx = max(mx, a[i]);
		while (j < r && a[j] <= mx)
			j++;
		if (j - i >= mx) {
			add(d[max(i + mx - 1, mid)], dp[i - 1]);
			sub(d[j], dp[i - 1]);
		}
	}
	for (int i = mid; i < r; i++) {
		add(d[i], d[i - 1]);
		add(dp[i], d[i]);
	//	if (i == n) {
	//		printf("(%d, %d, %d) with %d\n", l, mid, r, d[i]);
	//	}
	}
	d[l - 1] = dp[l - 1];
	for (int i = l; i < mid; i++)
		d[i] = (d[i - 1] + dp[i]) % mod;
	mx = 0;
	for (int i = mid, j = mid - 1; i < r; i++) {
		mx = max(mx, a[i]);
		while (j >= l && a[j] < mx)
			j--;
		if (j < mid - 1 && i - j >= mx) {
			add(dp[i], (d[min(i - mx, mid - 2)] - (j == l - 1 ? 0 : d[j - 1]) + mod) % mod); 
		//	if (i == n)
		//		printf("2: (%d, %d, %d) with %d ??? %d...%d\n", l, mid, r, (d[min(i - mx, mid - 1)] - (j == l - 1 ? 0 : d[j - 1]) + mod) % mod, min(i - mx, mid - 1), j);
		}
	}
	slv1(mid, r, dp);
}

int sf[N] = {0}, sg[N] = {0};

void getpfx(int *arr, int *b) {
	b[0] = arr[0];
	for (int i = 1; i <= n + 1; i++)
		b[i] = (b[i - 1] + arr[i]) % mod;
}
int qf(int l, int r) {
	if (l >= r)
		return 0;
	if (l == 0)
		return sf[r - 1];
	return (sf[r - 1] - sf[l - 1] + mod) % mod;
}
int qg(int l, int r) {
	if (l >= r)
		return 0;
	if (l == 0)
		return sg[r - 1];
	return (sg[r - 1] - sg[l - 1] + mod) % mod;
}

int ans[N] = {0};

int want = 5;
bool debug = false;

void slv2(int l, int r) {
	if (l + 1 == r) {
		if (a[l] > 1) {
			add(ans[l], 1ll * f[l - 1] * g[l + 1] % mod);
			if (l == want && debug)
				cout << "specail " << f[l - 1] << " " << g[l + 1] << " " << 1ll * f[l - 1] * g[l + 1] % mod << endl; 
		}
		return;
	}
	int mid = (l + r) / 2;
	slv2(l, mid), slv2(mid, r);
	int semx = 0, mx = 0;
	for (int i = mid - 1, L = mid, R = mid; i >= l; i--) {
		semx = max(semx, a[i]);
		while (L < r && a[L] <= semx)
			L++;
		if (L == r)
			break;
		R = max(R, L + 1);
		while (R < r && a[R] <= semx)
			R++;
		//[L, R) 是当时的可转移区间
		int ll = max(L, i + semx - 1);
		int rr = min(R, i + a[L] - 1);
		add(ans[L], 1ll * f[i - 1] * qg(ll + 1, rr + 1) % mod);
		if (L == want && debug)
			printf("(%d, %d, %d), t1:ans[%d] += %lld\n",  l, mid, r, L, 1ll * f[i - 1] * qg(ll + 1, rr + 1) % mod);
	}
	semx = 0, mx = 0;
	for (int i = mid, L = mid - 1, R = mid - 1; i < r; i++) {
		semx = max(semx, a[i]);
		while (L >= l && a[L] <= semx)
			L--;
		if (L == l - 1)
			break;
		R = min(R, L - 1);
		while (R >= l && a[R] <= semx)
			R--;
		//[L, R] 是当时的可转移区间
		int ll = max(R, i - a[L] + 1);
		int rr = min(L, i - semx + 1);
		add(ans[L], 1ll * g[i + 1] * qf(ll, rr) % mod);
		if (L == want && debug)
			printf("(%d, %d, %d), t2:ans[%d] += %lld ll:%d rr:%d L:%d R:%d\n",  l, mid, r, L, 1ll * g[i + 1] * qf(ll, rr) % mod, ll, rr, L, R);
	}
	mx = 0, semx = 0;
	int pos = 0;
	bool flg = true;
	for (int i = mid - 1, j = mid; i >= l; i--) {
		if (a[i] == mx)
			flg = false;
		else if (a[i] > mx)
			flg = true, semx = mx, mx = a[i], pos = i;
		else if (a[i] > semx)
			semx = a[i];
		while (j < r && a[j] < semx)
			j++;
		int ll = max(mid, i + semx - 1);
		int rr = min(j, i + mx - 1);
		if (!flg)
			continue;
		add(ans[pos], 1ll * f[i - 1] * qg(ll + 1, rr + 1) % mod);
		if (pos == want && debug)
			printf("(%d, %d, %d), t3:ans[%d] += %lld\n",  l, mid, r, pos, 1ll * f[i - 1] * qg(ll + 1, rr + 1) % mod);
	}
	mx = 0, semx = 0;
	pos = 0;
	flg = true;
	for (int i = mid, j = mid - 1; i < r; i++) {
		if (a[i] == mx)
			flg = false;
		else if (a[i] > mx)
			flg = true, semx = mx, mx = a[i], pos = i;
		else if (a[i] > semx)
			semx = a[i];
		while (j >= l && a[j] < semx)
			j--;
		if (!flg)
			continue;
		int ll = max(j, i - mx + 1);
		int rr = min(mid - 1, i - semx + 1);
		add(ans[pos], 1ll * g[i + 1] * qf(ll, rr) % mod);
		if (pos == want && debug)
			printf("(%d, %d, %d), t4:ans[%d] += %lld ll:%d rr:%d i:%d qf:%d\n",  l, mid, r, pos, 1ll * g[i + 1] * qf(ll, rr) % mod, ll, rr, i, qf(ll, rr));
	}
}

void slv() {
	f[0] = 1;
	slv1(1, n + 1, f);
	reverse(a + 1, a + n + 1);
	g[0] = 1;
	slv1(1, n + 1, g);
	reverse(g, g + n + 2);
	reverse(a + 1, a + n + 1);
	
	if (debug) {
		cout << "f: ";
		for (int i = 0; i <= n + 1; i++)
			cout << f[i] << " ";
		cout << endl;
		cout << "g: ";
		for (int i = 0; i <= n + 1; i++)	
			cout << g[i] << " ";
		cout << endl; 
	}
	
	getpfx(f, sf), getpfx(g, sg);
	for (int i = 1; i <= n; i++)
		ans[i] = f[n];
	if (debug)
		cout << f[n] << endl;
	slv2(1, n + 1);
}

int main() {
//	freopen("c.in", "r", stdin);
//	freopen("ex_c3.in", "r", stdin);
//	freopen("c.out", "w", stdout);

	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
/*	for (int i = 1; i <= n; i++) {
		f[0] = 1;
		for (int j = 1; j <= n; j++)
			f[j] = 0;
		int p = a[i];
		a[i] = 1;
		slv1(1, n + 1, f);
		cout << f[n] << " ";
		a[i] = p;
	}
	return 0;*/
	slv();
	for (int i = 1; i <= n; i++) {
		printf("%d", ans[i]);	
		if (i < n)
			printf(" ");
	}
	return 0;
}
/*
12
2 4 3 1 2 1 3 3 3 1 2 2 

15
2 3 5 1 5 5 4 4 3 5 1 1 2 3 2 

40 36 52 24 24 29 26 25 25 40 24 24 24 36 37 

15
4 1 4 2 1 5 1 3 2 4 3 2 4 2 3 
53 23 23 23 23 52 23 28 24 30 28 23 31 23 50

15
1 4 2 1 2 3 4 4 4 1 5 3 3 4 5 
29 102 29 29 33 35 32 31 38 29 29 29 29 29 53

20
2 2 4 4 6 4 1 6 3 1 3 3 1 2 3 4 5 5 5 2 
149 107 161 107 145 107 107 181 139 107 128 132 107 130 158 107 107 107 158 186
*/

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 7984kb

input:

5
1 3 2 1 2

output:

3 6 3 3 6

result:

ok 5 tokens

Test #2:

score: 0
Accepted
time: 108ms
memory: 9264kb

input:

200000
15922 15391 11782 4758 1973 19909 16800 6438 3821 986 18599 2011 338 19886 12401 4169 11143 12665 3230 12565 15065 15056 5090 16908 13677 12634 11435 1425 8647 3876 10694 12256 3853 19901 5723 11065 6147 13613 13768 15794 14993 5819 8117 13871 14708 15099 7152 9810 14438 10557 3209 1265 13915...

output:

157122482 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 826457499 ...

result:

ok 200000 tokens

Test #3:

score: 0
Accepted
time: 108ms
memory: 9296kb

input:

200000
4065 9196 2588 18803 10818 17671 10483 13134 12147 19916 19382 19338 8864 7637 19542 14938 16362 7115 9159 9711 17907 17653 10175 3279 7471 3465 14016 13951 8676 2856 16709 5372 12237 18083 11052 16398 7140 9730 8800 18999 16808 8729 7608 6668 7049 6024 7892 18039 7278 12417 2440 13112 4039 5...

output:

47583147 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 345009231 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 370164779 3...

result:

ok 200000 tokens

Test #4:

score: 0
Accepted
time: 99ms
memory: 9272kb

input:

200000
1 1 1 1 4547 1 1 1 1 1 1 1 6329 1 1 19778 1 1 12258 1 1 1 1 1 18104 1 8123 1 329 1 1 1 1 1 1 1 1 4438 1 1 1 1 1 208 1 1 1 1 1 1 1 1 1 15603 1 1 1 1 1 1 1 1 1 1 5513 1 1 15427 1 1 1 1 1 1 1 18309 1 1 6333 1 1 1 1 1 1 1 1 1 13938 1 1 1 1 1 1 9229 1 1 1 1 1 1 1 1 1791 1 1 1 11747 1 1 1 1 8992 1 ...

output:

225508548 225508548 225508548 225508548 748768610 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 225508548 ...

result:

ok 200000 tokens

Test #5:

score: 0
Accepted
time: 98ms
memory: 9220kb

input:

200000
1 1 1 1 1 1 1 10166 1 1 9410 1 1 1 1 1 1 1 1 1 296 1 1 1 1 1 1 1 1 1 1 7392 4057 17616 1 1 1 1 3084 14799 1 1 13598 1 1 9848 1 1 1 1 1 8084 1 1 1 1 1 1 1 1 10519 1 1 1 1 1 14 1 1 1 1 1 1 1 1 1 1 14981 1 1 1 1 1 1 1 1 1 5144 7784 1 1 1 1 1 1 1 19661 1 14894 1 1 1 1 1 1 1 1 10449 1 1 1 16473 1 ...

output:

735167914 735167914 735167914 735167914 735167914 735167914 735167914 211149010 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 735167914 ...

result:

ok 200000 tokens

Test #6:

score: 0
Accepted
time: 103ms
memory: 9332kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 1 6 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 1 1 1 1 1 1 1 1 6 1 1 1 2397 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 415221870 450552969 425969980 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 450552969 ...

result:

ok 200000 tokens

Test #7:

score: 0
Accepted
time: 91ms
memory: 9224kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 9861 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1739 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11012 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1...

output:

723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 723674232 76256586 723674232 723674232 723674232 723674232 723674232 723674232 7...

result:

ok 200000 tokens

Test #8:

score: 0
Accepted
time: 95ms
memory: 9420kb

input:

200000
1 1 1 1 1 1 1 1 1 1 29 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 1 1 1...

output:

529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 773664190 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 529842888 ...

result:

ok 200000 tokens

Test #9:

score: 0
Accepted
time: 103ms
memory: 9348kb

input:

200000
1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

806160702 806160702 806160702 806160702 806160702 364515698 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 806160702 331355896 806160702 806160702 806160702 806160702 806160702 806160702 806160702 ...

result:

ok 200000 tokens

Test #10:

score: 0
Accepted
time: 102ms
memory: 9348kb

input:

200000
1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 18 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 1 ...

output:

819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 640790101 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 819517227 94445283 819517227 819517227 819517227 8...

result:

ok 200000 tokens

Test #11:

score: 0
Accepted
time: 110ms
memory: 9416kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 ...

output:

224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 224346786 883675827 224346786 724940402 224346786 224346786 224346786 224346786 224346786 ...

result:

ok 200000 tokens

Test #12:

score: 0
Accepted
time: 103ms
memory: 9412kb

input:

200000
380 1947 45 613 973 1687 176 1238 889 1168 1165 626 1832 727 27 1848 512 31 1243 94 427 1462 389 1824 1026 1103 1317 212 774 1115 1076 150 797 348 761 1763 418 1681 1795 1813 309 762 1880 1081 1375 1988 98 41 1800 171 1116 1633 71 1241 1358 1420 19 688 1318 787 1655 1377 32 947 1232 953 76 39...

output:

425384391 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 717656467 ...

result:

ok 200000 tokens

Test #13:

score: 0
Accepted
time: 106ms
memory: 9228kb

input:

200000
255 1944 1577 1738 1298 700 988 1061 626 1361 769 1602 1611 1838 275 297 1330 1553 659 267 764 1775 657 342 153 1406 536 1475 1736 1701 1014 1391 1047 1147 1290 1280 1227 1570 1287 1822 1896 564 1016 325 155 830 121 33 1088 1784 1611 656 1566 1225 158 705 1729 1605 1313 875 102 333 1550 990 6...

output:

983788768 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 7611565 76...

result:

ok 200000 tokens

Test #14:

score: 0
Accepted
time: 99ms
memory: 9348kb

input:

200000
1 1 894 1 1 1 1 1 1 1 1 1 1 1666 1 1 1648 1 1 1 1 822 1 1 1 1 1 1 1 218 1 1 132 1 1 1 1 1 1 1 1067 1 1 1 1 1 1 1 1 1 1 1178 1 1 1 1 70 1 1 1 1 1 1 1 1 1665 243 1 1 1 1 1 1925 1 1 1 1 1 1 1 975 1 1 1 1 1 1 1 1 1 1469 1 1 1 1 1 1 1 1 1 839 1 359 1 1 1 1 1 1 1 1 1790 1 1 1 1388 1 1 1 1 1 1 1 1 1...

output:

718644419 718644419 103241866 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 718644419 ...

result:

ok 200000 tokens

Test #15:

score: 0
Accepted
time: 103ms
memory: 9280kb

input:

200000
1 1 1 1 1 1 1 1 1 714 1 1 1 1 1 661 1 1 1 1 1 1 1 1724 1 1 1 1 1 1 1 1 1 1 924 911 1 1 1 1 1 1 1192 1 1 1 1 1 1907 1 1 1 388 1 1 1 1 1 1 1 1 1 1 1910 1 1 1 1 1304 1 1 1 1 1 1 1 1 1168 1 1 1 1 1 1 1 1 1872 1 194 1 1 1 33 1 1 1602 1 1 1 1 1 1 324 1 1 1 1 1 1 1 1 1 1 28 1 1 1 1 1 1 701 1 1 1 1 1...

output:

422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 767529344 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 422022560 ...

result:

ok 200000 tokens

Test #16:

score: 0
Accepted
time: 93ms
memory: 9280kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1451 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 353202539 ...

result:

ok 200000 tokens

Test #17:

score: 0
Accepted
time: 101ms
memory: 9280kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 812 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 858605372 ...

result:

ok 200000 tokens

Test #18:

score: 0
Accepted
time: 101ms
memory: 9272kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 761164523 ...

result:

ok 200000 tokens

Test #19:

score: 0
Accepted
time: 102ms
memory: 9224kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 90869376 908...

result:

ok 200000 tokens

Test #20:

score: 0
Accepted
time: 102ms
memory: 9328kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 526920358 ...

result:

ok 200000 tokens

Test #21:

score: 0
Accepted
time: 102ms
memory: 9224kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 24467815 244...

result:

ok 200000 tokens

Test #22:

score: 0
Accepted
time: 106ms
memory: 9416kb

input:

200000
53 129 38 148 167 107 148 99 161 198 71 149 103 49 36 144 57 11 107 15 72 75 91 154 191 190 177 122 197 36 196 126 150 108 6 117 81 58 51 55 181 135 106 181 149 165 150 38 5 63 194 84 89 4 135 175 63 78 74 32 47 106 10 16 161 88 50 95 4 82 58 181 156 197 194 21 138 91 105 106 109 159 51 76 86...

output:

300601705 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 18494655 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 553401883 5...

result:

ok 200000 tokens

Test #23:

score: 0
Accepted
time: 105ms
memory: 9416kb

input:

200000
52 30 8 75 150 80 87 129 133 108 88 182 41 198 109 56 92 42 42 125 198 86 140 131 17 184 31 81 195 150 39 66 12 95 168 49 55 142 5 72 43 191 179 152 65 77 175 168 126 77 193 58 124 43 154 38 2 52 22 153 190 143 109 19 92 116 27 59 174 24 184 24 142 80 130 151 61 34 101 71 54 50 125 40 54 101 ...

output:

576237374 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 566996520 ...

result:

ok 200000 tokens

Test #24:

score: 0
Accepted
time: 105ms
memory: 9264kb

input:

200000
1 1 1 113 1 1 1 1 1 1 1 1 1 24 1 109 1 1 1 1 1 160 1 1 1 1 1 1 1 1 133 1 1 89 1 1 1 1 33 1 1 1 1 164 1 1 1 1 1 186 1 1 1 1 1 1 115 1 1 1 1 1 1 1 1 30 1 1 1 1 170 55 1 1 1 76 1 1 1 1 1 1 1 190 1 1 1 1 1 1 1 162 1 1 1 1 6 1 1 1 1 1 1 1 1 182 186 1 1 50 1 1 1 1 67 1 1 1 1 1 1 165 1 1 1 1 1 1 1 1...

output:

725226252 725226252 725226252 750600882 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 725226252 ...

result:

ok 200000 tokens

Test #25:

score: 0
Accepted
time: 110ms
memory: 9352kb

input:

200000
1 1 1 1 1 1 1 1 1 17 1 1 1 1 126 1 1 1 1 1 1 1 1 95 1 1 169 1 1 1 1 1 1 1 197 1 1 1 1 143 1 1 1 1 1 1 117 1 1 1 1 1 117 1 73 1 1 183 1 153 1 1 1 1 1 1 1 130 1 1 1 1 1 94 1 1 1 1 1 75 1 1 1 1 88 62 1 1 1 1 1 1 1 70 1 1 1 1 1 1 1 1 13 1 1 1 39 1 1 1 1 1 1 1 45 191 1 1 157 1 1 1 1 1 1 1 1 1 152 ...

output:

183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 262661924 183224204 183224204 183224204 183224204 592152678 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 183224204 ...

result:

ok 200000 tokens

Test #26:

score: 0
Accepted
time: 99ms
memory: 9316kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 156 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 827635970 ...

result:

ok 200000 tokens

Test #27:

score: 0
Accepted
time: 104ms
memory: 9328kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 173 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 582217512 478963203 ...

result:

ok 200000 tokens

Test #28:

score: 0
Accepted
time: 94ms
memory: 9340kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 700746312 ...

result:

ok 200000 tokens

Test #29:

score: 0
Accepted
time: 86ms
memory: 9280kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 433215183 ...

result:

ok 200000 tokens

Test #30:

score: 0
Accepted
time: 96ms
memory: 9328kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 961570465 ...

result:

ok 200000 tokens

Test #31:

score: 0
Accepted
time: 88ms
memory: 9344kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 92548611 925...

result:

ok 200000 tokens

Test #32:

score: 0
Accepted
time: 1ms
memory: 5856kb

input:

100
7 5 9 7 2 1 7 2 1 9 1 8 8 1 2 8 6 5 6 6 5 6 2 3 8 10 4 8 10 7 1 9 8 3 2 9 5 10 1 9 5 4 2 4 2 5 4 7 7 10 1 7 3 6 4 8 5 5 9 3 9 3 1 7 4 1 6 3 3 5 5 10 3 1 7 1 6 2 6 3 1 9 2 3 2 5 2 3 9 3 9 1 1 8 1 9 3 9 5 9

output:

80012380 42591007 69231102 42591007 42591007 42591007 42591007 42591007 42591007 57677538 42591007 52642780 54058087 42591007 46599929 59143905 44398018 43705698 44704063 45528542 45084289 48840558 45527037 48481629 50222919 49038124 44681995 44595932 45406740 47724058 42591007 46944631 45429315 459...

result:

ok 100 tokens

Test #33:

score: 0
Accepted
time: 1ms
memory: 5856kb

input:

100
12 1 2 11 1 4 6 15 2 9 12 8 11 2 16 8 10 7 17 10 5 17 4 5 6 16 7 7 17 14 15 7 5 10 10 3 15 1 17 7 10 20 11 12 13 16 5 6 12 13 8 2 8 12 18 12 6 13 13 7 12 17 18 4 20 13 3 11 10 2 6 14 3 15 8 12 13 10 6 19 12 19 8 17 7 14 17 15 20 17 12 10 8 13 2 13 16 20 10 14

output:

24171 5221 5221 5221 5221 5221 5221 7856 5221 5221 5221 5221 5221 5221 5911 5221 5771 5715 5667 5626 5561 5531 5482 5438 5397 5378 5361 5346 5362 5319 5307 5296 5286 5333 5365 5385 5816 5221 5715 5405 5410 6750 5389 5401 5411 5408 5401 5403 5403 5401 5557 5391 5536 5381 5660 5383 5381 5373 5374 5339...

result:

ok 100 tokens

Test #34:

score: 0
Accepted
time: 1ms
memory: 5816kb

input:

300
3 11 20 7 16 12 9 18 7 19 10 18 12 14 20 18 7 10 4 5 3 5 2 19 19 13 11 16 3 18 4 15 9 7 5 1 9 14 11 8 15 3 14 12 13 2 20 5 11 2 20 15 5 14 12 13 5 3 15 11 10 8 20 8 10 1 17 4 5 5 20 14 7 5 14 7 10 2 7 14 17 14 7 15 7 12 9 20 2 3 14 14 12 11 2 9 14 9 16 16 16 10 1 18 18 7 1 12 6 12 13 16 11 16 10...

output:

697699638 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 421636433 54311805 74687058 666711641 398242955 666711641 448424433 898399680 994443712 466058054 743345614 30...

result:

ok 300 tokens

Test #35:

score: 0
Accepted
time: 105ms
memory: 9416kb

input:

200000
2 2 2 1 1 3 2 1 2 3 3 2 2 3 3 1 1 2 1 1 1 1 2 3 3 1 3 1 3 2 1 2 3 3 2 2 3 1 3 1 2 3 3 1 3 1 2 3 3 2 2 3 3 2 1 1 1 2 1 3 1 1 1 2 3 3 1 3 1 2 3 3 1 2 3 2 2 3 2 2 1 1 3 2 3 3 3 3 2 3 2 1 2 2 1 2 3 1 2 3 2 3 1 3 3 2 1 1 2 2 2 1 2 2 2 3 3 3 3 3 1 1 1 1 2 3 2 2 2 1 3 1 3 3 3 2 1 3 1 1 1 1 3 3 1 3 2...

output:

444398413 665936789 555167601 665936789 665936789 143361571 761070616 665936789 376412429 25202780 376412429 727622078 961761844 610552195 555167601 665936789 665936789 555167601 665936789 665936789 665936789 665936789 483337931 809596129 483337931 665936789 790126370 665936789 626997271 65780304 66...

result:

ok 200000 tokens

Test #36:

score: 0
Accepted
time: 98ms
memory: 9260kb

input:

200000
9 7 6 8 3 4 2 4 2 6 4 6 5 7 2 5 10 4 7 7 3 8 1 4 5 4 9 5 10 10 6 4 5 3 2 6 4 6 5 6 2 5 2 6 9 10 9 9 8 9 7 3 10 4 5 7 10 4 6 1 5 3 3 10 10 2 6 2 3 6 5 10 1 1 4 2 9 6 4 3 9 7 8 5 7 2 6 4 3 5 8 9 3 6 2 1 1 10 10 7 4 2 6 3 3 4 4 2 8 1 6 5 1 8 5 8 5 6 10 7 3 9 10 8 1 6 4 9 10 9 6 4 3 9 3 9 10 9 1 ...

output:

317998635 375262180 375262180 375262180 375262180 375262180 375262180 375262180 375262180 404121322 707747700 615811947 527917555 768028500 708601872 613829643 842252844 993668088 340214511 766253777 651069439 435190184 375262180 729610616 394965425 808180413 235927248 308475028 44493600 983865994 1...

result:

ok 200000 tokens

Test #37:

score: 0
Accepted
time: 103ms
memory: 9264kb

input:

200000
16 29 19 26 5 10 8 12 9 21 28 20 15 15 16 14 1 5 5 16 28 3 13 23 22 15 22 12 1 14 19 24 25 15 8 8 13 3 1 27 28 18 8 7 27 2 18 9 2 13 13 15 18 23 21 23 27 7 7 10 16 5 19 29 20 17 28 20 22 26 9 6 5 13 19 23 2 16 21 9 17 12 21 22 23 15 5 9 30 3 24 11 4 22 22 17 6 22 22 24 21 29 25 17 15 30 16 4 ...

output:

293045010 627024432 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 402867102 793281169 ...

result:

ok 200000 tokens

Test #38:

score: 0
Accepted
time: 106ms
memory: 9328kb

input:

200000
50 59 99 95 33 98 12 85 55 40 37 89 51 7 71 52 85 91 76 34 29 60 95 2 41 36 4 42 91 6 85 4 53 48 15 51 46 10 13 71 68 8 16 84 33 24 98 91 56 58 63 78 7 26 51 55 75 5 6 13 5 37 14 27 36 12 65 63 81 61 52 67 14 60 89 28 43 88 42 22 29 80 36 81 42 15 24 95 78 74 49 80 56 11 93 69 25 64 84 21 77 ...

output:

936814648 597799851 516815561 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 597799851 ...

result:

ok 200000 tokens

Test #39:

score: 0
Accepted
time: 102ms
memory: 9328kb

input:

200000
379 16 236 260 348 139 380 67 302 67 72 159 151 256 214 211 160 257 211 80 166 392 141 169 282 395 279 295 98 181 312 181 54 274 124 244 371 22 241 57 11 263 76 59 291 255 322 149 36 107 15 346 380 110 258 123 138 63 31 243 340 246 155 316 20 163 132 151 279 8 311 121 253 90 184 104 300 243 7...

output:

470409828 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31086466 31...

result:

ok 200000 tokens

Test #40:

score: 0
Accepted
time: 107ms
memory: 9336kb

input:

200000
1430 963 1357 314 1109 864 1348 496 1183 220 719 1261 703 333 1365 198 721 685 1143 1447 1351 367 891 20 768 1169 754 319 1113 1191 974 532 1466 455 241 1176 1019 563 344 655 868 1446 989 1318 624 679 682 802 575 368 1475 127 128 565 828 1077 1236 519 676 1190 1029 457 1479 1498 752 598 445 1...

output:

380199761 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69057399 69...

result:

ok 200000 tokens

Test #41:

score: 0
Accepted
time: 107ms
memory: 9352kb

input:

200000
3162 3453 3258 3108 3715 3752 230 2743 307 1739 2982 2307 3232 2031 217 3242 2581 3886 3381 1091 1744 2648 2274 2006 516 3889 3101 1889 632 3953 2263 2486 2503 1699 468 3226 254 2310 2285 808 1570 2895 302 1324 231 3685 1944 2889 3577 1060 3648 788 2647 2363 398 918 3603 750 1728 2317 3507 13...

output:

321639721 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19554262 19...

result:

ok 200000 tokens

Test #42:

score: 0
Accepted
time: 106ms
memory: 9332kb

input:

200000
3522 6233 4157 6952 6534 9727 5324 7793 4986 8897 7296 5464 4821 2088 5419 6193 6004 5666 9477 770 2985 6416 6695 5064 5175 7272 3762 9586 5432 7299 6758 7413 6951 736 7851 534 198 6592 9611 3283 2970 5416 4885 3691 2538 4370 9660 8785 6899 9004 3414 3821 2679 8471 8686 3994 809 7369 5555 543...

output:

855664730 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 319694377 ...

result:

ok 200000 tokens

Test #43:

score: 0
Accepted
time: 98ms
memory: 9416kb

input:

200000
13151 13043 15939 4003 3799 6745 14758 17658 1854 19751 1506 3696 12946 19913 3753 13151 17222 1709 6493 9035 18831 17719 10008 535 2408 8478 4213 21854 9407 15853 11588 555 16502 8019 15482 1472 15202 7603 3534 21219 6640 19349 4766 16653 18795 5827 14424 2265 17783 14797 18593 14379 570 219...

output:

949527696 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 234505604 ...

result:

ok 200000 tokens

Test #44:

score: 0
Accepted
time: 101ms
memory: 9344kb

input:

200000
2608 38741 4247 518 21640 5817 16595 36443 19472 32863 36988 2971 35495 3240 33019 1625 33801 38902 33556 7681 28451 713 15817 28438 5368 43525 22990 35934 40926 8274 36531 18945 42825 14619 36390 20013 29776 10864 26118 28797 19899 37340 28137 40485 10635 30471 17623 44560 19922 44365 34196 ...

output:

945517856 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 572879218 ...

result:

ok 200000 tokens

Test #45:

score: 0
Accepted
time: 100ms
memory: 9336kb

input:

200000
58086 6368 7844 5558 62993 60348 48332 44365 69279 77503 79143 59809 9658 31300 11652 57084 9843 55079 46805 39534 54462 7370 38702 66250 12019 66578 78668 46374 8399 16616 69004 12255 68209 64953 47855 29843 49373 18166 21789 23589 23164 66197 49630 75068 47514 77454 11682 57924 47207 56158 ...

output:

80009 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 40005 ...

result:

ok 200000 tokens

Test #46:

score: 0
Accepted
time: 104ms
memory: 9360kb

input:

200000
88473 4347 58303 84402 86559 8600 73964 26571 86439 76241 56293 13504 92885 49248 1793 36750 67732 113186 43932 4052 63055 92059 30739 6550 5049 96943 98890 3197 53446 110762 26217 83925 82032 42745 93787 111182 17843 39791 85198 74236 86352 49025 64245 32727 87758 34826 27017 19324 36853 658...

output:

2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok 200000 tokens

Extra Test:

score: 0
Extra Test Passed