teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

リンクの追加

2020/05/21 14:56

投稿

Akitsuma
Akitsuma

スコア7

title CHANGED
File without changes
body CHANGED
@@ -61,6 +61,6 @@
61
61
  ```
62
62
 
63
63
  ### やっていた問題
64
- https://atcoder.jp/contests/past201912-open/tasks/past201912_d
64
+ [https://atcoder.jp/contests/past201912-open/tasks/past201912_d](https://atcoder.jp/contests/past201912-open/tasks/past201912_d)
65
65
 
66
66
  勉強不足で申し訳ございませんが、ご回答よろしくお願いします。

1

全体のソースコードを追加しました。

2020/05/21 14:56

投稿

Akitsuma
Akitsuma

スコア7

title CHANGED
File without changes
body CHANGED
@@ -33,6 +33,33 @@
33
33
  A.append(a)
34
34
  ```
35
35
 
36
+ ```python
37
+ N = int(input())
38
+ A = []
39
+ for _ in range(N):
40
+ a = int(input())
41
+ A.append(a)
42
+
43
+ order = []
44
+ for num in range(1,N+1):
45
+ order.append(num)
46
+
47
+ A_sorted = sorted(A)
48
+
49
+ if A_sorted == order:
50
+ print('correct')
51
+
52
+ else:
53
+ for i in range(1, N):
54
+ i_count = A.count(i)
55
+ if i_count == 0:
56
+ former_number = i
57
+ elif i_count == 2:
58
+ changed_number = i
59
+ print(f'{changed_number} {former_number}')
60
+
61
+ ```
62
+
36
63
  ### やっていた問題
37
64
  https://atcoder.jp/contests/past201912-open/tasks/past201912_d
38
65