QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#69879#5247. Walizki [C]tygrysek2 3ms3572kbC++173.2kb2023-01-03 02:44:432023-01-03 02:44:44

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-03 02:44:44]
  • 评测
  • 测评结果:2
  • 用时:3ms
  • 内存:3572kb
  • [2023-01-03 02:44:43]
  • 提交

answer

#include <stdio.h>
#include <time.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <map> 
#include <string>
#include <vector>  
#include <iostream> 
#include <sstream> 
#include <queue>
#include <algorithm>
#include <assert.h>
#include <iomanip> 


using namespace std;

#define ll long long
#define PB 		push_back
#define FOR(a,start,end) 	for(int a=int(start); a<int(end); a++)
#define INF 		INT_MAX
#define SORT(a) 	sort(a.begin(),a.end()) 
#define CL(a,x) 		memset(a,x,sizeof(a))
#define REP(a,x)	for(int a=0;a<x;a++)
#define REP1(a,x)	for(int a=1;a<=x;a++)
#define MP 		make_pair



typedef vector<ll>     vi;
typedef pair<ll, ll>     pii;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vector<ll> > vvi;
typedef vector<vector<string> > vvs;
typedef vector<pair<string, string> > vss;
typedef pair<string, string> pss;
typedef pair<ll, pii> ppii;
typedef vector<ppii> vppii;
typedef vector<vector<pii> > vvii;
typedef vector<vvi> vvvi;


ll  n, k, q, d, r, g, b, z, p, a, c, m, k1, k2;
char zn;
vs vw, vwk;
string wa, wb;
vi vk, va, vc,vb;
vii vkx, vkx2;
vvi vvk,vva,vvb;
vector<bool> vac;

ll gcd(ll a, ll b) {
	ll k, m;

	if (a > b) {
		k = a;
		a = b;
		b = k;
	}
	k = b % a;
	if (k == 0)
		return a;
	else {
		while (k != 0) {
			m = k;
			b = a;
			a = k;
			k = b % a;
		}
		return m;
	}
}
int main() {
	//freopen("c:\\wojtek\\uva\\pa\\debug\\10.in", "rt", stdin);
	//d = 1000000007;

	//while (1) {

	cin >> n;

	vk.clear();
	vvk.assign(n + 1, vk);
	vva.assign(n + 1, vk);
	vvb.assign(n + 1, vk);
	vkx.assign(n + 1, MP(0, 0));
	vc.assign(n + 1, 0ll);
	va.assign(n + 1, 0ll);
	vb.assign(n + 1, 0ll);
	va[1] = 1;
	vac.assign(n + 1, false);
	vac[1] = true;
	for (int i = 1; i <= n; i++) {
		cin >> k;
		vkx[i].second = k;
		for (int j = 0; j < k; j++) {
			cin >> b;
			vvk[i].push_back(b);
		}
	}
	if (vkx[1].second == 0)
		cout << 1 << endl;
	else {
		/*
		for (int i = 1; i <= n; i++) {
			for (int j = 0; j < (int)vvk[i].size(); j++) {
				vva[vvk[i][j]].push_back(vkx[i].second);
				vvb[vvk[i][j]].push_back(i);
			}
		}
		*/
		
		vc[1] = vkx[1].second;
		vva[1].push_back(1);
		vvb[1].push_back(1);
		for (int i = 1; i <= n; i++) {
			if (vac[i]&&(vkx[i].second > 0)) {
				a = 1;
				k = 1;
				for (int j = 0; j < (int)vva[i].size(); j++) {
					a = gcd(k, vva[i][j]);
					k *= vva[i][j];
					k /= a;
				}
				//k /= a;	//k - nww il.ruch\xf3w z do\xb3u 
				//
				va[i] = 0; // \xb3\xb9czna il ruch\xf3w z do\xb3u na k ruch\xf3w
				for (int j = 0; j < (int)vva[i].size(); j++) {
					va[i] += ((k /vva[i][j])* vvb[i][j]) ;
				}
				//

				vc[i] = va[i] * vkx[i].second;//cykl i
				a = gcd(va[i], vkx[i].second);
				vc[i] /= a;
				vc[i] /= va[i];
				vc[i] *= k;

				c=((vc[i] / k)* va[i])/vkx[i].second;	//il do g\xf3ry na ka\xbfd\xb9 ta\x9cme
				//
				for (int j = 0; j < (int)vvk[i].size(); j++) {
					vva[vvk[i][j]].push_back(vc[i]);
					vvb[vvk[i][j]].push_back(c);
					vac[vvk[i][j]] = true;
				}
			}
		}
		z = 1;
		for (int i = 1; i <= n; i++) {
			if (vc[i] > 1) {
				a = gcd(z, vc[i]);
				z = (z * vc[i]) / a;
			}
		}
		cout << z << endl;
	}

	
	//}
// }

	return 0;

}

详细

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 2ms
memory: 3400kb

input:

1
0

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3248kb

input:

3
2 2 3
1 3
0

output:

2

result:

ok single line: '2'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3340kb

input:

5
4 2 3 4 5
3 3 4 5
2 4 5
1 5
0

output:

12

result:

ok single line: '12'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3216kb

input:

7
6 2 3 4 5 6 7
5 3 4 5 6 7
4 4 5 6 7
3 5 6 7
2 6 7
1 7
0

output:

60

result:

ok single line: '60'

Test #5:

score: 0
Accepted
time: 3ms
memory: 3392kb

input:

9
8 2 3 4 5 6 7 8 9
7 3 4 5 6 7 8 9
6 4 5 6 7 8 9
5 5 6 7 8 9
4 6 7 8 9
3 7 8 9
2 8 9
1 9
0

output:

840

result:

ok single line: '840'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3312kb

input:

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

output:

1

result:

ok single line: '1'

Test #7:

score: 0
Accepted
time: 2ms
memory: 3472kb

input:

10
5 3 5 7 8 10
2 9 10
3 5 6 10
3 6 8 9
1 7
1 8
2 8 9
0
0
0

output:

30

result:

ok single line: '30'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3212kb

input:

10
8 2 3 4 6 7 8 9 10
7 3 4 5 6 7 9 10
7 4 5 6 7 8 9 10
5 6 7 8 9 10
4 6 7 8 9
4 7 8 9 10
2 8 9
2 9 10
0
0

output:

125440

result:

ok single line: '125440'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3276kb

input:

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

output:

1

result:

ok single line: '1'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3208kb

input:

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

output:

2187

result:

ok single line: '2187'

Test #11:

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

input:

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

output:

37500

result:

ok single line: '37500'

Subtask #2:

score: 1
Accepted

Test #12:

score: 1
Accepted
time: 2ms
memory: 3280kb

input:

2
1 2
0

output:

1

result:

ok single line: '1'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3292kb

input:

4
3 2 3 4
2 3 4
1 4
0

output:

6

result:

ok single line: '6'

Test #14:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

6
5 2 3 4 5 6
4 3 4 5 6
3 4 5 6
2 5 6
1 6
0

output:

60

result:

ok single line: '60'

Test #15:

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

input:

8
7 2 3 4 5 6 7 8
6 3 4 5 6 7 8
5 4 5 6 7 8
4 5 6 7 8
3 6 7 8
2 7 8
1 8
0

output:

420

result:

ok single line: '420'

Test #16:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

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

output:

2520

result:

ok single line: '2520'

Test #17:

score: 0
Accepted
time: 2ms
memory: 3220kb

input:

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

output:

72

result:

ok single line: '72'

Test #18:

score: 0
Accepted
time: 2ms
memory: 3292kb

input:

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

output:

360

result:

ok single line: '360'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

9
8 2 3 4 5 6 7 8 9
6 3 4 5 6 8 9
6 4 5 6 7 8 9
4 5 7 8 9
3 6 7 9
3 7 8 9
2 8 9
1 9
0

output:

20736

result:

ok single line: '20736'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3348kb

input:

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

output:

256

result:

ok single line: '256'

Test #21:

score: 0
Accepted
time: 2ms
memory: 3292kb

input:

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

output:

12288

result:

ok single line: '12288'

Test #22:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

10
0
0
0
0
0
0
0
0
0
0

output:

1

result:

ok single line: '1'

Subtask #3:

score: 0
Wrong Answer

Test #23:

score: 1
Accepted
time: 2ms
memory: 3300kb

input:

11
10 2 3 4 5 6 7 8 9 10 11
9 3 4 5 6 7 8 9 10 11
8 4 5 6 7 8 9 10 11
7 5 6 7 8 9 10 11
6 6 7 8 9 10 11
5 7 8 9 10 11
4 8 9 10 11
3 9 10 11
2 10 11
1 11
0

output:

2520

result:

ok single line: '2520'

Test #24:

score: 0
Accepted
time: 2ms
memory: 3348kb

input:

13
12 2 3 4 5 6 7 8 9 10 11 12 13
11 3 4 5 6 7 8 9 10 11 12 13
10 4 5 6 7 8 9 10 11 12 13
9 5 6 7 8 9 10 11 12 13
8 6 7 8 9 10 11 12 13
7 7 8 9 10 11 12 13
6 8 9 10 11 12 13
5 9 10 11 12 13
4 10 11 12 13
3 11 12 13
2 12 13
1 13
0

output:

27720

result:

ok single line: '27720'

Test #25:

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

input:

15
14 2 3 4 5 6 7 8 9 10 11 12 13 14 15
13 3 4 5 6 7 8 9 10 11 12 13 14 15
12 4 5 6 7 8 9 10 11 12 13 14 15
11 5 6 7 8 9 10 11 12 13 14 15
10 6 7 8 9 10 11 12 13 14 15
9 7 8 9 10 11 12 13 14 15
8 8 9 10 11 12 13 14 15
7 9 10 11 12 13 14 15
6 10 11 12 13 14 15
5 11 12 13 14 15
4 12 13 14 15
3 13 14 1...

output:

360360

result:

ok single line: '360360'

Test #26:

score: 0
Accepted
time: 2ms
memory: 3480kb

input:

17
16 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
15 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
14 4 5 6 7 8 9 10 11 12 13 14 15 16 17
13 5 6 7 8 9 10 11 12 13 14 15 16 17
12 6 7 8 9 10 11 12 13 14 15 16 17
11 7 8 9 10 11 12 13 14 15 16 17
10 8 9 10 11 12 13 14 15 16 17
9 9 10 11 12 13 14 15 16 17
8 10 11 12...

output:

720720

result:

ok single line: '720720'

Test #27:

score: 0
Accepted
time: 2ms
memory: 3324kb

input:

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

output:

12252240

result:

ok single line: '12252240'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3292kb

input:

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

output:

1

result:

ok single line: '1'

Test #29:

score: 0
Accepted
time: 2ms
memory: 3476kb

input:

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

output:

13453440

result:

ok single line: '13453440'

Test #30:

score: -1
Wrong Answer
time: 2ms
memory: 3352kb

input:

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

output:

-7410142532693977664

result:

wrong answer 1st lines differ - expected: '30792244234752000', found: '-7410142532693977664'

Subtask #4:

score: 0
Runtime Error

Test #34:

score: 1
Accepted
time: 2ms
memory: 3252kb

input:

12
11 2 3 4 5 6 7 8 9 10 11 12
10 3 4 5 6 7 8 9 10 11 12
9 4 5 6 7 8 9 10 11 12
8 5 6 7 8 9 10 11 12
7 6 7 8 9 10 11 12
6 7 8 9 10 11 12
5 8 9 10 11 12
4 9 10 11 12
3 10 11 12
2 11 12
1 12
0

output:

27720

result:

ok single line: '27720'

Test #35:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

14
13 2 3 4 5 6 7 8 9 10 11 12 13 14
12 3 4 5 6 7 8 9 10 11 12 13 14
11 4 5 6 7 8 9 10 11 12 13 14
10 5 6 7 8 9 10 11 12 13 14
9 6 7 8 9 10 11 12 13 14
8 7 8 9 10 11 12 13 14
7 8 9 10 11 12 13 14
6 9 10 11 12 13 14
5 10 11 12 13 14
4 11 12 13 14
3 12 13 14
2 13 14
1 14
0

output:

360360

result:

ok single line: '360360'

Test #36:

score: 0
Accepted
time: 2ms
memory: 3224kb

input:

16
15 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
14 3 4 5 6 7 8 9 10 11 12 13 14 15 16
13 4 5 6 7 8 9 10 11 12 13 14 15 16
12 5 6 7 8 9 10 11 12 13 14 15 16
11 6 7 8 9 10 11 12 13 14 15 16
10 7 8 9 10 11 12 13 14 15 16
9 8 9 10 11 12 13 14 15 16
8 9 10 11 12 13 14 15 16
7 10 11 12 13 14 15 16
6 11 12 13 1...

output:

360360

result:

ok single line: '360360'

Test #37:

score: 0
Accepted
time: 2ms
memory: 3280kb

input:

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

output:

12252240

result:

ok single line: '12252240'

Test #38:

score: 0
Accepted
time: 2ms
memory: 3480kb

input:

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

output:

232792560

result:

ok single line: '232792560'

Test #39:

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

input:

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

output:

9525600

result:

ok single line: '9525600'

Test #40:

score: 0
Accepted
time: 2ms
memory: 3208kb

input:

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

output:

72576000

result:

ok single line: '72576000'

Test #41:

score: -1
Runtime Error

input:

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

output:


result:


Subtask #5:

score: 0
Wrong Answer

Test #45:

score: 0
Wrong Answer
time: 3ms
memory: 3364kb

input:

25
24 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
23 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
22 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
21 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
20 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...

output:

1507654933

result:

wrong answer 1st lines differ - expected: '5354228880', found: '1507654933'

Subtask #6:

score: 0
Wrong Answer

Test #56:

score: 0
Wrong Answer
time: 0ms
memory: 3236kb

input:

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

output:

759483096985783848

result:

wrong answer 1st lines differ - expected: '26771144400', found: '759483096985783848'

Subtask #7:

score: 0
Wrong Answer

Test #67:

score: 0
Wrong Answer
time: 3ms
memory: 3356kb

input:

61
60 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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
59 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ...

output:

2497711522311459436

result:

wrong answer 1st lines differ - expected: '9690712164777231700912800', found: '2497711522311459436'

Subtask #8:

score: 0
Wrong Answer

Test #78:

score: 0
Wrong Answer
time: 3ms
memory: 3328kb

input:

62
61 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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
60 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 ...

output:

-401281213809406778

result:

wrong answer 1st lines differ - expected: '591133442051411133755680800', found: '-401281213809406778'

Subtask #9:

score: 0
Wrong Answer

Test #89:

score: 0
Wrong Answer
time: 3ms
memory: 3572kb

input:

91
90 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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 91
89 3 4 5 6 7 8 9 10 11 12 13 14 ...

output:

1315399958713160752

result:

wrong answer 1st lines differ - expected: '718766754945489455304472257065075294400', found: '1315399958713160752'

Subtask #10:

score: 0
Wrong Answer

Test #101:

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

input:

92
91 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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 91 92
90 3 4 5 6 7 8 9 10 11 12 13 ...

output:

-56067346153002351

result:

wrong answer 1st lines differ - expected: '718766754945489455304472257065075294400', found: '-56067346153002351'