Submission #3246757


Source Code Expand

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include "bits/stdc++.h"
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()



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

Submission Info

Submission Time
Task C - Otoshidama
User ponponpop
Language C++14 (GCC 5.4.1)
Score 0
Code Size 940 Byte
Status WA
Exec Time 881 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
WA × 1
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 WA 1 ms 256 KB
a04 AC 881 ms 256 KB
b05 AC 1 ms 256 KB
b06 AC 1 ms 256 KB
b07 AC 1 ms 256 KB
b08 AC 1 ms 256 KB
b09 AC 879 ms 256 KB
b10 WA 1 ms 256 KB
b11 AC 879 ms 256 KB
b12 AC 1 ms 256 KB
b13 WA 1 ms 256 KB
b14 WA 1 ms 256 KB
b15 AC 858 ms 256 KB
b16 AC 777 ms 256 KB
b17 AC 801 ms 256 KB
b18 AC 1 ms 256 KB
b19 AC 2 ms 256 KB
b20 AC 2 ms 256 KB
b21 WA 1 ms 256 KB
b22 WA 1 ms 256 KB
b23 AC 829 ms 256 KB
b24 AC 775 ms 256 KB