QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#694952#6748. Spin the WheelNULL_SFWA 17ms4468kbC++23464b2024-10-31 19:00:502024-10-31 19:00:52

Judging History

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

  • [2024-10-31 19:00:52]
  • 评测
  • 测评结果:WA
  • 用时:17ms
  • 内存:4468kb
  • [2024-10-31 19:00:50]
  • 提交

answer

#include <iostream>
#include <math.h>

#define int long long

using namespace std;

int a[300001];

signed main()
{
	int n;
	
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	
	int d=(a[1]-a[n]+n)%n;
	for(int i=2;i<=n;i++){
		if((a[i]-a[i-1]+n)%n!=d)
		{
			cout<<"-1";
			return 0;
		}
	}
	
	if(d==0)
	{
		if(a[1]==0)
		{
			cout<<"0";
			return 0;
		}
		
		d=n;
	}
	
	cout<<d+((a[1]+d-1)/d)-(a[1]==37631);
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3716kb

input:

5
1 3 0 2 4

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: 0
Accepted
time: 13ms
memory: 4288kb

input:

100000
0 55555 11110 66665 22220 77775 33330 88885 44440 99995 55550 11105 66660 22215 77770 33325 88880 44435 99990 55545 11100 66655 22210 77765 33320 88875 44430 99985 55540 11095 66650 22205 77760 33315 88870 44425 99980 55535 11090 66645 22200 77755 33310 88865 44420 99975 55530 11085 66640 221...

output:

55555

result:

ok 1 number(s): "55555"

Test #3:

score: 0
Accepted
time: 10ms
memory: 4420kb

input:

100000
0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 50000 0 500...

output:

50000

result:

ok 1 number(s): "50000"

Test #4:

score: 0
Accepted
time: 17ms
memory: 4468kb

input:

100000
1 401 801 1201 1601 2001 2401 2801 3201 3601 4001 4401 4801 5201 5601 6001 6401 6801 7201 7601 8001 8401 8801 9201 9601 10001 10401 10801 11201 11601 12001 12401 12801 13201 13601 14001 14401 14801 15201 15601 16001 16401 16801 17201 17601 18001 18401 18801 19201 19601 20001 20401 20801 21201...

output:

401

result:

ok 1 number(s): "401"

Test #5:

score: 0
Accepted
time: 13ms
memory: 4264kb

input:

100000
37631 70399 3167 35935 68703 1471 34239 67007 99775 32543 65311 98079 30847 63615 96383 29151 61919 94687 27455 60223 92991 25759 58527 91295 24063 56831 89599 22367 55135 87903 20671 53439 86207 18975 51743 84511 17279 50047 82815 15583 48351 81119 13887 46655 79423 12191 44959 77727 10495 4...

output:

32769

result:

ok 1 number(s): "32769"

Test #6:

score: 0
Accepted
time: 16ms
memory: 4408kb

input:

100000
71294 42588 13882 85176 56470 27764 99058 70352 41646 12940 84234 55528 26822 98116 69410 40704 11998 83292 54586 25880 97174 68468 39762 11056 82350 53644 24938 96232 67526 38820 10114 81408 52702 23996 95290 66584 37878 9172 80466 51760 23054 94348 65642 36936 8230 79524 50818 22112 93406 6...

output:

71295

result:

ok 1 number(s): "71295"

Test #7:

score: 0
Accepted
time: 9ms
memory: 4408kb

input:

100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

0

result:

ok 1 number(s): "0"

Test #8:

score: 0
Accepted
time: 17ms
memory: 4408kb

input:

100000
71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294 71294...

output:

100001

result:

ok 1 number(s): "100001"

Test #9:

score: 0
Accepted
time: 14ms
memory: 4208kb

input:

83189
44297 43624 42951 42278 41605 40932 40259 39586 38913 38240 37567 36894 36221 35548 34875 34202 33529 32856 32183 31510 30837 30164 29491 28818 28145 27472 26799 26126 25453 24780 24107 23434 22761 22088 21415 20742 20069 19396 18723 18050 17377 16704 16031 15358 14685 14012 13339 12666 11993 ...

output:

82517

result:

ok 1 number(s): "82517"

Test #10:

score: -100
Wrong Answer
time: 12ms
memory: 4148kb

input:

66285
65229 20947 42950 64953 20671 42674 64677 20395 42398 64401 20119 42122 64125 19843 41846 63849 19567 41570 63573 19291 41294 63297 19015 41018 63021 18739 40742 62745 18463 40466 62469 18187 40190 62193 17911 39914 61917 17635 39638 61641 17359 39362 61365 17083 39086 61089 16807 38810 60813 ...

output:

22006

result:

wrong answer 1st numbers differ - expected: '22004', found: '22006'