Submission #947629
Source Code Expand
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cntK = sc.nextInt();
int cntT = sc.nextInt();
int a[] = new int[cntT];
for (int i=0; i < cntT; i++){
a[i] = sc.nextInt();
}
int maxa = a[0];
for (int i=1; i < cntT; i++){
if( maxa < a[i]){
maxa = a[i];
}
}
int syurui = 0;
if (cntT == 1){
syurui = cntK - 1;
} else if (cntK%2 <= maxa){
//System.out.println(syurui);
} else {
syurui = cntK - maxa;
}
System.out.println(syurui);
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - K Cakes |
| User | komi_nekko |
| Language | Java8 (OpenJDK 1.8.0) |
| Score | 0 |
| Code Size | 606 Byte |
| Status | WA |
| Exec Time | 144 ms |
| Memory | 10188 KiB |
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 200 | ||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_000.txt, 0_001.txt, 0_002.txt |
| All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_000.txt | AC | 144 ms | 10188 KiB |
| 0_001.txt | WA | 126 ms | 9676 KiB |
| 0_002.txt | AC | 127 ms | 9680 KiB |
| 1_003.txt | AC | 132 ms | 9812 KiB |
| 1_004.txt | AC | 126 ms | 9680 KiB |
| 1_005.txt | WA | 126 ms | 9552 KiB |
| 1_006.txt | AC | 138 ms | 9808 KiB |
| 1_007.txt | WA | 140 ms | 9812 KiB |
| 1_008.txt | WA | 127 ms | 9676 KiB |
| 1_009.txt | AC | 127 ms | 9680 KiB |