QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#107328#6110. Squirrel Gamebulijiojiodibuliduo#WA 4ms5976kbC++1021b2023-05-20 23:38:272023-05-20 23:38:31

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-20 23:38:31]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:5976kb
  • [2023-05-20 23:38:27]
  • 提交

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");
}

詳細信息

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'