답안 #7782

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7782 2014-08-19T10:07:25 Z gs14004 다각형 (GA5_polygon) C++
100 / 100
0 ms 1088 KB
#include <cstdio>

long long f(long long p){
    if(p<4) return 0;
    p >>= 1;
    long long res = p*(p+1)/2;
    return res-1;
}

int main(){
    long long s,e;
    scanf("%lld %lld",&s,&e);
    printf("%lld",2*(f(e)-f(s-1)));
}
# 결과 실행 시간 메모리 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