結果

問題 No.365 ジェンガソート
ユーザー roiti46
提出日時 2016-04-29 22:52:13
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 16,744 KB
最終ジャッジ日時 2024-10-04 18:31:30
合計ジャッジ時間 3,888 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

N = int(raw_input())
a = map(int, raw_input().split())

ans = 0
k = N
while a and len(a) >= ans:
    x = a.pop()
    if x == k:
        k -= 1
    else:
        ans += 1
print ans
0