Submission #1947392


Source Code Expand

#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

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

Submission Info

Submission Time
Task C - Otoshidama
User autumn_eel
Language C++14 (GCC 5.4.1)
Score 300
Code Size 512 Byte
Status AC
Exec Time 4 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 24
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 4 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 4 ms 256 KB
b10 AC 1 ms 256 KB
b11 AC 4 ms 256 KB
b12 AC 1 ms 256 KB
b13 AC 1 ms 256 KB
b14 AC 1 ms 256 KB
b15 AC 4 ms 256 KB
b16 AC 4 ms 256 KB
b17 AC 4 ms 256 KB
b18 AC 1 ms 256 KB
b19 AC 1 ms 256 KB
b20 AC 1 ms 256 KB
b21 AC 1 ms 256 KB
b22 AC 1 ms 256 KB
b23 AC 4 ms 256 KB
b24 AC 4 ms 256 KB