SMU Spring 2023 Contest Round 2(待补
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(待补的更多相关文章
- 2015 Astar Contest - Round 3 题解
1001 数长方形 题目大意 平面内有N条平行于坐标轴的线段,且不会在端点处相交 问共形成多少个矩形 算法思路 枚举4条线段的全部组合.分别作为矩形四条边.推断是否合法 时间复杂度: O(N4) 代码 ...
- 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 ...
- 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 ...
- codeforces round 420 div2 补题 CF 821 A-E
A Okabe and Future Gadget Laboratory 暴力 #include<bits/stdc++.h> using namespace std; typedef l ...
- Codeforces round 419 div2 补题 CF 816 A-E
A Karen and Morning 水题 注意进位即可 #include<bits/stdc++.h> using namespace std; typedef long long i ...
- Educational Codeforces Round 23 A-F 补题
A Treasure Hunt 注意负数和0的特殊处理.. 水题.. 然而又被Hack了 吗的智障 #include<bits/stdc++.h> using namespace std; ...
- codeforces round 418 div2 补题 CF 814 A-E
A An abandoned sentiment from past 水题 #include<bits/stdc++.h> using namespace std; int a[300], ...
- codeforces round 417 div2 补题 CF 812 A-E
A Sagheer and Crossroads 水题略过(然而被Hack了 以后要更加谨慎) #include<bits/stdc++.h> using namespace std; i ...
- April Fools Day Contest 2019: editorial回顾补题
A. Thanos Sort time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- codeforces round 416 div2 补题 CF 811 A B C D E
A. Vladik and Courtesy 水题略过 #include<cstdio> #include<cstdlib> #include<cmath> usi ...
随机推荐
- 2024-06-19:用go语言,给定一个起始下标为 0 的整数数组 nums 和一个整数 k, 可以执行一个操作将相邻两个元素按位AND后替换为结果。 要求在最多执行 k 次操作的情况下, 计算数组
2024-06-19:用go语言,给定一个起始下标为 0 的整数数组 nums 和一个整数 k, 可以执行一个操作将相邻两个元素按位AND后替换为结果. 要求在最多执行 k 次操作的情况下, 计算数组 ...
- Nuxt 3 路由系统详解:配置与实践指南
title: Nuxt 3 路由系统详解:配置与实践指南 date: 2024/6/21 updated: 2024/6/21 author: cmdragon excerpt: 摘要:本文是一份关于 ...
- spring之NamedParameterJdbcTemplate返回自增列值
以前使用JdbcTemplate来获取自增列的值,现在发现NamedParameterJdbcTemplate也可以,而且后者大部分情况下,其实更加方便. 这种方便主要是在于代码维护方面:我们更加习惯 ...
- Python加密操作 对称加密/非对称加密
安装包: pycryptodome https://pycryptodome.readthedocs.io/en/latest/src/installation.html#compiling-in-l ...
- 如何用matlab求隐式函数的导数
如何用matlab求隐式函数的导数 隐函数求导的例子 假设有一个圆 \(x^2+y^2=5\) , 要求在某个点上的切线的斜率. 我们可以把式\(x^2+y^2=5\)中的每一项对\(x\)求导, 可 ...
- 高通与At指令:ATFWD解析
背景 本章的内容是适用于AP侧AT指令开发调试的有关人员. 主要是介绍高通实现的ATFWD框架.在这需要说明一下的是,或许你对AT Command很了解了,但是却貌似都不知道ATFWD,这很正常,严格 ...
- ubuntu 使用natapp配置内网穿透
前言 在自己的服务器上起了服务,但由于域名还没申请下来,无法使用域名测试微信公众号接口,辛亏看到了这个博客:Natapp内网穿透服务工具.跟随这篇博客,我搭建了自己的内网穿透服务,现在记录如下. 过程 ...
- Java中的泛型(类、接口、方法)
一.泛型概述 1. 什么是泛型? 泛型,即"参数化类型".一提到参数,最熟悉的就是定义方法时有形参列表,普通方法的形参列表中,每个形参的数据类型是确定的,而变量是一个参数.在调用普 ...
- 2024已过半,还没试过在vue3中使用ioc容器吗?
Vue3 已经非常强大和灵活了,为什么还要引入 IOC 容器呢?IOC 容器离不开 Class,那么我们就从 Class 谈起 Class的应用场景 一提起 Class,大家一定会想到这是 Vue 官 ...
- [oeasy]python0 113_字符编码_VT100控制码_iso_8859_1_拉丁字符_latin
拉丁字符 回忆上次内容 上次回顾了字型编码的进化过程 7-bit 的 点阵字库 终于让 字母.数字.标点 明确了字型 但是 7-bit 的 ascii中 没有法文字符的位置 添加图 ...