Submission #2426948
Source Code Expand
process.stdin.resume(); process.stdin.setEncoding('utf-8'); function calcBillSheets(num, yen) { var billComb = [num, 0, 0]; var total; while ((total = totalSum(billComb)) > yen) { if (billComb[1] > 0) { billComb[1]--; billComb[2]++; } else if (billComb[0] > 0) { billComb[0]--; billComb[1]++; } else { return [-1, -1, -1]; } } if (totalSum(billComb) === yen) { return billComb; } else { return [-1, -1, -1]; } } function totalSum(billComb) { return billComb[0] * 10000 + billComb[1] * 5000 + billComb[2] * 1000; } process.stdin.on('data', function (line) { var arg = line.trim().split(' '); console.log(calcBillSheets(parseInt(arg[0]), parseInt(arg[1])).join(' ')); process.exit(0); });
Submission Info
Submission Time | |
---|---|
Task | A - Already 2018 |
User | dr1993 |
Language | JavaScript (node.js v5.12) |
Score | 0 |
Code Size | 789 Byte |
Status | WA |
Exec Time | 1793 ms |
Memory | 21956 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | a01, a02 |
All | a01, a02, b03, b04, b05, b06, b07, b08 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
a01 | WA | 1793 ms | 21956 KB |
a02 | WA | 54 ms | 7372 KB |
b03 | WA | 54 ms | 7372 KB |
b04 | WA | 54 ms | 7372 KB |
b05 | WA | 54 ms | 7372 KB |
b06 | WA | 53 ms | 7372 KB |
b07 | WA | 54 ms | 7372 KB |
b08 | WA | 54 ms | 7500 KB |