- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 hsacm-1441
http://hsacm.cn/JudgeOnline/problem.php?cid=1009&pid=6题目描述Saya likes math, because she think math can make her cleverer.One day, Kudo invited a very simple game:Given N integers, then th
2015-05-23 11:37:16 629
原创 hsacm-1443
http://hsacm.cn/JudgeOnline/problem.php?id=1443这题直接用SET就可以做,但是有一个严重的问题就是超时。所以这个时候体现了lower_bound函数的重要性,lower_bound(B)返回的是不小于B的第一个值得位置。原来SET也可以调用这个函数。还有一个坑点是HSACM上不能不能用I64d.改成lld分分钟AC.#include#in
2015-05-23 11:26:55 436
原创 cf-379C
技巧题:给出一串的数字,比如5 1 1,输出不能包含重复的数字而且总和尽量小的串。解法:用排序,排完之后遍历,比较目前值和前一个的值+1的大小。取大的数字#include #include #include #include #include #include #include #include #include #include #include #include #in
2015-05-16 20:24:38 470
原创 cf-114A
点击打开链接直接枚举有多少个K相×,#include using namespace std;int main() { long long k, l, a,b=0; cin >> k >> l; for(a=k;a<l;a*=k,b++); if(a==l) cout<<"YES"<<endl<<b<<endl; else cout<<"NO"<<endl;; r
2015-05-15 16:24:02 463
原创 codechef(MAY15)第三题Chef and Prime Divisors
http://www.codechef.com/MAY15/problems/CHAPDYou are given two positive integers – A and B. You have to check whether A is divisible by all the prime divisors of B.InputThe first line o
2015-05-14 19:12:59 756 1
原创 hsacm-1575
题目描述“如果两个人相差一秒出生,其中一个是小孩,那么另一个也是小孩。由此可以推论,所有人均是小孩。”数计系是一个由N个人组成的大家庭,分别为1, 2, 3, ..., N岁。 有一次系主任想为全系拍张合照,需要所有学生站成一排。起先他想按他们的岁数从小到大安排,但后来又觉得这样不自然。于是他建议按如下方案站排: 1岁的在最左边。 每相邻两人不得相差超过2岁。
2015-05-14 18:26:25 953
原创 codechef(MAY15)第二题Set Difference
http://www.codechef.com/MAY15/第二题刚开始找到的规律是对NUM数组进行两个FOR循环,答案就是(num[j]-num[i])*make_pow(2,j-i-1,mod),但是两个循环一定是超的。然后就联想到吧这个规律×进去计算看看,结果发现,是有规律的。可以举个例子数列1,2,3,4来计算来找规律。另外有一个坑就是代码里面不能写成ans+=......应为
2015-05-13 12:21:50 543
原创 cf-172A
http://codeforces.com/contest/172/problem/A用枚举相同位数的长度来暴力。题目的意思是。找出一串电话号码的区号是多少位。#include #include #include #include #include #include #include #include #include #include #include #inc
2015-05-11 19:21:27 935
原创 zoj-3868
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5480数学题,用GCD做。用到容斥的知识。感谢LinXI的博客#include #include #include #include #include #include #include #include #include #include #includ
2015-05-10 19:49:10 453
原创 zoj-2563(1×3铺地砖)
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1563#include #include #include #include #include #include #include #include #include #include #include #include #include #inc
2015-05-10 19:38:05 1316
git bash 2.19.1 Windows64安装包
2018-10-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人