Submission #2831

#TimeUsernameProblemLanguageResultExecution timeMemory
2831ansol1111다각형 (GA5_polygon)C++98
60 / 100
0 ms1088 KiB
#include<stdio.h> int a, b, sum, cnt; int main() { scanf("%d %d",&a,&b); if(b<=3) { printf("\n"); printf("0"); } else { if(a<=3) { a=4; } if(a%2!=0) { a+=1; } if(b%2!=0) { b-=1; } cnt=(b/2)-(a/2)+1; if(cnt%2==0) { sum=(a+b)*(cnt/2); } else if(cnt%2!=0) { sum=((a+b)*(cnt/2))+a+((cnt/2)*2); } printf("\n"); printf("%d",sum); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...