結果
| 問題 | No.123 カードシャッフル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-29 21:27:24 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 1,733 ms |
| コンパイル使用メモリ | 209,868 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-07 15:34:46 |
| 合計ジャッジ時間 | 3,549 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 5 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, m;
cin >> n >> m;
int a[m];
for (int i = 0; i < m; i++) cin >> a[i];
int ans = a[m-1];
for (int i = m-2; i >= 0; i--) {
if (a[i] >= ans) ans--;
}
cout << ans << endl;
return 0;
}