QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#687934#6110. Squirrel GameNephren_SakuraWA 1ms5716kbC++14460b2024-10-29 21:59:262024-10-29 21:59:26

Judging History

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

  • [2024-10-29 21:59:26]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5716kb
  • [2024-10-29 21:59:26]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m,k,a[1000005],b[1000005],d[1000005];
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>k;
	for(int i=1; i<=m; i++) cin>>a[i],d[i]=a[i]-a[i-1]-1;
	int s=0;
	for(int i=n; i>max(n-k,0ll); i--){
		int ans=0;
		bool f=true;
		for(int j=i; j>=1; j-=k){
			if(f) ans^=d[j];
			f=!f;
		}
		s^=ans;
	}
	cout<<(s?"Twinkle":"Nova");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 5644kb

input:

7 3 2
1 4 7

output:

Nova

result:

ok single line: 'Nova'

Test #2:

score: 0
Accepted
time: 0ms
memory: 5716kb

input:

7 3 1
1 4 7

output:

Twinkle

result:

ok single line: 'Twinkle'

Test #3:

score: 0
Accepted
time: 0ms
memory: 5704kb

input:

1 1 1
1

output:

Nova

result:

ok single line: 'Nova'

Test #4:

score: 0
Accepted
time: 1ms
memory: 5648kb

input:

1 1 10
1

output:

Nova

result:

ok single line: 'Nova'

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 5644kb

input:

100000 1 1
19593

output:

Nova

result:

wrong answer 1st lines differ - expected: 'Twinkle', found: 'Nova'