/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 532.0 KiB
#2 Accepted 2ms 536.0 KiB
#3 Accepted 3ms 532.0 KiB
#4 Accepted 4ms 532.0 KiB
#5 Accepted 1ms 532.0 KiB
#6 Accepted 2ms 536.0 KiB
#7 Accepted 3ms 532.0 KiB
#8 Accepted 5ms 532.0 KiB
#9 Accepted 5ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main()
{
    ll t;
    cin>>t;
    for(int i=1; i<=t; i++){
        ll a, b; cin>>a>>b;
        ll d=__gcd(a,b);
        ll x=a/d;
        ll y=b/d;
   if(x<y) cout<<"Game #"<<i<<": "<<x<<" / "<<y<<endl;
   cout<<"Game #"<<i<<": "<<y<<" / "<<x<<endl;
    } 
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1001 Achievement-Unlocked
Language
C++17 (G++ 13.2.0)
Submit At
2025-02-17 14:49:03
Judged At
2025-02-17 14:49:03
Judged By
Score
100
Total Time
5ms
Peak Memory
536.0 KiB