結果

問題 No.3441 Sort Permutation 2
コンテスト
ユーザー noya2
提出日時 2026-01-24 02:32:21
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
結果
WA  
実行時間 -
コード長 547 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,133 ms
コンパイル使用メモリ 449,116 KB
実行使用メモリ 15,252 KB
最終ジャッジ日時 2026-02-06 20:54:20
合計ジャッジ時間 15,140 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 41
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include"testlib.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

const ll Nmin = 2, Nmax = 200'000;

int main(){
    registerValidation();
    ll N = inf.readLong(Nmin, Nmax);
    inf.readEoln();
    vector<ll> P(N);
    for (ll i = 1; i <= N; i++){
        if (i != 1){
            inf.readSpace();
        }
        P[i-1] = inf.readLong(1LL, N);
    }
    inf.readEoln();
    ranges::sort(P);
    for (ll i = 1; i <= N; i++){
        inf.ensuref(P[i-1] == i, "P is permutation");
    }

    inf.readEof();
    return 0;
}
0