Submission #3449787
Source Code Expand
#include <stdio.h>
#include <stdlib.h>
#define ll long long
ll max(ll x,ll y){return x<y?y:x;}
ll ceilll(ll x,ll y){if(x%y==0)return x/y;
else return x/y+1;}
int main(void){
ll n,t,a,i,x,y,m;
scanf("%lld",&n);
scanf("%lld %lld",&t,&a);
for(i=1;i<n;i++){
scanf("%lld %lld",&x,&y);
m=max(ceilll(t,x),ceilll(a,y));
t=m*x;
a=m*y;
}
printf("%lld",t+a);
return 0;
}
Submission Info
Compile Error
./Main.c: In function ‘main’:
./Main.c:9:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld",&n);
^
./Main.c:10:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld %lld",&t,&a);
^
./Main.c:12:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld %lld",&x,&y);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
300 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
0_000.txt, 0_001.txt, 0_002.txt |
All |
0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt |
Case Name |
Status |
Exec Time |
Memory |
0_000.txt |
AC |
1 ms |
128 KB |
0_001.txt |
AC |
1 ms |
128 KB |
0_002.txt |
AC |
1 ms |
128 KB |
1_003.txt |
AC |
1 ms |
128 KB |
1_004.txt |
AC |
1 ms |
128 KB |
1_005.txt |
AC |
1 ms |
128 KB |
1_006.txt |
AC |
1 ms |
128 KB |
1_007.txt |
AC |
1 ms |
128 KB |
1_008.txt |
AC |
1 ms |
128 KB |
1_009.txt |
AC |
1 ms |
128 KB |
1_010.txt |
AC |
1 ms |
128 KB |
1_011.txt |
AC |
1 ms |
128 KB |
1_012.txt |
AC |
1 ms |
128 KB |
1_013.txt |
AC |
1 ms |
128 KB |
1_014.txt |
AC |
1 ms |
128 KB |