Submission #1947358
Source Code Expand
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <sstream> #include <functional> #include <map> #include <string> #include <cstring> #include <vector> #include <queue> #include <stack> #include <deque> #include <set> #include <list> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> P; const double PI = 3.14159265358979323846; const double EPS = 1e-12; const ll INF = 1LL<<29; const ll mod = 1e9+7; #define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i)) #define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d)) #define all(v) (v).begin(), (v).end() #define pb(x) push_back(x) #define mp(x,y) make_pair((x),(y)) #define mset(m,v) memset((m),(v),sizeof(m)) #define chmin(x,y) (x=min(x,y)) #define chmax(x,y) (x=max(x,y)) #define fst first #define snd second #define UNIQUE(x) (x).erase(unique(all(x)),(x).end()) template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;} int main(){ ll n, y; cin>>n>>y; y /= 1000; for(ll i = 0; i <= y/10; i++){ for(ll j = 0; j <= y/5; j++){ ll k = y-10*i-5*j; if(k<0) continue; if(i+j+k==n){ cout<<i<<" "<<j<<" "<<k<<endl; return 0; } } } puts("-1 -1 -1"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Otoshidama |
User | Lepton |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1410 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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 | 8 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 | 8 ms | 256 KB |
b10 | AC | 1 ms | 256 KB |
b11 | AC | 8 ms | 256 KB |
b12 | AC | 1 ms | 256 KB |
b13 | AC | 1 ms | 256 KB |
b14 | AC | 1 ms | 256 KB |
b15 | AC | 8 ms | 256 KB |
b16 | AC | 7 ms | 256 KB |
b17 | AC | 7 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 | 8 ms | 256 KB |
b24 | AC | 7 ms | 256 KB |