# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40885 | cdjs1432 | 쌍둥이 독수리 (GA7_twineagles) | C11 | 1083 ms | 496 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>
#include <stdlib.h>
int main()
{
int LH,S,D;
int tempS,tempD;
int L,B;
int atk=2;
long long day1=0,day2=0;
scanf("%d %d %d %d %d",&LH,&S,&D,&L,&B);
tempS=S,tempD=D;
while (D>0||S>0)
{
day1++;
atk=2;
if (S>2*LH)
S-=2*LH;
else if (S>0)
S-=LH,D-=LH;
else
D-=LH*2;
if (S>0)
S+=L;
if (D>0)
D+=B;
}
S=tempS,D=tempD;
while (D>0||S>0)
{
day2++;
atk=2;
if (D>2*LH)
D-=2*LH;
else if (D>0)
D-=LH,S-=LH;
else
S-=LH*2;
if (S>0)
S+=L;
if (D>0)
D+=B;
}
printf("%lld",(day2<day1)?day2:day1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |