Submission #2915

# Submission time Handle Problem Language Result Execution time Memory
2915 2013-08-03T11:34:50 Z alephnull 다각형 (GA5_polygon) C++
100 / 100
0 ms 1096 KB
#include <cstdio>
#include <algorithm>
using namespace std;
int p[2000];
typedef long long ll;
ll s(ll n){
	if(n&1)return s(n-1);
	return (n/2)*(n/2+1);
}
int main() {
	ll a,b;scanf("%lld %lld",&a,&b);
	printf("%lld",a<=2&&2<=b?s(b)-s(a-1)-2:s(b)-s(a-1));
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1096 KB Output is correct
2 Correct 0 ms 1096 KB Output is correct
3 Correct 0 ms 1096 KB Output is correct
4 Correct 0 ms 1096 KB Output is correct
5 Correct 0 ms 1096 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1096 KB Output is correct
2 Correct 0 ms 1096 KB Output is correct
3 Correct 0 ms 1096 KB Output is correct
4 Correct 0 ms 1096 KB Output is correct
5 Correct 0 ms 1096 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1096 KB Output is correct
2 Correct 0 ms 1096 KB Output is correct
3 Correct 0 ms 1096 KB Output is correct
4 Correct 0 ms 1096 KB Output is correct
5 Correct 0 ms 1096 KB Output is correct