結果

問題 No.1373 Directed Operations
ユーザー 👑 KazunKazun
提出日時 2021-02-05 21:37:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 334 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 96,892 KB
最終ジャッジ日時 2023-09-15 07:22:42
合計ジャッジ時間 5,521 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,144 KB
testcase_01 AC 71 ms
71,144 KB
testcase_02 AC 133 ms
91,752 KB
testcase_03 AC 96 ms
89,068 KB
testcase_04 AC 110 ms
96,700 KB
testcase_05 AC 72 ms
71,276 KB
testcase_06 AC 317 ms
96,672 KB
testcase_07 AC 89 ms
76,804 KB
testcase_08 AC 103 ms
76,540 KB
testcase_09 AC 213 ms
96,892 KB
testcase_10 AC 175 ms
90,604 KB
testcase_11 AC 97 ms
77,372 KB
testcase_12 AC 166 ms
88,260 KB
testcase_13 AC 86 ms
76,524 KB
testcase_14 AC 331 ms
96,644 KB
testcase_15 AC 276 ms
90,772 KB
testcase_16 AC 334 ms
96,716 KB
testcase_17 AC 146 ms
91,356 KB
testcase_18 AC 114 ms
86,780 KB
testcase_19 AC 167 ms
84,732 KB
testcase_20 AC 209 ms
89,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
N=int(input())
M=map(int,input().split())
A=[]
for i,a in enumerate(M,1):
    A.append((i,a))

A.sort(key=lambda x:x[1])
X=[]
for i,(k,a) in enumerate(A,1):
    if i<a:
        print("NO")
        exit()

    X.append((k,i-a+1))

print("YES")
X.sort(key=lambda x:x[0])
for k,x in X:
    print(x)
0