CSES - Putka Open 2020 – 5/5 - Results
Submission details
Task:Pyramidi
Sender:Lieska
Submission time:2020-11-27 18:26:20 +0200
Language:C++11
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#1ACCEPTED0.19 s1, 2details
#2ACCEPTED0.19 s1, 2details
#3ACCEPTED0.19 s1, 2details
#4ACCEPTED0.19 s1, 2details
#5ACCEPTED0.19 s1, 2details
#6ACCEPTED0.19 s1, 2details
#7ACCEPTED0.19 s1, 2details
#8ACCEPTED0.19 s1, 2details
#9ACCEPTED0.19 s1, 2details
#10ACCEPTED0.19 s1, 2details
#110.19 s1, 2details
#120.19 s1, 2details
#130.19 s1, 2details
#140.19 s1, 2details
#150.19 s1, 2details
#160.28 s2details
#170.28 s2details
#180.28 s2details
#190.28 s2details
#200.28 s2details

Code

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

typedef long long ll;

ll M=1e9+7, kertoma[202020], rkertoma[202020];

ll pot(int a, int b){
	if (b==0) return 1;
	ll l=pot(a, b/2);
	l=(l*l)%M;
	if (b%2==1) l=(l*a)%M;
	return l;
}


int main(){
	kertoma[0]=1;
	rkertoma[0]=1;
	for (ll i=1; i<=200000; ++i){
		kertoma[i]=(kertoma[i-1]*i)%M;
		rkertoma[i]=(rkertoma[i-1]*pot(i, M-2))%M;
	}
	int n;
	cin >> n;
	ll ans=0;
	for (int i=0; i<n; ++i){
		ll a;
		cin >> a;
		ll b=(kertoma[n-1]*rkertoma[i])%M;
		b=(b*rkertoma[n-i-1])%M;
		if (b%2==1) {
			ans = ans^a;
		}
	}
	cout << ans << "\n";
}

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

input
1
80

correct output
80

user output
80

Test 2

Group: 1, 2

Verdict: ACCEPTED

input
2
69 91

correct output
30

user output
30

Test 3

Group: 1, 2

Verdict: ACCEPTED

input
3
47 74 75

correct output
100

user output
100

Test 4

Group: 1, 2

Verdict: ACCEPTED

input
4
94 22 100 43

correct output
7

user output
7

Test 5

Group: 1, 2

Verdict: ACCEPTED

input
5
50 82 47 40 51

correct output
1

user output
1

Test 6

Group: 1, 2

Verdict: ACCEPTED

input
6
90 27 98 85 47 14

correct output
96

user output
96

Test 7

Group: 1, 2

Verdict: ACCEPTED

input
7
55 82 52 9 65 90 86

correct output
20

user output
20

Test 8

Group: 1, 2

Verdict: ACCEPTED

input
8
45 52 52 95 40 85 3 46

correct output
34

user output
34

Test 9

Group: 1, 2

Verdict: ACCEPTED

input
9
77 16 59 32 22 41 87 89 78

correct output
3

user output
3

Test 10

Group: 1, 2

Verdict: ACCEPTED

input
10
59 78 34 26 71 9 82 68 80 74

correct output
111

user output
111

Test 11

Group: 1, 2

Verdict:

input
100
100 6 10 53 84 80 7 87 3 82 26...

correct output
91

user output
3

Test 12

Group: 1, 2

Verdict:

input
100
25 18 62 51 79 55 71 33 21 29 ...

correct output
58

user output
86

Test 13

Group: 1, 2

Verdict:

input
100
3 20 19 60 11 84 94 79 63 59 9...

correct output
124

user output
30

Test 14

Group: 1, 2

Verdict:

input
100
99 86 42 2 97 78 8 12 98 7 98 ...

correct output
49

user output
101

Test 15

Group: 1, 2

Verdict:

input
100
19 19 14 30 80 53 21 18 26 85 ...

correct output
42

user output
123

Test 16

Group: 2

Verdict:

input
200000
852837035 608724072 368935143 ...

correct output
680579671

user output
803629049

Test 17

Group: 2

Verdict:

input
200000
255817977 550740070 115276527 ...

correct output
177586289

user output
530664195

Test 18

Group: 2

Verdict:

input
200000
30889540 9467827 526159961 367...

correct output
439343644

user output
992933759

Test 19

Group: 2

Verdict:

input
200000
421000302 598694653 199802169 ...

correct output
184880259

user output
536422091

Test 20

Group: 2

Verdict:

input
200000
578873143 289492857 855880936 ...

correct output
937457144

user output
558157435