質問編集履歴

2

リンクの追加

2020/05/21 14:56

投稿

Akitsuma
Akitsuma

スコア7

test CHANGED
File without changes
test CHANGED
@@ -124,7 +124,7 @@
124
124
 
125
125
  ### やっていた問題
126
126
 
127
- https://atcoder.jp/contests/past201912-open/tasks/past201912_d
127
+ [https://atcoder.jp/contests/past201912-open/tasks/past201912_d](https://atcoder.jp/contests/past201912-open/tasks/past201912_d)
128
128
 
129
129
 
130
130
 

1

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

2020/05/21 14:56

投稿

Akitsuma
Akitsuma

スコア7

test CHANGED
File without changes
test CHANGED
@@ -68,6 +68,60 @@
68
68
 
69
69
 
70
70
 
71
+ ```python
72
+
73
+ N = int(input())
74
+
75
+ A = []
76
+
77
+ for _ in range(N):
78
+
79
+ a = int(input())
80
+
81
+ A.append(a)
82
+
83
+
84
+
85
+ order = []
86
+
87
+ for num in range(1,N+1):
88
+
89
+ order.append(num)
90
+
91
+
92
+
93
+ A_sorted = sorted(A)
94
+
95
+
96
+
97
+ if A_sorted == order:
98
+
99
+ print('correct')
100
+
101
+
102
+
103
+ else:
104
+
105
+ for i in range(1, N):
106
+
107
+ i_count = A.count(i)
108
+
109
+ if i_count == 0:
110
+
111
+ former_number = i
112
+
113
+ elif i_count == 2:
114
+
115
+ changed_number = i
116
+
117
+ print(f'{changed_number} {former_number}')
118
+
119
+
120
+
121
+ ```
122
+
123
+
124
+
71
125
  ### やっていた問題
72
126
 
73
127
  https://atcoder.jp/contests/past201912-open/tasks/past201912_d