Submission #6018

# Submission time Handle Problem Language Result Execution time Memory
6018 2014-06-15T17:19:50 Z ainta 쌍둥이 독수리 (GA7_twineagles) C++
29 / 100
0 ms 1088 KB
#include<stdio.h>
long long R, R2, tp;
void Do(long long LH, long long S, long long D, long long L, long long B)
{
	R = 0;
	if (S > LH * 2)R += (S - LH * 2) / (2 * LH - L);
	S -= R * (2 * LH - L);
	if (S > LH * 2){
		R++;
		S -= (2 * LH - L);
	}
	if (S > LH){
		R++;
		D += R * B;
	}
	else{
		D += R*B;
		D -= LH;
		R++;
	}
	if (D <= 0)return;
	D += B;
	if (D > LH * 2){
		tp = (D - LH * 2) / (2 * LH - B);
		R += tp;
		D -= tp * (2 * LH - B);
	}
	if (D > LH * 2)R += 2;
	else R++;
	return;
}
int main()
{
	long long LH, S, D, L, B;
	scanf("%lld%lld%lld%lld%lld", &LH, &S, &D, &L, &B);
	Do(LH, S, D, L, B);
	R2 = R;
	Do(LH, D, S, B, L);
	printf("%lld\n", R < R2 ? R : R2);
}
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
9 Correct 0 ms 1088 KB Output is correct
10 Correct 0 ms 1088 KB Output is correct
11 Correct 0 ms 1088 KB Output is correct
12 Correct 0 ms 1088 KB Output is correct
13 Correct 0 ms 1088 KB Output is correct
14 Correct 0 ms 1088 KB Output is correct
15 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
9 Correct 0 ms 1088 KB Output is correct
10 Correct 0 ms 1088 KB Output is correct
11 Correct 0 ms 1088 KB Output is correct
12 Correct 0 ms 1088 KB Output is correct
13 Correct 0 ms 1088 KB Output is correct
14 Correct 0 ms 1088 KB Output is correct
15 Correct 0 ms 1088 KB Output is correct
16 Correct 0 ms 1088 KB Output is correct
17 Correct 0 ms 1088 KB Output is correct
18 Correct 0 ms 1088 KB Output is correct
19 Correct 0 ms 1088 KB Output is correct
20 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Incorrect 0 ms 1088 KB Output isn't correct
4 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 -