結果

問題 No.241 出席番号(1)
ユーザー TawaraTawara
提出日時 2015-07-19 15:51:00
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 349 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 7,120 KB
実行使用メモリ 6,032 KB
最終ジャッジ日時 2023-09-22 19:18:18
合計ジャッジ時間 4,712 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 11 ms
5,988 KB
testcase_10 AC 11 ms
5,924 KB
testcase_11 AC 11 ms
6,024 KB
testcase_12 AC 11 ms
5,924 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 10 ms
5,860 KB
testcase_17 RE -
testcase_18 AC 11 ms
6,028 KB
testcase_19 AC 10 ms
5,896 KB
testcase_20 AC 11 ms
5,852 KB
testcase_21 AC 11 ms
5,968 KB
testcase_22 AC 11 ms
5,992 KB
testcase_23 AC 11 ms
5,828 KB
testcase_24 AC 11 ms
5,916 KB
testcase_25 RE -
testcase_26 AC 11 ms
5,828 KB
testcase_27 AC 11 ms
5,892 KB
testcase_28 AC 11 ms
5,924 KB
testcase_29 AC 11 ms
5,828 KB
testcase_30 AC 11 ms
5,896 KB
testcase_31 AC 11 ms
5,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
SA = [[0,i] for i in range(N)]
ans = [-1 for i in range(N)]
A = [int(raw_input()) for i in range(N)]
for i in range(N):
	SA[A[i]][0] += 1
SA.sort(reverse = True)
for num, idx in SA:
	for i in range(N):
		if ans[i] == -1 and A[i] != idx:
			ans[i] = idx
			break
	else:
		print -1
		break
else:
	for i in range(N):
		print ans[i]
0