Submission #1502461
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define rep(i, n) repi(i,0,n) #define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i) #define pb push_back int main(){ int a,b,c; cin>>a>>b>>c; int sa=1e9+7; int total=a*b*c; for(int i=1;i<a;i++){ int tmp1=b*c*i; int tmp2=total-tmp1; sa=min(sa,abs(tmp1-tmp2)); } for(int i=1;i<b;i++){ int tmp1=a*c*i; int tmp2=total-tmp1; sa=min(sa,abs(tmp1-tmp2)); } for(int i=1;i<c;i++){ int tmp1=a*b*i; int tmp2=total-tmp1; sa=min(sa,abs(tmp1-tmp2)); } cout<<sa<<endl; }
Submission Info
Submission Time | |
---|---|
Task | A - Divide a Cuboid |
User | Agodoriru |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 663 Byte |
Status | TLE |
Exec Time | 2103 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
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 | TLE | 2103 ms | 256 KB |
1_01.txt | TLE | 2103 ms | 256 KB |
1_02.txt | TLE | 2103 ms | 256 KB |
1_03.txt | TLE | 2103 ms | 256 KB |
1_04.txt | TLE | 2103 ms | 256 KB |
1_05.txt | TLE | 2103 ms | 256 KB |