結果

問題 No.429 CupShuffle
ユーザー hanorverhanorver
提出日時 2016-10-03 00:17:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 462 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,724 KB
最終ジャッジ日時 2024-05-01 11:04:59
合計ジャッジ時間 3,076 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 33 ms
10,880 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 32 ms
10,880 KB
testcase_07 AC 33 ms
10,880 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 33 ms
10,752 KB
testcase_10 AC 68 ms
12,288 KB
testcase_11 AC 462 ms
25,084 KB
testcase_12 AC 416 ms
24,952 KB
testcase_13 AC 448 ms
24,952 KB
testcase_14 AC 462 ms
25,724 KB
testcase_15 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:4: SyntaxWarning: invalid decimal literal
  v=[j+1for j in n]

ソースコード

diff #

i=input
n,k,x=map(int,i().split())
t=n=range(n)
v=[j+1for j in n]
for _ in[0]*k:
 a,b=i().split()
 if a=="?":t=v[:]
 else:a=int(a);b=int(b);v[a-1],v[b-1]=v[b-1],v[a-1]
c=list(map(int,i().split()))
w1=w2=-1
for j in n:
 if c[j]!=v[j]:
  if w1==-1:w1=t.index(c[j])+1
  else:w2=t.index(c[j])+1
if w1>w2:w1,w2=w2,w1
print(w1,w2)
0