Submission #7022336


Source Code Expand

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <iomanip>


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define rep(i, a, b) for (int i=a; i<(b); i++)
#define rp(i, a) for (int i=0; i<(a); i++)
#define repd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define rpd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout << std::setprecision(9);
    cout << std::fixed;

    ll n,y;
    cin >> n >> y;
    y /= 1000;
    if(y - n < 0) {
      cout << "-1 -1 -1"<<endl; return 0;
    }
    ll a,b,c;
    rp(i,2001){
      b = i;
      if((y-n-4*b)%9 != 0) continue;
      a =  (y-n-4*b)/9;
      if(n - a- b < 0) continue;
      c = n - a- b;
      cout << a <<" " << b << " "<<c <<endl;
      return 0;
    }
    cout << "-1 -1 -1"<<endl;
    return 0;
}

// read the question correctly (ll vs int)
// template by super1 derived from bqi343

Submission Info

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

Judge Result

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