Submission #3443997


Source Code Expand

import java.util.*;
class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), y = sc.nextInt() / 1000;
        int ans1 = -1, ans2 = -1, ans3 = -1;
        for(int i = 0; i <= n; i++)
            for(int j = 0;  j <= n - i; j++)
                if(9 * i + 4 * j + n == y){
                    ans1 = i;
                    ans2 = j; 
                    ans3 = n - i - j;
                }
        System.out.println(ans1 + " " + ans2 + " " + ans3);
    }
}

Submission Info

Submission Time
Task C - Otoshidama
User tonq
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 554 Byte
Status AC
Exec Time 114 ms
Memory 23252 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 114 ms 23124 KB
a02 AC 94 ms 17876 KB
a03 AC 97 ms 22996 KB
a04 AC 101 ms 19284 KB
b05 AC 93 ms 20820 KB
b06 AC 91 ms 19028 KB
b07 AC 93 ms 21716 KB
b08 AC 100 ms 20560 KB
b09 AC 100 ms 19540 KB
b10 AC 98 ms 21844 KB
b11 AC 100 ms 21076 KB
b12 AC 99 ms 20564 KB
b13 AC 98 ms 19924 KB
b14 AC 100 ms 18900 KB
b15 AC 98 ms 21844 KB
b16 AC 99 ms 21716 KB
b17 AC 100 ms 19540 KB
b18 AC 93 ms 19028 KB
b19 AC 93 ms 19028 KB
b20 AC 99 ms 23252 KB
b21 AC 98 ms 18900 KB
b22 AC 98 ms 19924 KB
b23 AC 99 ms 21332 KB
b24 AC 100 ms 21204 KB