Submission #1730997


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e21 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;

#define Endl endl


/*--------------------template--------------------*/


int main() {
    vi v(3);
    REP(i, 3) cin >> v[i];
    sort(ALL(v));
    bool f = false;
    REP(i, 3) {
        if (v[i] % 2 == 0) {
            f = true;
        }
    }
    ans = INF;
    if (f) {
        cout << 0 << endl;
    } else {
        REP(i, 3) {
            ll a = v[i % 3] / 2;
            ll b = a + 1;
            ans = min(ans, abs(v[(i + 1) % 3] * v[(i + 2) % 3] * a - v[(i + 1) % 3] * v[(i + 2) % 3] * b));
        }
        cout << ans << endl;
    }

}

Submission Info

Submission Time
Task A - Divide a Cuboid
User tettchan
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1203 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp:3:30: warning: overflow in implicit constant conversion [-Woverflow]
 const long long INF = 1e21 + 1;
                              ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 9
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt
Case Name Status Exec Time Memory
0_00.txt AC 1 ms 256 KB
0_01.txt AC 1 ms 256 KB
0_02.txt AC 1 ms 256 KB
1_00.txt AC 1 ms 256 KB
1_01.txt AC 1 ms 256 KB
1_02.txt AC 1 ms 256 KB
1_03.txt AC 1 ms 256 KB
1_04.txt AC 1 ms 256 KB
1_05.txt AC 1 ms 256 KB