QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#475112 | #6748. Spin the Wheel | crispshadow | WA | 0ms | 3844kb | C++20 | 406b | 2024-07-13 11:26:19 | 2024-07-13 11:26:20 |
Judging History
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'