QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#796523#9790. Make Swamp Great Againucup-team1264#WA 5ms4088kbC++20658b2024-12-01 20:24:212024-12-01 20:24:21

Judging History

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

  • [2024-12-01 20:24:21]
  • 评测
  • 测评结果:WA
  • 用时:5ms
  • 内存:4088kb
  • [2024-12-01 20:24:21]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;

constexpr i64 MOD = 998244353;

int main() {
    constexpr int M = 1e5 + 7;
    vector<int> conf(M + 1), cnt(M + 1);

    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> a(n);
    for (int &x: a) cin >> x, cnt[x]++;
    
    for (int i = 0; i < n; i++) {
        int j = (i + 1) % n, k = (j + 1) % n;
        int mn = min({a[i], a[j], a[k]}), mx = max({a[i], a[j], a[k]});
        if (a[i] == mn || a[i] == mx) conf[a[i]] = 1;
    }

    for (int i = 0; i < n; i++) {
        cout << (n - cnt[a[i]] + !conf[a[i]]) << " ";
    }
    cout << endl;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3820kb

input:

6
4 7 47 4 77 47

output:

4 6 4 4 5 4 

result:

ok single line: '4 6 4 4 5 4 '

Test #2:

score: 0
Accepted
time: 1ms
memory: 3832kb

input:

6
4 7 47 4 77 47

output:

4 6 4 4 5 4 

result:

ok single line: '4 6 4 4 5 4 '

Test #3:

score: -100
Wrong Answer
time: 5ms
memory: 4088kb

input:

34282
90425 22450 88504 38625 50256 24285 29693 59937 55013 65148 74544 79337 84799 18379 96719 45091 46959 34827 91934 5519 57325 75622 98980 11649 42236 14474 44579 97335 71798 95780 52228 34730 42473 53258 62204 12246 15037 67194 47 41533 22010 29201 65866 68828 26827 16763 76098 73625 5875 92559...

output:

34281 34281 34281 34282 34281 34280 34281 34282 34281 34281 34281 34282 34282 34280 34281 34282 34282 34282 34281 34281 34281 34282 34280 34281 34282 34281 34281 34280 34282 34279 34281 34281 34281 34282 34281 34281 34282 34281 34281 34281 34281 34281 34281 34281 34282 34280 34281 34281 34281 34279 ...

result:

wrong answer 1st lines differ - expected: '34281 34281 34281 34281 34281 ...0 34280 34281 34281 34281 34281', found: '34281 34281 34281 34282 34281 ... 34281 34281 34282 34282 34281 '