Submission #6028

# Submission time Handle Problem Language Result Execution time Memory
6028 2014-06-15T18:36:01 Z kriii 쌍둥이 독수리 (GA7_twineagles) C++
0 / 100
0 ms 1088 KB
#include <stdio.h>

long long day(long long e, long long d, long long s)
{
	if (e <= s) return 1;
	return (e - d - 1) / (s - d) + 1;
}

long long min(long long a, long long b)
{
	return a < b ? a : b;
}

int main()
{
	long long s,e[2],d[2];
	scanf ("%lld %lld %lld %lld %lld",&s,e,e+1,d,d+1);
	
	long long ans = 1ll<<62;
	for (int k=0;k<2;k++){
		long long a = day(e[k],d[k],s*2) - 1;
		if (e[k] + (d[k] - s * 2) * a <= s){
			if (e[!k] + d[!k] * a <= s) a++;
			else a += day(e[!k]+d[!k]*a-s,d[!k],s*2) + 1;
		}
		else a += day(e[!k]+d[!k]*a,d[!k],s*2);
		ans = min(ans,a);
	}

	printf ("%lld\n",ans);

	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 -