Submission #7022720


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC085C_Otoshidama
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int n = input[0];
            int y = input[1];

            for(int i = 0; i <= n; i++)
            {
                for (int j = 0; j <= n - i; j++)
                {
                    int total = 10000 * i + 5000 * j + 1000 * (n - i - j);
                    if (total == y)
                    {
                        Console.WriteLine("{0} {1} {2}", i, j, n - i - j);
                        return;
                    }
                }
            }
            Console.WriteLine("-1 -1 -1");
        }
    }
}

Submission Info

Submission Time
Task C - Otoshidama
User sumachu
Language C# (Mono 4.6.2.0)
Score 300
Code Size 884 Byte
Status AC
Exec Time 27 ms
Memory 13396 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 24 ms 13396 KB
a02 AC 23 ms 13268 KB
a03 AC 22 ms 9172 KB
a04 AC 26 ms 11220 KB
b05 AC 23 ms 11220 KB
b06 AC 23 ms 13268 KB
b07 AC 23 ms 13268 KB
b08 AC 23 ms 11348 KB
b09 AC 27 ms 13268 KB
b10 AC 25 ms 11348 KB
b11 AC 26 ms 13268 KB
b12 AC 23 ms 9172 KB
b13 AC 23 ms 9300 KB
b14 AC 23 ms 11348 KB
b15 AC 26 ms 9300 KB
b16 AC 27 ms 13268 KB
b17 AC 26 ms 11348 KB
b18 AC 23 ms 13268 KB
b19 AC 23 ms 11220 KB
b20 AC 23 ms 11220 KB
b21 AC 26 ms 13268 KB
b22 AC 25 ms 11348 KB
b23 AC 25 ms 11220 KB
b24 AC 25 ms 11348 KB