TC SRM 597 DEV2】的更多相关文章

第一次玩TC的SRM,只完成了一题,有点失落,不过还是要把每个问题都研究清楚才是我的本性,呵呵 第一题思路: 任意一个数,不断除掉2以后的剩下的数若相同则YES否则NO 第二题: 最开始判断字母个数是否相同, 然后从反向考虑: B: DACBA A: DCABA 变成B的第一位可以任意插在中间位置 ,最终变成A 这样的话只要将B从右向左在A中找出匹配,则B剩下的左侧字母就可以任意插进去得到A 第三题: 思考中…
TC srm.673 300 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 Description 给你n(n<=50)匹马和n个人,一匹马和一个人能够组成一个骑兵,这个骑兵的战斗力等于马的战斗力乘以人的战斗力,问你有多少种组合方式满足其他骑兵的战斗力都不超过第0号骑兵. Input Output Sample Input Sample Output HINT 题意 题解: 大概就暴力枚举哪匹马和第0号人匹配,后面的骑兵我们按照战斗力从大到小排序之后,…
妈蛋第一场tc就掉分,提交了第一个题的时候就注定悲剧要发生了,妈蛋没考虑0就直接%了,真的是人傻见识又少,第二题最后有了一点思路,没时间写了,可能也不是很准确,第三题想了小会儿效果为0! 然后第一题傻逼的被人查水表了,还送分给别人,买一送一,妈蛋 这尼玛不和CF一样的悲剧啊!后面想查别人的格式又弄错,哎- -!…
AABB Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 TC Description One day, Jamie noticed that many English words only use the letters A and B. Examples of such words include "AB" (short for abdominal), "BAA" (the noise a sheep makes), &…
ChessFloor Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 TC Description Samantha is renovating a square room. The floor of the room is an N times N grid of unit square tiles. Each tile has some color. You are given the current colors of all tiles in a…
LuckyXorTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 TC Description A lucky number is a positive integer consisting of only the digits 4 and 7.Given an int a, return an int b strictly greater than a, such that a XOR b is a lucky number. (See Notes fo…
我只能说的亏没做,要不就挂0了.. 本来想四色定理,肯定4就可以的...然后准备爆,发现3的时候不好爆,又想了老一会,嗯,数据范围不小,应该不是暴力,直接找规律,貌似最大就是3,有一个3连块,输出3,其他输出2什么的.交,发现有环的时候,特殊的也是3...没办法还得暴力啊.暴力2的情况,写的也是各种错误...终于过了. #include <iostream> #include <cstdio> #include <cstring> #include <vector…
很棒的DP,不过没想出,看题解了..思维很重要. #include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <cmath> #include <algorithm> using namespace std; ]; ]; class MayTheBestPetWin { public : int calc(vector <…
很不错的一题,非常巧妙的用DP顺序解决这个问题... 可以发现,只和A里面最小的有关系... #include <cstdio> #include <cstring> #include <queue> #include <string> #include <vector> #include <algorithm> using namespace std; #define LL long long *+]; vector<int&…
表示第一次在div1,我要记录一下... 木有挂0,第一题不怎么难的,读题读了20分钟,又想了20分钟,时间有点长,然后各种小心,然后得了140分.... 后两个题,根本木有看,貌似做出来的也不多...涨了6分...这... 我的成绩很稳定,一直都是一个题... 贴了代码,填充一下内容... 第一题: class TheTree { public: int maximumDiameter(vector <int> cnt) { int i,j,n,temp,maxz; ]; n = ; max…