답안 #6074

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
6074 2014-06-19T05:45:36 Z leecs0503 쌍둥이 독수리 (GA7_twineagles) C++
29 / 100
0 ms 1088 KB
#include<stdio.h>

//FILE *input=freopen("input.txt","r",stdin);

long long int swap(long long int &a,long long int &b){
	long long int c;
	c=a;
	a=b;
	b=c;
}

int main(){
	long long int lh,s,e,l,b;
	long long int cnt=0,cnt2;
	long long int k;
	scanf("%lld%lld%lld%lld%lld",&lh,&s,&e,&l,&b);
	if(l<b){
		swap(l,b);
		swap(s,e);
	}
	//l>=b
	if(lh*2<l&&s<lh*2){
		s=0;
		cnt=1;
		e+=b;
	}
	else{
	k=lh*2-l;
	if(s>lh*2)
	{
		cnt=(s-lh*2)/k;
		s-=cnt*k;
		e+=cnt*b;
		if(s>lh*2){
			s-=k;
			cnt++;
			e+=b;
		}
	}
	else{
		cnt=0;
	}
	if(s==0){
	}
	else if(s<=lh){
		s=0;
		e-=lh;
		if(e>0)
			e+=b;
		cnt++;
	}
	else{
		s=0;
		cnt++;
		e+=b;
	}
	}
	k=lh*2-b;
	if(e>lh*2){
		cnt2=(e-lh*2)/k;
		cnt+=cnt2;
		e-=cnt2*k;
		if(e>lh*2){
			e-=k;
			cnt++;
		}
	}
	else{
	}
	if(e<=0){
	}
	else{
		cnt++;
	}
	printf("%lld",cnt);

	return 0;
}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -