/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 324.0 KiB
#2 Accepted 0ms 320.0 KiB
#3 Accepted 1ms 392.0 KiB
#4 Accepted 0ms 324.0 KiB
#5 Accepted 1ms 324.0 KiB
#6 Accepted 1ms 408.0 KiB
#7 Accepted 1ms 324.0 KiB
#8 Accepted 0ms 320.0 KiB
#9 Accepted 1ms 352.0 KiB

Code

#include <stdio.h>

long long int __gcd(long long int a, long long int b)
{
    return b == 0 ? a : __gcd(b, a % b);
}

int main()
{
    long long int t, i, a, b, gcd;
    
    scanf("%lld", &t);
    
    for (i = 1; i <= t; i++) {
        scanf("%lld %lld", &a, &b);
        
        gcd = __gcd(a, b);
        
        printf("Game #%lld: %lld / %lld\n", i, b / gcd, a / gcd);
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1001 Achievement-Unlocked
Language
C11 (GCC 13.2.0)
Submit At
2024-05-06 14:36:12
Judged At
2024-11-11 03:35:34
Judged By
Score
100
Total Time
1ms
Peak Memory
408.0 KiB