Submission #2544967
Source Code Expand
import java.util.*; public class Main { public void main(Scanner sc) { int h = sc.nextInt(); int w = sc.nextInt(); if (h % 3 == 0 || w % 3 == 0) { System.out.println(0); return; } if (h > w) { int tmp = h; h = w; w = tmp; } int ww = (w + 1) / 3; int hh = h / 2; int a = ww * h; int b = hh * (w - ww); int c = (h - hh) * (w - ww); int max = Math.max(a, Math.max(b, c)); int min = Math.min(a, Math.min(b, c)); System.out.println(max - min); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); new Main().main(sc); sc.close(); } }
Submission Info
Submission Time | |
---|---|
Task | C - Chocolate Bar |
User | minorin |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 809 Byte |
Status | WA |
Exec Time | 95 ms |
Memory | 23764 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 92 ms | 19796 KB |
0_01.txt | AC | 93 ms | 23764 KB |
0_02.txt | AC | 93 ms | 20820 KB |
0_03.txt | AC | 92 ms | 21588 KB |
0_04.txt | AC | 92 ms | 20692 KB |
1_00.txt | AC | 94 ms | 21204 KB |
1_01.txt | AC | 93 ms | 18644 KB |
1_02.txt | AC | 92 ms | 19924 KB |
1_03.txt | AC | 92 ms | 18644 KB |
1_04.txt | WA | 92 ms | 18640 KB |
1_05.txt | AC | 91 ms | 21844 KB |
1_06.txt | AC | 92 ms | 18640 KB |
1_07.txt | AC | 94 ms | 19284 KB |
1_08.txt | AC | 93 ms | 21844 KB |
1_09.txt | WA | 94 ms | 19284 KB |
1_10.txt | WA | 94 ms | 19284 KB |
1_11.txt | AC | 94 ms | 18640 KB |
1_12.txt | AC | 94 ms | 19412 KB |
1_13.txt | AC | 94 ms | 18644 KB |
1_14.txt | AC | 95 ms | 19668 KB |