![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
技巧类
Kelisita
别再抱怨东西太难,只是自己不会,仅此而已
展开
-
【尺取法】poj 3061 Subsequence
DescriptionA sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal le原创 2016-04-13 12:49:42 · 402 阅读 · 0 评论 -
【尺取法】Jessica's Reading Problem
DescriptionJessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master原创 2016-04-13 15:15:09 · 253 阅读 · 0 评论 -
C++ 之 去重函数
对数组a,长度为n;sort(a,a+n);表达:unique(a,a+n)-a 返回不同字符的个数;注意:这里的去重不是真正意义的删除,只是放在了数组后面而已,所以要先sort;原创 2016-04-13 20:59:47 · 8030 阅读 · 1 评论 -
lightoj 1282 Leading and Trailing
You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.InputInput starts with an integer T (≤ 1000), denoting the num原创 2016-05-04 17:43:36 · 380 阅读 · 0 评论 -
二进制数转化为k进制
今天看到一道题,瞬间懵逼了怎么进制转化了, 再自己写一遍,加深印象;int tt(char a[] , int k ) //*将二进制数a转化为k进制数{ int d = 0 ; int len = strlen(a); for(int i = 0 ; i < len ; i++) { d = d*k+ (a[i] - '0'); } return d ;}原创 2016-05-05 11:56:08 · 1268 阅读 · 0 评论 -
十进制转化为二进制
递归调用自身, 然后输出取余;#include using namespace std ; void twoten(int n ) { if(n>0) { tento(n/2); printf("%d",n%2); } } int main() { int n ; cin>>n; tento(n); cout<<endl; return原创 2016-05-05 12:43:46 · 637 阅读 · 0 评论