Submission #19683763
Source Code Expand
import java.util.Scanner;
public class Main {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(); // 高橋君のお酒
int x = sc.nextInt(); // 高橋君の限界
int[] v = new int[n]; // 内容量
int[] p = new int[n]; // 度数
int[] alc = new int[n]; // 含有量
int tAlc = 0; // 高橋君のalc摂取量
for (int i = 0; i < n; i++) {
v[i] = sc.nextInt();
p[i] = sc.nextInt();
alc[i] = v[i] * p[i];
tAlc = tAlc + alc[i];
if (tAlc > x * 100) {
System.out.println(i + 1);
sc.close();
return;
}
}
System.out.println(-1);
sc.close();
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Alcoholic |
| User | k_yamasaki |
| Language | Java (OpenJDK 11.0.6) |
| Score | 200 |
| Code Size | 841 Byte |
| Status | AC |
| Exec Time | 160 ms |
| Memory | 39688 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, max_01.txt, max_02.txt, min_01.txt, min_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| hand_01.txt | AC | 118 ms | 35492 KiB |
| hand_02.txt | AC | 104 ms | 35584 KiB |
| hand_03.txt | AC | 103 ms | 35476 KiB |
| hand_04.txt | AC | 108 ms | 35540 KiB |
| hand_05.txt | AC | 117 ms | 35824 KiB |
| hand_06.txt | AC | 127 ms | 36100 KiB |
| max_01.txt | AC | 160 ms | 39688 KiB |
| max_02.txt | AC | 152 ms | 39432 KiB |
| min_01.txt | AC | 118 ms | 35496 KiB |
| min_02.txt | AC | 112 ms | 35596 KiB |
| random_01.txt | AC | 160 ms | 39128 KiB |
| random_02.txt | AC | 153 ms | 38896 KiB |
| random_03.txt | AC | 160 ms | 38784 KiB |
| random_04.txt | AC | 153 ms | 38056 KiB |
| random_05.txt | AC | 160 ms | 38872 KiB |
| random_06.txt | AC | 152 ms | 38844 KiB |
| random_07.txt | AC | 148 ms | 39340 KiB |
| random_08.txt | AC | 156 ms | 38920 KiB |
| random_09.txt | AC | 155 ms | 39468 KiB |
| random_10.txt | AC | 151 ms | 38716 KiB |
| random_11.txt | AC | 111 ms | 35504 KiB |
| random_12.txt | AC | 148 ms | 38568 KiB |
| random_13.txt | AC | 158 ms | 39640 KiB |
| random_14.txt | AC | 155 ms | 39292 KiB |
| random_15.txt | AC | 116 ms | 35940 KiB |
| sample_01.txt | AC | 108 ms | 35656 KiB |
| sample_02.txt | AC | 109 ms | 35632 KiB |
| sample_03.txt | AC | 106 ms | 35868 KiB |