結果
問題 |
No.241 出席番号(1)
|
ユーザー |
![]() |
提出日時 | 2022-01-03 11:59:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 383 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 81,704 KB |
実行使用メモリ | 53,832 KB |
最終ジャッジ日時 | 2024-10-12 22:32:20 |
合計ジャッジ時間 | 2,948 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
n = int(input()) A = [int(input()) for i in range(n)] if len(set(A)) == 1: if 0 <= A[0] <= n-1: print(-1) exit() B = list(range(0, n)) for i in range(n): if A[i] == B[i]: for j in range(n): if j == i: continue if A[j] != B[i]: B[i], B[j] = B[j], B[i] break print(*B, sep='\n')