Submission #2202609


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, y;
    cin >> n >> y;
    for(int i = 0; i <= n; ++i) {
        for(int j = 0; j <= n; ++j) {
            int k = n - i - j;
            if(10000*i + 5000*j + 1000*k == y && (k >= 0)) {
                cout << i << " " << j << " " << k << endl;
                return 0;
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
    return 0;
}

Submission Info

Submission Time
Task ABC085C - Otoshidama
User heppoko_yuki
Language C++14 (GCC 5.4.1)
Score 300
Code Size 458 Byte
Status
Exec Time 5 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03, a04
All 300 / 300 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 1 ms 256 KB
a02 1 ms 256 KB
a03 1 ms 256 KB
a04 5 ms 256 KB
b05 1 ms 256 KB
b06 1 ms 256 KB
b07 1 ms 256 KB
b08 1 ms 256 KB
b09 5 ms 256 KB
b10 5 ms 256 KB
b11 5 ms 256 KB
b12 1 ms 256 KB
b13 1 ms 256 KB
b14 1 ms 256 KB
b15 5 ms 256 KB
b16 5 ms 256 KB
b17 5 ms 256 KB
b18 1 ms 256 KB
b19 1 ms 256 KB
b20 1 ms 256 KB
b21 5 ms 256 KB
b22 5 ms 256 KB
b23 5 ms 256 KB
b24 5 ms 256 KB