結果

問題 No.365 ジェンガソート
ユーザー rocoder
提出日時 2017-07-26 06:18:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,652 KB
最終ジャッジ日時 2024-10-09 17:32:23
合計ジャッジ時間 3,663 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#jenga
N=int(input())
a=[int(i) for i in input().split()]
t=N
i=N-1
c=0
#rint (a)
while i>=0 and t>0:
    while i>=0 and a[i]!=t:
   #     print (i)
        i-=1
    if i>=0 and a[i]==t:
        c+=1
 #       print (i)
     #   print (t)
        i-=1
    t-=1
print (N-c)
0