UVALive - 6440(模拟)】的更多相关文章

题目链接:https://vjudge.net/contest/241341#problem/G 题目大意:输入一个N,n次操作.对于第一种操作增加一个病人,告诉病人的t0,st0,r.第二种操作,在时间t,选取一个病情最严重的病人进行医治.病人的严重情况为S(t)=st0+r(t-t0).如果病人严重情况相同,选r最大的进行医治.(1<=N <=100 000),(0<=r<=100.对于第二种操作输出被治疗的病人. 解题思路:因为r的范围比较小,是0-100,而且对于相同r的病…
题目链接:https://vjudge.net/contest/241341#problem/G Indonesia, as well as some neighboring Southeast Asian countries and some other East Asian countries, is located in the Pacific Ring of Fire which rather frequently causes volcanic eruptions, large eart…
我好菜啊.. UVALive 6434 给出 n 个数,分成m组,每组的价值为最大值减去最小值,每组至少有1个,如果这一组只有一个数的话,价值为0 问 最小的价值是多少 dp[i][j] 表示将 前 i 个数分成 j 组的最小价值 dp[i][j] = min(dp[k][j-1] + a[i]-a[k+1]) #include <iostream> #include <cstdio> #include <cstring> #include <algorithm&…
题目传送门 /* 模拟/字符串处理:主要是对*的处理,先把乘的预处理后再用加法,比如说是:1+2*3+4 = 1+..6+4 = 11 */ #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <cmath> #include <vector> #include <map> #include <que…
UVALive - 6269 Digital Clock 题意:时钟坏了,给你一段连续的时间,问你现在可能的时间是多少. 思路:直接模拟,他妈的居然这场就跪在了这题,卧槽,他妈的就在111行,居然多打了个 = ,这是什么意思,注孤生吗 #pragma comment(linker, "/STACK:1000000000") #include <bits/stdc++.h> #define LL long long #define INF 0x3f3f3f3f #define…
题意:给n个医生,这些医生有一个上班时间,然后给一些病人,病人有一个到达的时间,以及一些诊断,诊断有property(优先级)和duration(诊断时间)这两个属性,每个病人可能要诊断多次,最后问每个病人的全部疗程完成离开医院的时间是多少. 分析:用优先队列存储诊断,病人,然后模拟一个诊断过程,完成病人的个数等于病人数的时候就结束.具体看代码吧. 代码: #include <iostream> #include <cstdio> #include <cstring>…
题意:给一个元素周期表的元素符号(114种),再给一个串,问这个串能否有这些元素符号组成(全为小写). 解法1:动态规划 定义:dp[i]表示到 i 这个字符为止,能否有元素周期表里的符号构成. 则有转移方程:dp[i] = (dp[i-1]&&f(i-1,1)) || (dp[i-2]&&f(i-2,2))     f(i,k):表示从i开始填入k个字符,这k个字符在不在元素周期表中.  dp[0] = 1 代码: //109ms 0KB #include <ios…
Stack Machine Executor 题目链接: http://acm.hust.edu.cn/vjudge/problem/26628 Description http://7xjob4.com1.z0.glb.clouddn.com/18113a5cf78f108997460e36f7079fc6 Input The input contains several instances. Each instance consists of two lines, the first lin…
Stack Machine Executor 题目链接: http://acm.hust.edu.cn/vjudge/problem/26636 Description http://7xjob4.com1.z0.glb.clouddn.com/7df4b3c52d86b5aca54ec47060e43f56 Input The input contains description of several machines. Each machine is described by two par…
Dance 题目连接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2223 Descriptionww.co For a dance to be proper in the Altered Culture of Machinema, it must abide by the following rules: A dip…