Submission #2433732


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 y = sc.nextInt();
    Boolean finded = false;
    out: for (int a = 0; a < n; a++) {
      for (int b = 0; b < n - a; b++) {
        int c = n - a - b;
        if (a * 10000 + b * 5000 + c * 1000 == y) {
          finded = true;
          System.out.println(String.format("%d %d %d", a, b, c));
          break out;
        }
      }
    }
    if (!finded) System.out.println("-1 -1 -1");
  }
}

Submission Info

Submission Time
Task C - Otoshidama
User amama
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 581 Byte
Status WA
Exec Time 104 ms
Memory 23892 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
WA × 1
AC × 20
WA × 4
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 93 ms 19796 KB
a02 AC 92 ms 18900 KB
a03 AC 92 ms 23892 KB
a04 WA 101 ms 18772 KB
b05 AC 92 ms 19796 KB
b06 WA 92 ms 21844 KB
b07 WA 94 ms 21332 KB
b08 AC 93 ms 19412 KB
b09 WA 104 ms 19156 KB
b10 AC 102 ms 19412 KB
b11 AC 102 ms 19796 KB
b12 AC 95 ms 20948 KB
b13 AC 97 ms 19668 KB
b14 AC 94 ms 17492 KB
b15 AC 102 ms 21844 KB
b16 AC 104 ms 21460 KB
b17 AC 103 ms 18772 KB
b18 AC 94 ms 21716 KB
b19 AC 95 ms 19668 KB
b20 AC 93 ms 20684 KB
b21 AC 102 ms 19284 KB
b22 AC 104 ms 21332 KB
b23 AC 103 ms 19796 KB
b24 AC 103 ms 17104 KB