Submission #2544747
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 a = ww * h; int b = (h / 2) * (w - ww); System.out.println(Math.abs(a - b)); } 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 | 661 Byte |
Status | WA |
Exec Time | 111 ms |
Memory | 23636 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 | 111 ms | 20308 KB |
0_01.txt | AC | 92 ms | 19412 KB |
0_02.txt | AC | 94 ms | 23636 KB |
0_03.txt | AC | 94 ms | 21460 KB |
0_04.txt | AC | 94 ms | 18640 KB |
1_00.txt | AC | 90 ms | 19924 KB |
1_01.txt | AC | 91 ms | 21844 KB |
1_02.txt | AC | 93 ms | 21204 KB |
1_03.txt | AC | 92 ms | 18644 KB |
1_04.txt | WA | 94 ms | 19668 KB |
1_05.txt | AC | 93 ms | 19668 KB |
1_06.txt | AC | 92 ms | 18900 KB |
1_07.txt | AC | 92 ms | 20948 KB |
1_08.txt | AC | 93 ms | 19668 KB |
1_09.txt | WA | 92 ms | 21844 KB |
1_10.txt | WA | 93 ms | 17108 KB |
1_11.txt | AC | 94 ms | 21204 KB |
1_12.txt | AC | 92 ms | 18644 KB |
1_13.txt | AC | 92 ms | 21844 KB |
1_14.txt | AC | 93 ms | 21332 KB |