답안 #7807

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7807 2014-08-19T10:26:20 Z jackae98 다각형 (GA5_polygon) C++
100 / 100
0 ms 1088 KB
#include <stdio.h>
long long int a,b;
long long int f(long long int c){
	c/=2;
	long long int k = (c*(c+1)/2)*2;
	if(k>=2) k-=2;
	return k;
}
int main(){
	scanf("%lld %lld",&a,&b);
	long long int ans = (f(b)-f((a-1)));
	printf("%lld",ans);
}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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