首页 > 其他分享 >SMU Spring 2023 Contest Round 2

SMU Spring 2023 Contest Round 2

时间:2023-05-14 12:55:23浏览次数:51  
标签:cout Contest int Spring SMU long include define

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;
}

 

标签:cout,Contest,int,Spring,SMU,long,include,define
From: https://www.cnblogs.com/Kescholar/p/17399112.html

相关文章

  • maven创建springboot项目
    创建maven项目,pom.xml文件如下:<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation=&......
  • Spring Boot 1.5.x 结合 JUnit5 进行接口测试
    在SpringBoot1.5.x中,默认使用Junit4进行测试。而在对Controller进行接口测试的时候,使用@AutoConfigureMockMvc注解是不能注入MockMvc对象的。因此只能使用WebApplicationContext类去构建MockMvc对象。在SpringBoot1.5.x+Junit4的前提下,测试类的代码是这样写的:@Sp......
  • Java:SpringBoot整合MyBatis-Plus实现MySQL数据库的增删改查
    MyBatis-Plus(简称MP)是一个MyBatis的增强工具,在MyBatis的基础上只做增强不做改变,为简化开发、提高效率而生。文档https://baomidou.com/目录一、引入坐标二、配置三、CURD测试四、API数据接口一、引入坐标<dependency><groupId>com.baomidou</groupId><artifactId>m......
  • 大公司为什么禁止SpringBoot项目使用Tomcat?
    前言在SpringBoot框架中,我们使用最多的是Tomcat,这是SpringBoot默认的容器技术,而且是内嵌式的Tomcat。同时,SpringBoot也支持Undertow容器,我们可以很方便的用Undertow替换Tomcat,而Undertow的性能和内存使用方面都优于Tomcat,那我们如何使用Undertow技术呢?本文将为大家细细讲解。Spr......
  • java基于springboot基于vue的地方美食分享网站、美食管理系统,附源码+数据库+lw文档+PP
    1、项目介绍java基于springboot基于vue的地方美食分享网站、美食管理系统。(a)管理员;管理员使用本系统涉到的功能主要有:首页,个人中心,用户管理,外国美食管理,中式美食管理,热门菜品管理,论坛管理,我的收藏管理,留言板管理等功能。(b)用户;用户使用本系统涉到的功能主要有:首页,外国美食,......
  • Springboot集成mybatis
    目的利用Springboot快速集成Mybatis。集成步骤引入依赖在pom文件中加入:<dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.1.0</version></dependency&......
  • AtCoder Beginner Contest 301
    title:AtCoderBeginnerContest301categories:算法题解description:咕咕咕tags:-Atcoder-贪心-BFS-DPcover:/img/chino/vec/chino17.jpgkatex:truedate:2023-05-1322:47:31A-OverallWinner(abc301a)题目大意给定一个字符串表示高桥和青木......
  • [springboot] 上传文件时,报"org.apache.tomcat.util.http.fileupload.impl.FileSizeLi
    1问题描述基于springmvc/springboot的MultipartFile接口实现上传文件功能时,报如下错误日志[2023/05/1322:31:54.732][TID:N/A][INFO][http-nio-8769-exec-5][AccessPathWebFilter.java:85doFilter][3-4]request-path:http://love.pfr.kim/user-service/v1/file-re......
  • 一、SpringCloud Alibaba之Nacos作为注册中心
    一、简介SpringCloud阿里巴巴旨在为微服务开发提供一站式解决方案。该项目包括开发分布式应用程序和服务所需的组件,以便开发人员可以使用SpringCloud编程模型轻松地开发分布式应用。使用SpringCloudAlibaba,只需要添加一些注释和配置,就可以将阿里巴巴的分布式解决方案用于您的......
  • springboot项目
    1.根据数据库先把User类写完:publicclassUser{privateintid;privateStringusername;privateStringpassword;privateStringemail;privateStringrole;privatebooleanstate;将其实例化后写一个空方法,写get和set方法和tostring方法到此bean......