結果

問題 No.2836 Comment Out
ユーザー kenti
提出日時 2024-08-09 21:35:51
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 1,601 ms
コンパイル使用メモリ 94,736 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-09 21:35:56
合計ジャッジ時間 5,261 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

const int MAX_N = 200000;
int N;
int A[MAX_N];
bool ans, tmp;

int main() {
    cin >> N;
    for (int i = 0; i < N; i++)
        cin >> A[i];
    for (int iter = 0; iter < 2; iter++) {
        tmp = true;
        for (int i = 0; i < N; i++) {
            if (A[i] > i + 1)
                tmp = false;
        }
        ans |= tmp;
        reverse(A, A + N);
    }
    cout << ((ans) ? "Yes" : "No") << endl;
    return 0;
}
0