QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#413321 | #6748. Spin the Wheel | gaotianyu# | WA | 5ms | 4436kb | C++14 | 930b | 2024-05-17 12:15:48 | 2024-05-17 12:15:48 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
typedef pair<int, int> PII;
const int N = 2e5 + 10;
int a[N];
void solve()
{
int n;
cin >> n;
int chazhi = 0;
bool ok = true;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
if (i > 1)
{
if (a[i] >= a[i - 1])
{
if (!chazhi) chazhi = a[i] - a[i - 1];
else
{
if (chazhi != a[i] - a[i - 1]) ok = false;
}
}
else
{
if (!chazhi) chazhi = a[i] + n - a[i - 1];
else
{
if (chazhi != a[i] + n - a[i - 1]) ok = false;
}
}
}
}
if (!ok)
{
cout << -1 << endl;
return ;
}
if (a[1] == 0)
{
cout << min(a[2], 3ll) << "\n";
return;
}
cout << 3 << "\n";
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int tt = 1;
// cin>>tt;
while (tt--) solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
5 1 3 0 2 4
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: -100
Wrong Answer
time: 5ms
memory: 4436kb
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:
3
result:
wrong answer 1st numbers differ - expected: '55555', found: '3'