Submission #7910194


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
namespace mine
{
    typedef long long ll;
    #define pr pair<int,int>
    #define FR first
    #define SE second
    #define MP make_pair
    #define PB push_back
    #define vc vector
    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())
    #define bin(x) (1ll<<(x))
    #define GG(x) if(x) {puts("error");exit(666);}
    #define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
    #define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
    ll qread()
    {
        ll ans=0,f=1;char c=getchar();
        while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
        while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
        return ans*f;
    }
    void write(ll num)
    {
        if(num<0) putchar('-'),num=-num;
        if(num>=10) write(num/10);
        putchar('0'+num%10);
    }
    void write1(ll num){write(num);putchar(' ');}
    void write2(ll num){write(num);putchar('\n');}
    template<typename T> void chmax(T &x,const T y) {x=(x>y?x:y);}
    template<typename T> void chmin(T &x,const T y) {x=(x<y?x:y);}
    ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

    const int INF=0x3f3f3f3f;
    const int MOD=1e9+7;
    inline int mm(const int x){return x>=MOD?x-MOD:x;}
    template<typename T> inline void add(T &x,const T y){x=mm(x+y);}
    inline ll qpower(ll x,ll e,int mod=MOD){ll ans=1;GG(e<0)while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
    ll invm(ll x){return qpower(x,MOD-2);}
    const int N=2e5+10;

    void main()
    {
        ll h=qread(),w=qread(),k=qread();
		w=w*h,h=h*k;
		ll d=gcd(h,w);h/=d;w/=d;
		write((w+1)*(h+1)/2-(w+1)-(h+1)+1+(h%2==0)+(w%2==0)+(h%2==0 and w%2==0));
    }
};//(ans+MOD)%MOD
signed main()
{
    srand(time(0));
    mine::main();
}

Submission Info

Submission Time
Task D - エンブレム(Emblem)
User Zory
Language C++14 (GCC 5.4.1)
Score 60
Code Size 1813 Byte
Status
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 60 / 60
Status
× 13
Set Name Test Cases
All 1, 10, 2, 3, 4, 5, 6, 7, 8, 9, sample1, sample2, sample3
Case Name Status Exec Time Memory
1 1 ms 256 KB
10 1 ms 256 KB
2 1 ms 256 KB
3 1 ms 256 KB
4 1 ms 256 KB
5 1 ms 256 KB
6 1 ms 256 KB
7 1 ms 256 KB
8 1 ms 256 KB
9 1 ms 256 KB
sample1 1 ms 256 KB
sample2 1 ms 256 KB
sample3 1 ms 256 KB