UVALive 6858 Frame (模拟)】的更多相关文章

Frame 题目链接: http://acm.hust.edu.cn/vjudge/contest/130303#problem/D Description http://7xjob4.com1.z0.glb.clouddn.com/17e6574035df3f9b6d1fc6dfd8b650ac Input The input file contains several test cases, each of them as described below. The first line co…
题意:给定一个矩形框架,给定一个小矩形,问你能不能正好拼起来. 析:很简单么,就三种情况,如果是1*1的矩形,或者是1*2的一定可以,然后就是上面和下面正好能是小矩形的整数倍,左右是少一,两个就是整数倍. 最后一种是,每一边都减1,是小矩形的整数倍. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include…
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…
UVALive 3971 题意:有b块钱.想要组装一台电脑,给出n个配件的种类,名字,价格,品质因子.若各种类配件各买一个,总价格<=b,求最差品质配件的最大品质因子. 思路: 求最大的最小值一般用二分法. 在(0.maxq)内进行二分,判定q作为最差品质因子是否可行. 大白书原题.比較考验代码功底. code: /* * @author Novicer * language : C++/C */ #include<iostream> #include<sstream> #i…
VJ题目链接 题意:模拟输出表格 思路:模拟……很暴力 代码: #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; ][]; int main() { int n; while (scanf("%d", &n) != EOF) { ) break; memset(graph, , size…
这题真是坑啊,题意不明,其实就是往桟里面压入空的set集合,所以之前的询问大小都是只有0,只有add的时候,才会产生新的占空间的集合 用stack和set直接进行模拟 #include <iostream> #include <cstdio> #include <cstring> #include <set> #include <stack> #include <map> using namespace std; int cnt; s…
题目链接: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的病…
题意: 每次方案一个或多个子序列: 每个子序列要整除m 认为分割不同,子序列边界的不同就是不同: 1246有4个 1246 12 46 124 6 12 4 6 思路: 先从整体考虑,因为取膜适用于加法,所以一个数拆分成两个数%m==0就代表这个数%m一定=0: 再考虑把原串划分成两段,当且仅当某个前缀组成的数能被m整除时,原串才能被分成两段. 划成多段同理. 求出有多少地方能被切割,结果就是 2^(res-1). 就是相当于枚举每个位置切割or不切割结果. #include <iostream…
题意: 算从左往右的值,先乘后加的值,数的范围<=9= =,然后根据满足的条件输出字符. 思路: 从左往右就是直接来了,先做乘法就是乘法两边的数字靠向右边那个,且左边那个为0,然后所有值一加就好了. #include <bits/stdc++.h> using namespace std; const int N=1e2+10; int zhi[N]; char s[N]; int main() { int n; while(~scanf("%s",s)) { sca…
题目 链接 题意:对于一个$n \times m$的矩阵的最外一圈,问是否能用$k \times 1$的方块填满 分析 考虑左右两边的情况,分类讨论,切记考虑所有可能的情形. #include<bits/stdc++.h> using namespace std; int n, m; bool judge(int k) { ) return true; ) { ) { ) % k == ) return true; ) % k == && m % k == ) return t…