M. Different Billing

#include  <map>
#include <set>
#include <cmath>
#include <queue>
#include <cstdio>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define inf 0x3f3f3f3f
#define endl '\n'
#define int long long using namespace std; const int N = 1e5 + 10, mod = 1e9 +7; //typedef long long ll;
typedef pair<int,int> PII;
//queue<PII> q1;
map<vector<int>, int > mp;
vector<int> a;
deque<char> s;
//priority_queue <int,vector<int>,greater<int> > q2;
int n,m,t,k;
/*
*/
void solve()
{
cin >> n >> m;
if(m == 0){
cout << n << ' ' << 0 << ' ' << 0 << endl;
return ;
}
int x = m / 2500 ;
for(int i = 0;i <= x;i ++){
int y = (m - i * 2500) / 1000;
if((n - x - y ) >= 0 && (i * 2500 + y * 1000 == m)){
cout << n - i - y << ' ' << y << ' ' << i << endl;
return;
}
}
cout << -1 << endl;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int Ke_scholar = 1;
//cin >> Ke_scholar ;
while(Ke_scholar--)
solve();
return 0;
}

SMU Spring 2023 Contest Round 2(待补的更多相关文章

  1. 2015 Astar Contest - Round 3 题解

    1001 数长方形 题目大意 平面内有N条平行于坐标轴的线段,且不会在端点处相交 问共形成多少个矩形 算法思路 枚举4条线段的全部组合.分别作为矩形四条边.推断是否合法 时间复杂度: O(N4) 代码 ...

  2. codeforces round 422 div2 补题 CF 822 A-F

    A I'm bored with life 水题 #include<bits/stdc++.h> using namespace std; typedef long long int LL ...

  3. codeforces round 421 div2 补题 CF 820 A-E

    A Mister B and Book Reading  O(n)暴力即可 #include<bits/stdc++.h> using namespace std; typedef lon ...

  4. codeforces round 420 div2 补题 CF 821 A-E

    A Okabe and Future Gadget Laboratory 暴力 #include<bits/stdc++.h> using namespace std; typedef l ...

  5. Codeforces round 419 div2 补题 CF 816 A-E

    A Karen and Morning 水题 注意进位即可 #include<bits/stdc++.h> using namespace std; typedef long long i ...

  6. Educational Codeforces Round 23 A-F 补题

    A Treasure Hunt 注意负数和0的特殊处理.. 水题.. 然而又被Hack了 吗的智障 #include<bits/stdc++.h> using namespace std; ...

  7. codeforces round 418 div2 补题 CF 814 A-E

    A An abandoned sentiment from past 水题 #include<bits/stdc++.h> using namespace std; int a[300], ...

  8. codeforces round 417 div2 补题 CF 812 A-E

    A Sagheer and Crossroads 水题略过(然而被Hack了 以后要更加谨慎) #include<bits/stdc++.h> using namespace std; i ...

  9. April Fools Day Contest 2019: editorial回顾补题

    A. Thanos Sort time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  10. codeforces round 416 div2 补题 CF 811 A B C D E

    A. Vladik and Courtesy 水题略过 #include<cstdio> #include<cstdlib> #include<cmath> usi ...

随机推荐

  1. 简单的解释下什么是CNAME

    今天在用阿里云的安全防护给接口域名做web应用防火墙,需要配置cname,原来有用到过但是一直没去了解过,只知道怎么用今天搜了一下看看下面是原文,白话文好理解分享一下. 什么是CNAME?先简单的说下 ...

  2. 详解Web应用安全系列(1)注入漏洞之SQL注入

    注入漏洞通常是指在可输入参数的地方,通过构造恶意代码,进而威胁应用安全和数据库安全.常见的注入漏洞包括:SQL注入和XSS跨站脚本攻击. 这篇文章我们主要讲SQL注入,SQL注入即是指web应用程序对 ...

  3. P1551 亲戚 题解。。。

    并查集 目录 并查集 (1.概念: (2.详解 Q1:如何表示不同的家族 ans1: Q2:如何将两个人归到同一个家族中 ans2: CODE: PS: (1.概念: 处理 不相交 可合并 的集合关系 ...

  4. SDL3 入门(3):三角形

    SDL3 提供了 SDL_RenderGeometry 函数绘制几何图形,用法和 OpenGL 差不多,先定义顶点数据,然后根据顶点数据绘制几何图形. 绘制三角形的代码如下: std::array&l ...

  5. 机器学习(四)——Lasso线性回归预测构建分类模型(matlab)

    Lasso线性回归(Least Absolute Shrinkage and Selection Operator)是一种能够进行特征选择和正则化的线性回归方法.其重要的思想是L1正则化:其基本原理为 ...

  6. Centos 下Rabbit MQ 常用操作指令 汇总

    1.rabbitmq 服务的启动停止. service rabbitmq-server start service rabbitmq-server stop 重启命令需要依次执行 stop 再 sta ...

  7. Spring 常见的事务管理、事务的传播特性、隔离级别

    事务管理 事务:多个操作,要么同时成功,要么失败后一起回滚 具备ACID四种特性 Atomic(原子性) Consistency(一致性) lsolation(隔离性) Durablility(持久性 ...

  8. SparkSQL on K8s 在网易传媒的落地实践

    作者:鲁成祥 易顺 随着云原生技术的发展和成熟,大数据基础设施积极拥抱云原生是业内发展的一大趋势.网易传媒在 2021 年成功将 SparkSQL 部署到了 K8s 集群,并实现与部分在线业务的混合部 ...

  9. [oeasy]python0024_ 输出时间_time_模块_module_函数_function

    ​ 输出时间 回忆上次内容 ​print​​函数 有个默认的 ​​end参数​ ​​end参数​​ 的值可以是任意字符串 ​​end参数​​ 的值会输出到结尾位置 ​​end参数​​ 的默认值是 ​​ ...

  10. 整数-笔记C

    实际情况也确实如此,C语言并没有严格规定 short.int.long 的长度,只做了宽泛的限制: short 至少占用 2 个字节. int 建议为一个机器字长.32 位环境下机器字长为 4 字节, ...