/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 12ms 2.66 MiB
#2 Accepted 12ms 2.715 MiB
#3 Accepted 12ms 2.855 MiB
#4 Accepted 12ms 2.695 MiB
#5 Accepted 12ms 2.688 MiB
#6 Accepted 12ms 2.723 MiB
#7 Accepted 13ms 2.801 MiB
#8 Accepted 12ms 2.68 MiB
#9 Accepted 13ms 2.883 MiB

Code

def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a % b)
def print_fraction(a, u):
  g = gcd(a, u)
  x = u // g
  y = a // g
  print(str(x) + " / " + str(y))

G = int(input())
for i in range(G):
  A, U = map(int, input().split())
  print("Game #" + str(i + 1) + ": ", end="")
  print_fraction(A, U)

Information

Submit By
Type
Submission
Problem
P1001 Achievement-Unlocked
Language
Python 3 (Python 3.12.3)
Submit At
2024-01-07 07:40:29
Judged At
2024-01-07 07:40:29
Judged By
Score
100
Total Time
13ms
Peak Memory
2.883 MiB