UVALive 6451:Tables(模拟 Grade D)】的更多相关文章

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…
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…
题意: 对于一个n元组(a0,a1,...),一次变换后变成(|a0-a1|,|a1-a2|,...) 问1000次变换以内是否存在循环. 思路: 模拟,map判重 代码: #include <cstdio> #include <cstring> #include <map> #include <cmath> #include <algorithm> using namespace std; struct Node{ ]; int n; void…
题意: 格式化代码.每个单词对齐,至少隔开一个空格. 思路: 模拟.求出每个单词最大长度,然后按行输出. 代码: #include <cstdio> #include <cstdlib> #include <cstring> ][][]; ]; ]; typedef char * pchar; int readStr(pchar &str, char *out) { ; int ret = sscanf(str, "%s%n", out, &…
题目链接 题意:一张纸,每次从右往左对折.折好以后打开,让每个折痕都自然的呈90度.输出形状. 思路:模拟折……每次折想象成把一张纸分成了正面在下的一张和反面在上的一张.维护左边和方向,然后输出.细节有点多. 代码: #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> using namespace std; #define N (1<<13)+…
这题真是坑啊,题意不明,其实就是往桟里面压入空的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的病…
题目: 象棋,黑棋只有将,红棋有帅车马炮.问是否死将. 思路: 对方将四个方向走一步,看看会不会被吃. 代码: 很难看……WA了很多发,还越界等等. #include <cstdio> #include <cstring> #include <cstdlib> ][]; ][] = {{,},{,},{-,},{,-}}; bool inBlackPalace(int x, int y) { <= y && y <= && &…
vj题目链接 题意: 有n (n<16345)个人,每个人有三个数(小于1000且最多两位小数点),表示答对对应题的得分.规定总分越高的人rank越高.总分相同,id小的rank高.现在知道rank,问这个rank是否可能,如果可能,那么rank最小的那个人的最大得分是多少. 思路: 3个数,最多8种情况.然后从rank小往上推,每次选择一个最小的能符合条件的分数,当作这个人的分数.如果能推下去,则ok,否则,不能. 坑点: 精度很坑.转成整数才过了. 代码: #include <cstdio…