水
踢到火星
我是我生命的主宰
展开
-
Delete from the Left
You are given two strings ss and tt. In a single move, you can choose any of two strings and delete the first (that is, the leftmost) character. After a move, the length of the string decreases by 11....原创 2018-07-29 12:45:03 · 182 阅读 · 0 评论 -
Largest prime factor
Everybody knows any number can be combined by the prime number. Now, your task is telling me what position of the largest prime factor. The position of prime 2 is 1, prime 3 is 2, and prime 5 is 3, ...原创 2018-07-29 13:11:20 · 330 阅读 · 0 评论 -
World Cup
The last stage of Football World Cup is played using the play-off system. There are n teams left in this stage, they are enumerated from 1 to n. Several rounds are held, in each round the remaining t...原创 2018-07-22 08:56:47 · 296 阅读 · 0 评论 -
CodeForces - 569A Music
题目链接 这就是一道数学题; 歌曲总时间:T; 已下载时间:S; 每Q秒能下载Q-1秒的歌曲; 所以1s损失(1-(q-1)/q)个时间; 所以S=(1-(q-1)/q)*t ==> t=S*q; 所以代码 #include <iostream> #include <cstdio> using namespace std; int main(){ ...原创 2018-09-17 19:59:17 · 140 阅读 · 0 评论 -
HDU 1581
思路 : 这个题就是深搜,然后剪一下枝(就是优化一下) #include <iostream> #include <cstdio> #include <cstring> #include <cmath> using namespace std; int T,ans; int book[15]; int a[15]; void dfs(int st...原创 2018-10-14 15:51:36 · 188 阅读 · 0 评论 -
HDU 2510 符号三角形
这是一个深搜水题,但是很扎心,写完代码然后打表,连续打错了两次,我日了。 就是深搜第一行,每个元素有两种选择'+' 或者'-'(代码里我改成了1和2)然后带了N层 返回就行了 。 it‘s real like dream My heart will go on 表 #include <iostream> #include <cstdio> using nam...原创 2018-10-14 20:51:44 · 187 阅读 · 0 评论 -
HDU 1716 排列2
这就是一个全排列,他妈的格式化输出太恶心人了,注意:每次数据输出后有一个空行,但是! 0 0 0 0前面的那个数据没有空行。 因为要去重 用set code: #include <iostream> #include <cstdio> #include <vector> #include <set> #include <algorith...原创 2018-10-15 19:52:27 · 218 阅读 · 1 评论