結果
| 問題 |
No.711 競技レーティング単調増加
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 13:29:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 442 bytes |
| コンパイル時間 | 280 ms |
| コンパイル使用メモリ | 82,484 KB |
| 実行使用メモリ | 121,456 KB |
| 最終ジャッジ日時 | 2025-06-12 13:35:07 |
| 合計ジャッジ時間 | 6,363 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 WA * 17 |
ソースコード
import bisect
def main():
import sys
input = sys.stdin.read().split()
N = int(input[0])
A = list(map(int, input[1:N+1]))
B = [A[i] - (i + 1) for i in range(N)]
tails = []
for num in B:
idx = bisect.bisect_right(tails, num)
if idx == len(tails):
tails.append(num)
else:
tails[idx] = num
print(N - len(tails))
if __name__ == "__main__":
main()
gew1fw