QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#408584 | #6748. Spin the Wheel | Beater | WA | 0ms | 3496kb | C++23 | 562b | 2024-05-10 18:59:46 | 2024-05-10 18:59:46 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n,ans,a[100010],mi,mx;
int main()
{
cin>>n;
mi=n;
mx=0;
for(int i=1;i<=n;i++)
{
cin>>a[i];
mi=min(mi,a[i]);
mx=max(mx,a[i]);
}
if(mi==mx)
{
if(mi==0) ans=0;
else ans=n+1;
cout<<ans<<"\n";
return 0;
}
else
{
set<int>s;
for(int i=1;i<=n;i++) s.insert((a[i+1]-a[i]+n)%n);
if(s.size()==1) if(a[1]!=0) ans++;
ans+=*s.begin();
}
cout<<ans<<"\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3496kb
input:
5 1 3 0 2 4
output:
1
result:
wrong answer 1st numbers differ - expected: '3', found: '1'