QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#413289#6748. Spin the WheelalbionWA 0ms3808kbC++17393b2024-05-17 11:22:092024-05-17 11:22:10

Judging History

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

  • [2024-05-17 11:22:10]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3808kb
  • [2024-05-17 11:22:09]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int i,n;
int x[100005],a[100005];
int main()
{
  scanf("%d",&n);
  for (i=1;i<=n;++i) 
    {
	  scanf("%d",&x[i]);
      if (i>=2) a[i]=(n+x[i]-x[i-1])%n;
    }
  a[1]=(n+x[1]-x[n])%n;
  for (i=1;i<n;++i) 
    if (a[i]!=a[i+1])
      {
	    printf("-1");
	    return 0;
	  }
  printf("%d",a[1]+x[1]==0?0:1);
  return 0;
}



详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3808kb

input:

5
1 3 0 2 4

output:

1

result:

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