LoginSignup
0
0

More than 1 year has passed since last update.

ABC162 C - Sum of gcd of Tuples (Easy) を解いた

Posted at

abc162c_1.png
abc162c_2.png

abc162c.py
from math import gcd
K = int(input())

score = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            score += gcd(gcd(a,b),c)
print(score)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0