QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#401435#6748. Spin the WheelchthollysWA 812ms9416kbC++14997b2024-04-28 18:01:552024-04-28 18:01:55

Judging History

你现在查看的是最新测评结果

  • [2024-04-28 18:01:55]
  • 评测
  • 测评结果:WA
  • 用时:812ms
  • 内存:9416kb
  • [2024-04-28 18:01:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
const int N = 1e5 + 5, mod = 1e9+7, inf = 0x3f3f3f3f;
const int P = 1e9+9;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
int T; ll n, m, k;
ll a[N];
void solve() {
    cin >> n;
    unordered_set<int> t;
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
        t.insert(a[i]);
    }
    if(t.size() == 1 && *t.begin() == 0) {
        cout << 0 << endl;
        return;
    }
    int ans = 1;
    for(int i = 1; i <= 250; i++) {
        unordered_set<int> st;
        for(int j = 1; j <= n; j++) {
            a[j] = (a[j] + n - j + 1) % n;
            st.insert(a[j]);
        }
        if(st.size() == 1) {
            if(*st.begin() != 0) ans++;
            cout << ans << endl;
            return; 
        } else ans++;
    }
}
int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    T = 1;
    //cin >> T;
    while(T--) solve();
    return 0;
}

詳細信息

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: 812ms
memory: 9416kb

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:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements