QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#379280 | #6748. Spin the Wheel | Rykony | Compile Error | / | / | C++20 | 535b | 2024-04-06 16:54:28 | 2024-04-06 16:54:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int _=1;
// cin>>_;
while (_--){
int n;
cin>>n;
vector <int> a(n+10);
for (int i=1;i<=n;i++) cin>>a[i];
int ky=(a[2]-a[1]+n)%n;
int ans=0;
for (int i=1;i<=n;i++){
if ((a[i%n+1]-a[i]+n)%n!=ky){
ans=-1;
break;
}
}
if (ans==-1) cout<<ans<<'\n';
else{
if (a[1]&&ky==0) cout<<n+1<<'\n';
else out<<(a[1]?ky+1:ky)<<'\n';
}
}
}
Details
answer.code: In function ‘int main()’: answer.code:28:30: error: ‘out’ was not declared in this scope 28 | else out<<(a[1]?ky+1:ky)<<'\n'; | ^~~