基本算法-水题
文章平均质量分 78
wujy47
这个作者很懒,什么都没留下…
展开
-
HDU 5095 Linearization of the kernel functions in SVM(模拟, 水题)
现场最水的一题,1A,对代码功和细心程度还是有一定考验的。以下代码是赛后重写的,当时写的比较乱,没用函数,各种重复的if写了10段。。按平时写数学式子的常理输出。注意几个细节,全0、第一个为正、系数为1、常数项为1等。原创 2014-11-11 20:48:59 · 675 阅读 · 0 评论 -
HDU 5099 Comparison of Android versions(模拟-水题)
比较Android版本号,题意比较难搞清,If two builds are not in the same code branch, just compare the date code; if they are in the same code branch, compare the date code together with the individual version. 注意这句话。原创 2014-11-11 20:47:52 · 1054 阅读 · 0 评论 -
UVaLive/LA 6802 Turtle Graphics(水题)
题目大意:类似贪吃蛇游戏。问经过给定路径(F-向前,L-左拐,R-右拐)后的终点坐标,和经过两次以上的点数。解题思路:模拟一下即可。原创 2014-11-23 21:01:46 · 1395 阅读 · 0 评论 -
UVaLive/LA 6809 Spokes Wheel(搜索,二进制循环移位)
// Author: Yuan Zhu#include #include #include #include #define ll long longusing namespace std;int t;char a[40], b[40];int toint(char c) { if(c >= '0' && c <= '9') return c - '0'; e原创 2014-11-23 21:45:27 · 859 阅读 · 0 评论 -
CF GYM 100548 Built with Qinghuai and Ari Factor(2014ACM西安现场赛Problem A)
知识点:水题。解题思路:当输入的n个数都能被3整除时,输出“Yes”;否则输出“No”。原创 2015-01-24 14:37:57 · 1937 阅读 · 0 评论 -
HDU 5131 Song Jiang's rank list(水题)
题目大意:按杀人数降序输出水浒英雄,若杀人数相同,按姓名字母序升序输出。并统计输出两种名次。解题思路:排序后,顺序扫描统计即可。水题。原创 2015-01-16 15:39:32 · 1019 阅读 · 0 评论 -
CF GYM 100548 Last Defence(2014ACM西安现场赛Problem K)
知识点:Ad-Hoc,辗转相除法。题目大意:给定数列S的首两项,要求之后的各项满足Si= |Si−1 − Si−2|(前两项差值的绝对值)。问整个数列S中不同的数字个数。解题思路:首先容易发现,当i足够大时,最后一定会出现“xx0xx0...”这样的重复。所以不同数字个数一定是有限的。究其原因,对于数y和x,y一定能写成kx+b的形式,在数列的生成过程中,会出现kx+b、x、(k-1)x+b、(k-2)x+b、x、...、2x+b、x、x+b、b、x,其中出现的不同数字个数就是(kx+b)/原创 2015-01-24 14:40:14 · 2191 阅读 · 0 评论