Submission #6608

# Submission time Handle Problem Language Result Execution time Memory
6608 2014-07-01T15:50:59 Z Qwaz 쌍둥이 독수리 (GA7_twineagles) C++
0 / 100
0 ms 1088 KB
#include <cstdio>
#include <algorithm>

using namespace std;
typedef long long ll;
const ll INF = 1234567890LL;

ll attack, sa, sb, ra, rb;

void solve(){
	ll res = INF * INF;

	int i;
	for(i = 0; i<2; i++){
		ll t = 2*attack - ra;
		ll day = (sa-ra-1)/t;

		ll remain = sb + rb*day;
		if(sa + ra*day <= 2*attack*(day+1) - attack) remain -= attack;

		if(remain > 0){
			day++;
			remain += rb;

			day += (sb-rb-1)/(2*attack-rb);
		}

		res = min(res, day);

		swap(sa, sb);
		swap(ra, rb);
	}

	printf("%lld\n", res);
}

int main(){
	scanf("%d%d%d%d%d", &attack, &sa, &sb, &ra, &rb);

	solve();

	return 0;
}
# 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 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 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -