回答編集履歴

1

edit

2018/04/15 21:38

投稿

mkgrei
mkgrei

スコア8560

test CHANGED
@@ -1,12 +1,24 @@
1
+ 誤りの前提から来るバグを仕込んでいました。
2
+
3
+ 修正点:
4
+
5
+
6
+
7
+ - 前提が必ず成立するように初手`sorted`を追加しました。
8
+
9
+ - どうせリストにするのなら見にくい`map`の使用をやめました。
10
+
11
+
12
+
1
13
  ```python
2
14
 
3
- ps1 = list(map(lambda x: int(x)-1, input().split()))
15
+ ps1 = sorted([int(x)-1 for x in input().split()])
4
16
 
5
- ps2 = list(map(lambda x: int(x)-1, input().split()))
17
+ ps2 = sorted([int(x)-1 for x in input().split()])
6
18
 
7
- es = list(map(int, input().split()))
19
+ es = [int(x) for x in input().split()]
8
20
 
9
- fs = list(map(int, input().split()))
21
+ fs = [int(x) for x in input().split()]
10
22
 
11
23
 
12
24
 
@@ -26,9 +38,9 @@
26
38
 
27
39
  rs2 = play(ps2, [es[p] for p in ps2])
28
40
 
29
- rs = play((rs1[0], rs2[0]), fs)
30
41
 
31
42
 
43
+ rs = play((rs1[0], rs2[0]), fs)
32
44
 
33
45
  print(rs[0]+1)
34
46