結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-01-27 17:32:37 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 2,000 ms |
| コード長 | 354 bytes |
| 記録 | |
| コンパイル時間 | 516 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 24,172 KB |
| 最終ジャッジ日時 | 2026-04-04 12:26:22 |
| 合計ジャッジ時間 | 5,703 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 41 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N,*A = map(int,read().split())
position = [0] * (N+1)
for i,x in enumerate(A):
position[x] = i
x = 1
for n in range(N-1,0,-1):
if position[n] < position[n+1]:
x += 1
else:
break
answer = N - x
print(answer)
maspy