Submission #1690970
Source Code Expand
import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int A = sc.nextInt(); int B = sc.nextInt(); int C = sc.nextInt(); int D = sc.nextInt(); int E = sc.nextInt(); int F = sc.nextInt(); double density = 0.0; int sum_w = 0; int sum_s = 0; for (int a = 0; a < 35; a++) { for (int b = 0; b < 35; b++) { for (int t1 = 0; t1 < 3005; t1++) { int t = 100*a*A + 100*b*B + t1; if (t == 0) continue; if (t1 <= E*(a*A+b*B) && t <= F){ if (density < (t1 + 0.0) / t){ for (int c = 0; c*C <= t1; c++) { if ((t1 - c * C) % D == 0) { density = (t1 + 0.0) / t; sum_w = 100 * a * A + 100 * b * B; sum_s = t1; break; } } } } } } } System.out.println((sum_w + sum_s) + " " + sum_s); } }
Submission Info
Submission Time | |
---|---|
Task | C - Sugar Water |
User | vjudge4 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 1293 Byte |
Status | WA |
Exec Time | 127 ms |
Memory | 22356 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | subtask0_0.txt, subtask0_1.txt, subtask0_2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 127 ms | 22356 KB |
02.txt | AC | 110 ms | 20948 KB |
03.txt | AC | 116 ms | 21716 KB |
04.txt | AC | 109 ms | 19284 KB |
05.txt | AC | 111 ms | 21332 KB |
06.txt | AC | 110 ms | 21460 KB |
07.txt | AC | 109 ms | 19924 KB |
08.txt | AC | 113 ms | 21460 KB |
09.txt | AC | 110 ms | 21076 KB |
subtask0_0.txt | AC | 117 ms | 18644 KB |
subtask0_1.txt | AC | 112 ms | 20564 KB |
subtask0_2.txt | AC | 109 ms | 21204 KB |