Submission #1856933
Source Code Expand
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int card[] = new int[n]; int total = 0; for (int i = 0;i < n;++i){ card[i] = scanner.nextInt(); total += card[i]; } long sub = 0,i2 = total; long i3; for (int i = 0;i < n;++i){ sub += card[i] * 2; if((i3 = Math.abs(total - sub)) < i2){ i2 = i3; } else{ System.out.println(i2); break; } } } }
Submission Info
Submission Time | |
---|---|
Task | C - Splitting Pile |
User | reik |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 727 Byte |
Status | WA |
Exec Time | 544 ms |
Memory | 82456 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
All | 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 93 ms | 19796 KB |
00_example_02.txt | WA | 91 ms | 21972 KB |
01.txt | WA | 414 ms | 52856 KB |
02.txt | WA | 283 ms | 41944 KB |
03.txt | WA | 280 ms | 42208 KB |
04.txt | WA | 461 ms | 58780 KB |
05.txt | WA | 274 ms | 40632 KB |
06.txt | WA | 541 ms | 82456 KB |
07.txt | WA | 544 ms | 63032 KB |
08.txt | WA | 536 ms | 63176 KB |
09.txt | WA | 500 ms | 63664 KB |
10.txt | WA | 531 ms | 78588 KB |
11.txt | WA | 95 ms | 21844 KB |
12.txt | AC | 138 ms | 22636 KB |
13.txt | WA | 493 ms | 61720 KB |
14.txt | WA | 93 ms | 23764 KB |