-
Notifications
You must be signed in to change notification settings - Fork 0
/
CF-603C.cpp
55 lines (51 loc) · 1.07 KB
/
CF-603C.cpp
1
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
#include <bits/stdc++.h>
using namespace std;
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> ii;
int solve_even(const int x) {
if (x == 0)
return 0;
else if (x == 1)
return 1;
else if (x == 2)
return 2;
else
return 1 - (x%2);
}
int solve_odd(const int x) {
if (x == 0)
return 0;
else if (x == 1)
return 1;
else if (x == 2)
return 0;
else if (x == 3)
return 1;
else if (x == 4)
return 2;
else if (x % 2)
return 0;
const int nimber = solve_odd(x / 2);
if (nimber == 1)
return 2;
else
return 1;
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin>>n>>k;
int nimber = 0;
for (int i = 0; i < n; ++i) {
int x;
cin>>x;
if (k % 2)
nimber ^= solve_odd(x);
else
nimber ^= solve_even(x);
}
cout<<(nimber ? "Kevin" : "Nicky")<<endl;
}