Submission #2250266


Source Code Expand

import std.stdio : readln, writeln;
import std.conv : to;
import std.range : split, iota, join, only, tee, array, front;
import std.algorithm : map, reduce;

void main() {
    (
        as => false.reduce!(
            (exists, bs) => exists || (
                10000*bs[0] + 5000*bs[1] + 1000*bs[2] == as[1] && (
                    true.only.tee!(
                        _ => bs.map!(to!string).join(" ").writeln
                    ).array.front
                )
            )
        )(
            0.iota(as[0]+1).map!(
                i => 0.iota(as[0]-i+1).map!(
                    j => [i, j, as[0]-i-j]
                )
            ).join
        ) || writeln("-1 -1 -1")
    )(readln.split.to!(long[]));
}

Submission Info

Submission Time
Task ABC085C - Otoshidama
User arkark
Language D (DMD64 v2.070.1)
Score 300
Code Size 745 Byte
Status AC
Exec Time 441 ms
Memory 191876 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 1 ms 256 KB
a02 AC 1 ms 256 KB
a03 AC 103 ms 44028 KB
a04 AC 440 ms 162204 KB
b05 AC 1 ms 256 KB
b06 AC 1 ms 256 KB
b07 AC 1 ms 256 KB
b08 AC 432 ms 162332 KB
b09 AC 441 ms 162340 KB
b10 AC 441 ms 163996 KB
b11 AC 441 ms 163492 KB
b12 AC 403 ms 191876 KB
b13 AC 401 ms 159876 KB
b14 AC 418 ms 162836 KB
b15 AC 435 ms 162204 KB
b16 AC 412 ms 159776 KB
b17 AC 418 ms 162056 KB
b18 AC 1 ms 256 KB
b19 AC 3 ms 1148 KB
b20 AC 428 ms 162068 KB
b21 AC 440 ms 163856 KB
b22 AC 420 ms 161808 KB
b23 AC 426 ms 161304 KB
b24 AC 410 ms 160536 KB