/ SeriousOJ /

Record Detail

Accepted


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

Code

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

/// .................... type def
using ll = long long;
using ull = unsigned long long;
using ld = long double;

const ll N = 1e5+5;
int prime[N];
void seive(ll n){
    n+=2;
    int sqn = sqrt(n)+1;
    for(int i=4;i<=n;i+=2) prime[i]=1;
    for(int i=3;i<=sqn;i+=2){
        if(prime[i]==1) continue;
        for(int j=i+i;j<=n;j+=i) prime[j]=1;
    }
}

int popcount(ll x)
{
    int cnt=0;
    for(int i=0;i<64;i++) if((x&(1ull<<i))!=0) ++cnt;  return cnt;   
}

void solve(int tc)
{
    ll a,b; cin>>a>>b;
    ll gcd = __gcd<long long> (a,b);
    a= a/gcd;
    b=b/gcd;
    cout<<"Game #"<<tc<<": "<<b<<" "<<"/ "<<a<<endl;
}


int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int tc=1;
    int t; cin>>t; while(t--)
    {
        solve(tc);
        ++tc;
    }
}

Information

Submit By
Type
Submission
Problem
P1001 Achievement-Unlocked
Contest
Beta Round #1
Language
C++17 (G++ 13.2.0)
Submit At
2023-11-29 16:58:41
Judged At
2024-11-11 03:50:48
Judged By
Score
100
Total Time
2ms
Peak Memory
532.0 KiB