
杂题
文章平均质量分 75
皮卡丘来了
淡定
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
FOJ 1012 欧拉函数水题
#include #include #include using namespace std; int oula(int n){ int sum=1; for(int i=2;i*i int k=0; while(n%i==0) { n /= i; k++; }原创 2012-12-27 15:10:13 · 834 阅读 · 0 评论 -
数学题
Problem G: 平方根的和的平方 Time Limit: 2 Sec Memory Limit: 128 MB Submit: 9 Solved: 1 Submit Status Web Board Description 平方根的和的平方SSR (Squared Sum of square Roots),是一个函数: SSR(A, B) = (sqrt(原创 2013-03-22 13:12:56 · 1165 阅读 · 0 评论 -
北邮赛2题D
D Password Accept:25 Submit:68 Time Limit:1000MS Memory Limit:65536KB Description ykwd's password is a number sequence. Every number in this sequence is原创 2013-03-20 22:32:22 · 984 阅读 · 0 评论 -
I SQRT
I SQRT Accept:48 Submit:100 Time Limit:1000MS Memory Limit:65536KB Description There is a positive integer N, and please give us the smallest root x of原创 2013-03-20 22:29:46 · 1218 阅读 · 0 评论 -
2013ACM多校联合(1)_CSUST
/* G 题 类型:搜索。。。 题意:中文 解析:各种减枝,特别是奇偶减枝。。判断(步数%2)==((ex+ey-sx-sy)%2) */ #include #include #include #include #define manx 55 using namespace std; int n,m,s,sx,sy,flag,ex,ey; char mp[m原创 2013-03-18 19:37:22 · 1203 阅读 · 1 评论 -
“网宿科技杯”厦门大学第四届程序设计积分赛 热身赛
/* A 题 题意:中文 解题:此题果断二分,时间复杂度为 n*lgn ,注意最后的结果是 min ,理解其意 */ #include #include #include #include #define manx 100009 using namespace std; long long a[manx]; int main(){ in原创 2013-03-16 23:48:07 · 1566 阅读 · 0 评论 -
HDU 1730 汉字
#include #include #include using namespace std; bool flag ; char a[100000]; int main(){ while(gets(a)){ int len=strlen(a); flag = true; for(int i=0;i<len;i++){原创 2013-03-28 21:06:35 · 863 阅读 · 0 评论 -
ZJUT 1063 Lily's puzzle
/* ZJUT 1063 解析:没过的人注意了,s 和 t 没有说具体哪道边,所有情况都要考虑 采用压缩储存方式。。。。 */ #include #include #include using namespace std; #define manx 150 int mp[manx][manx],dp[manx][manx]; int w,h;原创 2013-03-15 12:44:36 · 1006 阅读 · 0 评论 -
NBUT 2013 Timed NOJ Training #003 C题 日期天数换算
/* C题 Nth Day is Which Day 网址:http://acm.nbut.cn/Contest/view/id/34/problem/C.xhtml 题意:中文 方法:打表,模拟 */ #include #include using namespace std; int x[13]={0,31,28,31,30,31,30,31,31,30,3原创 2013-03-11 23:39:26 · 851 阅读 · 0 评论 -
ZJUT 1005 幻方
/* 题目:幻方 方法:方法有很多种的,我这里使用深搜,注意方向 */ #include #include #include using namespace std; #define manx 33 int x[manx][manx],n; int flag; void dfs(int a,int b,int ans){ if(flag || x[a][b]) return;原创 2013-03-13 17:32:23 · 951 阅读 · 0 评论 -
ZJUT 1002 ceil() 和 pow() 的使用
/* 题目网址:http://acm.zjut.edu.cn/ShowProblem.aspx?ShowID=1002 数字游戏:中文 解析:注意 pow(n,1.0/m)的意义,还有就是 ceil()的用法 */ #include #include #include #include using namespace std; int main(){原创 2013-03-13 14:53:16 · 987 阅读 · 0 评论 -
2012湖南邀请赛A题
/* 方法:打表 解析:奇数 = 奇合数 + 偶数 假设某个奇数 x ,那么只有 x - 4 之前的奇合数才符合要求 */ #include #include #include using namespace std; #define manx 1000009 long long x[manx]; bool s[manx]; void prime(){ for(int i=0原创 2013-03-10 00:11:29 · 1174 阅读 · 0 评论 -
2013年湘潭大学程序设计比赛
/* B题 类型:动态规划,思考由后往前,代码,由前往后。。。注意边界。。。 */ #include #include #include #include using namespace std; #define manx 1009 string x; int z[manx]; int main(){ int n; while(cin>>n)原创 2013-03-10 17:21:32 · 1474 阅读 · 0 评论 -
考察二进制知识
/* 类型:数论 题目链接http://ac.nbutoj.com/Problem/view.xhtml?id=1360 给你一个N,让你找到最小的M使得(2 ^ N - 1) % (2 ^ M - 1) = 0。 2 ^ N的二进制数一定是1后面跟随一些0,那么2 ^ N - 1的二进制数每一位上都是1了, 所以要想使(2 ^ N - 1) % (2 ^ M - 1)原创 2013-03-09 15:12:26 · 1128 阅读 · 0 评论 -
青蛙跳
/* 网络上的青蛙跳游戏。 还没有把路径打印出来,公青蛙表示为 1,母青蛙表示成2; 直接使用深度搜索就OK了,注意规则,两只相同的青蛙不能相连, 路径可以直接用栈进行保存,然后输出来。。 */ #include #include #include #include using namespace std; #define manx 100009 int x原创 2013-03-08 18:19:23 · 1064 阅读 · 0 评论 -
字典树
/* 题目网址:http://acm.nyist.net/JudgeOnline/problem.php?pid=32 */ #include #include #include using namespace std; #define manx 12 struct node{ int num; node*next[manx]; }; in原创 2013-03-03 14:41:03 · 741 阅读 · 0 评论 -
邀请赛队员选拔赛--二分
二分+平移 LOL Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Submission(s) : 46 Accepted Submission(s) : 7 Font: Times New Roman | Verdana | Georgia Font Siz原创 2013-04-09 09:03:14 · 830 阅读 · 0 评论