Submission #3442367


Source Code Expand

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int y = scan.nextInt();
		for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= n-i; j++) {
				if (10000*i + 5000*j + 1000*(n-i-j) == y) {
					System.out.println(i + " " + j + " " + (n-i-j));
					return;
				}
			}
		}
		System.out.println(-1 + " " + -1 + " " + -1);
	}
}

Submission Info

Submission Time
Task C - Otoshidama
User sarashin
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 454 Byte
Status AC
Exec Time 101 ms
Memory 21844 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 24
Set Name Test Cases
Sample a01, a02, a03, a04
All a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 AC 94 ms 19028 KB
a02 AC 92 ms 20564 KB
a03 AC 92 ms 20820 KB
a04 AC 99 ms 19668 KB
b05 AC 91 ms 21332 KB
b06 AC 92 ms 20812 KB
b07 AC 92 ms 18636 KB
b08 AC 92 ms 21716 KB
b09 AC 98 ms 18644 KB
b10 AC 101 ms 21332 KB
b11 AC 98 ms 20948 KB
b12 AC 92 ms 20564 KB
b13 AC 92 ms 19412 KB
b14 AC 94 ms 20948 KB
b15 AC 99 ms 20692 KB
b16 AC 99 ms 19920 KB
b17 AC 98 ms 19156 KB
b18 AC 92 ms 18640 KB
b19 AC 91 ms 21844 KB
b20 AC 92 ms 21204 KB
b21 AC 97 ms 19028 KB
b22 AC 99 ms 20560 KB
b23 AC 98 ms 21844 KB
b24 AC 99 ms 19924 KB