QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#623759 | #6110. Squirrel Game | lmy11 | WA | 1ms | 3840kb | C++23 | 878b | 2024-10-09 13:55:23 | 2024-10-09 13:55:26 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define int long long
template<class T>using pq = priority_queue<T>;
template<class T>using pqg = priority_queue<T, vector<T>, greater<T>>;
vector<vector<int>>ans(15);
int pos=1;
int SG(vector<int>sg)
{
int n=sg.size();
int g=0;
for(int i=n-1;i>=0;i-=2)
{
g^=sg[i];
}
return g;
}
void solve()
{
int n,m,k;
cin>>n>>m>>k;
vector<int>szh;
for(int i=0;i<m;i++)
{
int key;
cin>>key;
szh.push_back(key-pos);
pos=key;
}
for(int i=0;i<m;i++)
{
ans[i%k].push_back(szh[i]);
}
int g=0;
for(int i=0;i<k;i++)
{
g^=SG(ans[i]);
}
if(!g)cout<<"Nova"<<endl;
else cout<<"Twinkle"<<endl;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;
T=1;
while(T--)solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3552kb
input:
7 3 2 1 4 7
output:
Nova
result:
ok single line: 'Nova'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
7 3 1 1 4 7
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1 1 1 1
output:
Nova
result:
ok single line: 'Nova'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 1 10 1
output:
Nova
result:
ok single line: 'Nova'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
100000 1 1 19593
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
100000 1 10 62516
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
100 10 1 23 24 43 47 62 66 68 73 82 85
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
100 10 3 11 18 23 26 30 40 52 76 78 99
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
100 10 7 14 27 51 62 66 71 75 79 80 97
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
100 10 10 10 18 25 50 51 54 64 77 95 96
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
100 5 10 15 52 61 65 78
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #12:
score: -100
Wrong Answer
time: 0ms
memory: 3496kb
input:
10 10 1 1 2 3 4 5 6 7 8 9 10
output:
Twinkle
result:
wrong answer 1st lines differ - expected: 'Nova', found: 'Twinkle'