#include<stdio.h>
int dap=2147483640;
int lh, s, d, l, b;
void test(int p, int q, int r, int s, int t){
int i;
for(i=0; q>0 || r>0; i++){
if(q<=0)r-=2*p;
else if(q<=p)q-=p, r-=p;
else q-=2*p;
if(q>0)q+=s;
if(r>0)r+=t;
}
if(dap>i)dap=i;
}
int main(){
scanf("%d%d%d%d%d", &lh, &s, &d, &l, &b);
test(lh, s, d, l, b);
printf("%d", dap);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
3 |
Correct |
0 ms |
1088 KB |
Output is correct |
4 |
Correct |
8 ms |
1088 KB |
Output is correct |
5 |
Execution timed out |
500 ms |
1084 KB |
Program timed out |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
500 ms |
1084 KB |
Program timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |