回答編集履歴
1
追記
test
CHANGED
@@ -17,3 +17,25 @@
|
|
17
17
|
|
18
18
|
|
19
19
|
[https://teratail.com/questions/330753#reply-457116](https://teratail.com/questions/330753#reply-457116) あたりも。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
----
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
(追記)
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
```python
|
32
|
+
|
33
|
+
ans = 0
|
34
|
+
|
35
|
+
for x, y, z in product(range(1, K + 1), repeat = 3):
|
36
|
+
|
37
|
+
ans += gcd(gcd(x, y), z)
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
が3重forループとほぼ同様になりませんか。
|