Submission #6479651


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
int main(){
    int m,n;
    cin>>m>>n;
    for(int i=0;i<=m;i++)
    for(int j=0;j<=m;j++)
    for(int k=0;k<=m,i+j+k<=m;k++){
    if(i+j+k==m&&i*1000+j*5000+k*10000==n){printf("%d %d %d",k,j,i);return 0;}}
    printf("-1 -1 -1");
    return 0;
}

Submission Info

Submission Time
Task C - Otoshidama
User luogu_bot1
Language C++ (GCC 5.4.1)
Score 300
Code Size 303 Byte
Status
Exec Time 889 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 115 ms 256 KB
a04 1 ms 256 KB
b05 1 ms 256 KB
b06 1 ms 256 KB
b07 1 ms 256 KB
b08 889 ms 256 KB
b09 1 ms 256 KB
b10 889 ms 256 KB
b11 888 ms 256 KB
b12 880 ms 256 KB
b13 778 ms 256 KB
b14 839 ms 256 KB
b15 2 ms 256 KB
b16 4 ms 256 KB
b17 6 ms 256 KB
b18 1 ms 256 KB
b19 1 ms 256 KB
b20 513 ms 256 KB
b21 877 ms 256 KB
b22 818 ms 256 KB
b23 837 ms 256 KB
b24 783 ms 256 KB