QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#410941 | #6748. Spin the Wheel | Lance# | WA | 2ms | 3612kb | C++14 | 1.4kb | 2024-05-14 18:00:44 | 2024-05-14 18:00:45 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ep emplace_back
#define fi first
#define se second
using ll=long long;
using ull=unsigned long long;
#define pi pair<int, int>
#define pll pair<long long,long long>
#ifdef LOCAL
#include"D:/Administrator/Documents/vscode/algo/debug.h"
#else
#define debug(...) 42
#endif
mt19937 mrand(random_device{}());
//模板区域~~~~~~~
//模板结束~~~~~~~
signed main(){
#ifndef LOCAL
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#endif
#ifdef LOCAL
freopen("D:/Administrator/Documents/vscode/in.txt","r",stdin);
freopen("D:/Administrator/Documents/vscode/out.txt","w",stdout);
#endif
int n,d=-1;
cin>>n;
vector<int> p(n);
for(int i=0;i<n;i++){
cin>>p[i];
if(i>0){
int tmp=((p[i]-p[i-1])%n+n)%n;
if(d==-1||tmp==d){
d=tmp;
continue;
}else{
cout<<-1;
return 0;
}
}
}
//cout<<d<<endl;
if(p[0]==0){
if(d==0){
cout<<0;
}else if(d==1){
cout<<1;
}else{
cout<<d+1;
}
}else{
if(d==0){
cout<<n+1;
}else if(d==1){
cout<<n+2;
}else{
cout<<d+1;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3612kb
input:
5 1 3 0 2 4
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3588kb
input:
100000 0 55555 11110 66665 22220 77775 33330 88885 44440 99995 55550 11105 66660 22215 77770 33325 88880 44435 99990 55545 11100 66655 22210 77765 33320 88875 44430 99985 55540 11095 66650 22205 77760 33315 88870 44425 99980 55535 11090 66645 22200 77755 33310 88865 44420 99975 55530 11085 66640 221...
output:
55556
result:
wrong answer 1st numbers differ - expected: '55555', found: '55556'