QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#107328 | #6110. Squirrel Game | bulijiojiodibuliduo# | WA | 4ms | 5976kb | C++ | 1021b | 2023-05-20 23:38:27 | 2023-05-20 23:38:31 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef basic_string<int> BI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head
const int N=101000;
int n,m,k,x[N];
VI ps[N];
int main() {
scanf("%d%d%d",&m,&n,&k);
rep(i,1,n+1) scanf("%d",&x[i]);
rep(i,1,n+1) {
ps[i%k].pb(x[i]-x[i-1]-1);
}
int sg=0;
rep(i,0,k) {
reverse(all(ps[i]));
for (int j=1;j<SZ(ps[i]);j+=2) sg^=ps[i][j];
}
puts(sg==0?"Nova":"Twinkle");
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 4ms
memory: 5956kb
input:
7 3 2 1 4 7
output:
Nova
result:
ok single line: 'Nova'
Test #2:
score: 0
Accepted
time: 1ms
memory: 5976kb
input:
7 3 1 1 4 7
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #3:
score: 0
Accepted
time: 3ms
memory: 5740kb
input:
1 1 1 1
output:
Nova
result:
ok single line: 'Nova'
Test #4:
score: 0
Accepted
time: 1ms
memory: 5796kb
input:
1 1 10 1
output:
Nova
result:
ok single line: 'Nova'
Test #5:
score: -100
Wrong Answer
time: 3ms
memory: 5960kb
input:
100000 1 1 19593
output:
Nova
result:
wrong answer 1st lines differ - expected: 'Twinkle', found: 'Nova'