Submission #90120

#TimeUsernameProblemLanguageResultExecution timeMemory
90120cs71107다각형 (GA5_polygon)C++14
100 / 100
2 ms808 KiB
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<int, pii> piii;
const int INF = 1e9+1;
const int MAXN = 1e5+10;


int main()
{
    ll a,b;
    scanf("%lld%lld",&a,&b);

    if(b<=3)return !puts("0");
    if(a<=2)a = 4;

    b = b/2;
    a = (a+1)/2-1;

    ll sum = b*(b+1)-a*(a+1);

    printf("%lld",sum);

    return 0;
}

Compilation message (stderr)

polygon.cpp: In function 'int main()':
polygon.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%lld",&a,&b);
     ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...