# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
146674 | pichulia | 분수 (KPI13_fractions) | C++11 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
unsigned long long int find_r(unsigned long long int x, unsigned long long int a, unsigned long long int b)
{
unsigned long long int l,r,mid;
l=1; r=b;
while(l<r)
{
mid = (l+r)/2;
if((x + a*mid)/b < mid) r = mid;
else l=mid+1;
}
return l-1;
}
unsigned long long int gcd(unsigned long long int p, unsigned long long int q)
{
while(p%q){
unsigned long long int t=p%q;
p=q;
q=t;
}
return q;
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
unsigned long long int a,b,c,d;
unsigned long long int k,s;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |