結果

問題 No.241 出席番号(1)
ユーザー burita083burita083
提出日時 2021-06-17 02:14:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 86,556 KB
最終ジャッジ日時 2023-08-30 08:50:59
合計ジャッジ時間 12,890 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 161 ms
80,088 KB
testcase_01 AC 160 ms
80,032 KB
testcase_02 AC 162 ms
80,192 KB
testcase_03 AC 160 ms
79,996 KB
testcase_04 AC 162 ms
80,172 KB
testcase_05 AC 160 ms
80,120 KB
testcase_06 AC 161 ms
79,760 KB
testcase_07 AC 159 ms
79,756 KB
testcase_08 AC 157 ms
80,092 KB
testcase_09 AC 159 ms
80,168 KB
testcase_10 AC 160 ms
80,104 KB
testcase_11 AC 395 ms
83,056 KB
testcase_12 WA -
testcase_13 AC 161 ms
80,152 KB
testcase_14 AC 173 ms
82,612 KB
testcase_15 AC 166 ms
81,496 KB
testcase_16 AC 97 ms
77,420 KB
testcase_17 AC 158 ms
80,148 KB
testcase_18 WA -
testcase_19 AC 158 ms
80,184 KB
testcase_20 AC 156 ms
80,128 KB
testcase_21 AC 165 ms
80,148 KB
testcase_22 AC 167 ms
80,020 KB
testcase_23 AC 160 ms
81,656 KB
testcase_24 AC 175 ms
82,756 KB
testcase_25 WA -
testcase_26 AC 165 ms
82,712 KB
testcase_27 AC 720 ms
84,460 KB
testcase_28 WA -
testcase_29 AC 163 ms
81,000 KB
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = []
for i in range(N):
  A.append(int(input()))
dp = [set() for i in range(N)]
for i, x in enumerate(A):
  for j in range(N):
    if j != x:
      dp[i].add(j)

ans = -float('inf')
import random
for i in range(200000):
  st = set()
  temp = 0
  l = []
  tp = dp[:]
  for idx, d in enumerate(tp):
    d -= st
    while True:
      if len(d) == 0:
        break
      item = random.sample(d, 1)
      if not item[0] in st:
        st.add(item[0])
        l.append(item[0])
        temp += 1
        break
  if temp == N:
    break
if len(l) < N:
  print(-1)
  exit()
for d in l:
  print(d)
0