Submission #1990230


Source Code Expand

import strutils,sequtils
var
    NY:seq[int] = readLine(stdin).split(" ").map(parseInt)
    N = NY[0]
    Y = NY[1]
    x,y,z:int
proc isPositive(a:int,b:int,c:int):bool =
    if a >= 0 and b >= 0 and c>= 0: return true
    else: return false
proc money():string {.discardable.} =
    for i in 1..N:
        x = Y div (i * 10000)
        for r in 1..N:
            y = ((Y mod (i * 10000)) div (r * 5000))
            z = N - (x + y)
            #if x >= 0 and y >= 0 and z >= 0 and ((10000 * x) + (5000 * y) + (1000 * z)) == Y: 
            if isPositive(x,y,z) and ((10000 * x) + (5000 * y) + (1000 * z)) == Y:
                return $x & " " & $y & " " & $z
    return "-1 -1 -1"
echo money()

Submission Info

Submission Time
Task C - Otoshidama
User mkane
Language Nim (0.13.0)
Score 0
Code Size 714 Byte
Status WA
Exec Time 47 ms
Memory 256 KB

Compile Error

Hint: system [Processing]
Hint: Main [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: sequtils [Processing]
Hint:  [Link]
Hint: operation successful (12947 lines compiled; 1.887 sec total; 13.138MB; Release Build) [SuccessX]

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 4
AC × 18
WA × 6
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 1 ms 256 KB
a04 AC 1 ms 256 KB
b05 AC 1 ms 256 KB
b06 AC 1 ms 256 KB
b07 AC 1 ms 256 KB
b08 AC 5 ms 256 KB
b09 AC 1 ms 256 KB
b10 AC 47 ms 256 KB
b11 AC 47 ms 256 KB
b12 AC 5 ms 256 KB
b13 AC 2 ms 256 KB
b14 AC 2 ms 256 KB
b15 WA 46 ms 256 KB
b16 WA 43 ms 256 KB
b17 WA 44 ms 256 KB
b18 WA 1 ms 256 KB
b19 WA 1 ms 256 KB
b20 WA 46 ms 256 KB
b21 AC 47 ms 256 KB
b22 AC 45 ms 256 KB
b23 AC 45 ms 256 KB
b24 AC 43 ms 256 KB