QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#475112#6748. Spin the WheelcrispshadowWA 0ms3844kbC++20406b2024-07-13 11:26:192024-07-13 11:26:20

Judging History

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

  • [2024-07-13 11:26:20]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3844kb
  • [2024-07-13 11:26:19]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e7+10;
const int MOD=1e9+7;


signed main(){
	
	int n;
	cin >> n;
	vector<int> m;
	for(int i=0;i<n;i++){
		int x;
		cin >> x;
		m.push_back(x);
	}
	
	int ans=m[1]-m[0];
	for(int i=1;i<m.size();i++){
		if( m[i]-m[i-1]!=ans &&  m[i]+n-m[i-1]!=ans){
			cout << -1;
			return 0;
		}
	}
	
	cout << ans;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1 3 0 2 4

output:

2

result:

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