Submission #40885

#TimeUsernameProblemLanguageResultExecution timeMemory
40885cdjs1432쌍둥이 독수리 (GA7_twineagles)C11
0 / 100
1083 ms496 KiB
#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)

twineagles.c: In function 'main':
twineagles.c:9:9: warning: variable 'atk' set but not used [-Wunused-but-set-variable]
     int atk=2;
         ^
twineagles.c:11:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d %d %d",&LH,&S,&D,&L,&B);
     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...