![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
杂题
文章平均质量分 75
皮卡丘来了
淡定
展开
-
FOJ 1012 欧拉函数水题
#include#include#includeusing 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 · 770 阅读 · 0 评论 -
数学题
Problem G: 平方根的和的平方Time Limit: 2 Sec Memory Limit: 128 MBSubmit: 9 Solved: 1SubmitStatusWeb BoardDescription平方根的和的平方SSR (Squared Sum of square Roots),是一个函数:SSR(A, B) = (sqrt(原创 2013-03-22 13:12:56 · 1093 阅读 · 0 评论 -
北邮赛2题D
D PasswordAccept:25 Submit:68Time Limit:1000MS Memory Limit:65536KBDescriptionykwd's password is a number sequence. Every number in this sequence is原创 2013-03-20 22:32:22 · 897 阅读 · 0 评论 -
I SQRT
I SQRTAccept:48 Submit:100Time Limit:1000MS Memory Limit:65536KBDescription There is a positive integer N, and please give us the smallest root x of原创 2013-03-20 22:29:46 · 1142 阅读 · 0 评论 -
2013ACM多校联合(1)_CSUST
/*G 题 类型:搜索。。。 题意:中文解析:各种减枝,特别是奇偶减枝。。判断(步数%2)==((ex+ey-sx-sy)%2) */#include#include#include#include#define manx 55using namespace std;int n,m,s,sx,sy,flag,ex,ey;char mp[m原创 2013-03-18 19:37:22 · 1136 阅读 · 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 · 1507 阅读 · 0 评论 -
HDU 1730 汉字
#include#include#includeusing 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 · 790 阅读 · 0 评论 -
ZJUT 1063 Lily's puzzle
/*ZJUT 1063 解析:没过的人注意了,s 和 t 没有说具体哪道边,所有情况都要考虑 采用压缩储存方式。。。。 */#include#include#includeusing namespace std;#define manx 150int mp[manx][manx],dp[manx][manx];int w,h;原创 2013-03-15 12:44:36 · 949 阅读 · 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#includeusing namespace std;int x[13]={0,31,28,31,30,31,30,31,31,30,3原创 2013-03-11 23:39:26 · 792 阅读 · 0 评论 -
ZJUT 1005 幻方
/*题目:幻方方法:方法有很多种的,我这里使用深搜,注意方向 */#include#include#includeusing namespace std;#define manx 33int 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 · 883 阅读 · 0 评论 -
ZJUT 1002 ceil() 和 pow() 的使用
/* 题目网址:http://acm.zjut.edu.cn/ShowProblem.aspx?ShowID=1002数字游戏:中文解析:注意 pow(n,1.0/m)的意义,还有就是 ceil()的用法 */#include#include#include#includeusing namespace std;int main(){原创 2013-03-13 14:53:16 · 934 阅读 · 0 评论 -
2012湖南邀请赛A题
/*方法:打表 解析:奇数 = 奇合数 + 偶数假设某个奇数 x ,那么只有 x - 4 之前的奇合数才符合要求 */#include#include#includeusing namespace std;#define manx 1000009long long x[manx];bool s[manx];void prime(){ for(int i=0原创 2013-03-10 00:11:29 · 1105 阅读 · 0 评论 -
2013年湘潭大学程序设计比赛
/*B题类型:动态规划,思考由后往前,代码,由前往后。。。注意边界。。。 */ #include#include#include#includeusing namespace std;#define manx 1009string x;int z[manx];int main(){ int n; while(cin>>n)原创 2013-03-10 17:21:32 · 1419 阅读 · 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 · 1032 阅读 · 0 评论 -
青蛙跳
/*网络上的青蛙跳游戏。 还没有把路径打印出来,公青蛙表示为 1,母青蛙表示成2;直接使用深度搜索就OK了,注意规则,两只相同的青蛙不能相连,路径可以直接用栈进行保存,然后输出来。。 */#include#include#include#includeusing namespace std;#define manx 100009int x原创 2013-03-08 18:19:23 · 988 阅读 · 0 评论 -
字典树
/*题目网址:http://acm.nyist.net/JudgeOnline/problem.php?pid=32 */#include#include#includeusing namespace std;#define manx 12struct node{ int num; node*next[manx];};in原创 2013-03-03 14:41:03 · 698 阅读 · 0 评论 -
邀请赛队员选拔赛--二分
二分+平移LOLTime Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 46 Accepted Submission(s) : 7Font: Times New Roman | Verdana | GeorgiaFont Siz原创 2013-04-09 09:03:14 · 773 阅读 · 0 评论