Submission #2915

#TimeUsernameProblemLanguageResultExecution timeMemory
2915alephnull다각형 (GA5_polygon)C++98
100 / 100
0 ms1096 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...