- 博客(240)
- 资源 (16)
- 问答 (2)
- 收藏
- 关注
原创 HDOJ 1232 畅通工程
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1232最开始做最小生成树的题,自己不会做,在网上找了一个代码看了一下,感觉思路很清晰,找树的根的个数(联通分支数)K,最后要修的K-1路就是把这些根链接起来形成一个最小生成树#include int bin[1002];int findx(int x){ intr=x; wh
2015-12-18 18:08:36 470
原创 HDOJ 1022 Train Problem I
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1022#include #include #include #include using namespace std;int main(){ chars2[1010],s1[1010]; intpass[1010]; int n; while(scanf("
2015-12-18 18:08:33 386
原创 HDOJ 1015 Safecracker
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1015暴力一点还是可以的....#include #include #include #include #include using namespace std;int f(char a,char b,char c,char d,char e){ charaa[5]={a,b,c
2015-12-18 18:08:31 466
原创 HDOJ 1039 Easier Done Than Sa…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1039只要题目读清楚,1:至少一个元音字母,2:不能有连续三个的元音或辅音字母3:不能有连续相同的两个字母,除(ee,oo)外.......#include #include using namespace std;inline int sew(char c){ if(c=='a'
2015-12-18 18:08:29 345
原创 HDOJ 1020 Encoding
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1020经常WA请进来看看..............就是题目表述有问题:字符算得是相邻的相同的个数eg:如果碰到AABBBCCCABC的话,应该是2A3B3CABC#include #include using namespace std;int main(){ intn,a;
2015-12-18 18:08:26 501
原创 HDOJ 1061 Rightmost Digit
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1061#includeint main(){ int n, m, unit; inta[10][4]={{0,0,0,0},{1,1,1,1},{6,2,4,8},{1,3,9,7},{6,4,6,4},{5,5,5,5},{6,6,6,6},{1,7,9,3},{6,8,4,2},{
2015-12-18 18:08:23 666
原创 HDOJ 2069 Coin Change
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2069一个有着五层循环的.....#include int main(){ int n,d[251] = {0}; int c1, c5,c10, c25, c50; for (n = 0;n for (c50 = 0; c50 * 50
2015-12-18 18:08:21 514
原创 HDOJ 2700 Parity
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2700‘e'代表偶校验,使串中’1‘的个数为偶数个’o'代表奇校验,使串中‘1’的个数为奇数个#include #include using namespace std;int main(){ inta,b; strings; while(cin>>s&&s!=
2015-12-18 18:08:18 364
原创 HDOJ 2568 前进
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2568#include #include using namespace std;int main(){ intT,n,sum; cin>>T; while(T--) { sum=0; cin>>n; while(n
2015-12-18 18:08:16 281
原创 HDOJ 2567 寻梦
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2562#include #include using namespace std;int main(){ int T; stringstr1,str2; cin>>T; while(T--) { cin>>str1>>str2;
2015-12-18 18:08:13 299
原创 HDOJ 2562 奇偶位互换
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2562#include #include using namespace std;int main(){ int T; chartemp; strings; cin>>T; while(T--) { cin>>s;
2015-12-18 18:08:10 328
原创 HDOJ 2561 第二小整数
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2561#include #include using namespace std;int main(){ intT,n; cin>>T; while(T--) { cin>>n; int a[n]; for(int
2015-12-18 18:08:08 382
原创 HDOJ 2551 竹青遍野
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2551#include #include int main(){ intT,n,i; scanf("%d",&T); while(T--) { scanf("%d",&n); for(i=1;i {
2015-12-18 18:08:05 463
原创 HDOJ 2550 百步穿杨
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2550#include #include using namespace std;struct shot{ intA,B; strings;}ca[55];int cmp(const void *a,const void *b){ shotaa=*(const
2015-12-18 18:08:03 274
原创 HDOJ 2549 壮志难酬
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2549#include using namespace std;int main(){ intT,n,i; strings; cin>>T; while(T--) { int flag=0; cin>>s>>n;
2015-12-18 18:08:00 357
原创 HDOJ 2548 两军交锋
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2548#include int main(){ int T; doubleu,v,w,l; scanf("%d",&T); while(T--) scanf("%lf%lf%lf%lf",&u,&v,&w,&l),printf("%.3lf\n",l*
2015-12-18 18:07:57 359
原创 HDOJ 2500 做一个正气的杭电人
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2500#include int main(){ int z, n, i,j; scanf("%d",&z); while (z--!= 0) { scanf("%d", &n); for(i=0; i {
2015-12-18 18:07:54 378
原创 HDOJ 1847 Good Luck in CET-4 E…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1847一道简单的找规律的题,也属于博弈问题的一种,,,,#include using namespace std;int main(){ int n; while(cin>>n) n%3?cout return0;}
2015-12-18 18:07:52 434
原创 HDOJ 1846 Brave Game
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1846这是一道简单的博弈问题,找出规律即可,数字n,m第一次如果石子n<m的话,Firstwin。只要石子每次比m的倍数多一个的话第一个人无论怎么取,给第二个人留下的总能被取玩,,,,#include using namespace std;int main(){ intT,n,m;
2015-12-18 18:07:49 494
原创 HDOJ 1028 Ignatius and the Pri…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1028 简单的整数拆分问题,题解分析请见:http://blog.sina.com.cn/s/blog_9635e5ef01016vyn.html#include #include #include #define N 130int n[N][N];void init(){ int
2015-12-18 18:07:46 607
原创 整数拆分问题
1 = 1; 2 = 2;2 = 1 + 1; 3 = 3;3 = 2 + 1;3 = 1 + 1 + 1; 4 = 4;4 = 3 + 1;4 = 2 + 2;4 = 2 + 1 + 1;4 = 1 + 1 + 1 + 1; 5 = 5;5 = 4 + 1;5 = 3 + 2:5 = 3 + 1 + 1;5 = 2 + 2 + 1;5 = 2 + 1 +
2015-12-18 18:07:44 625
原创 HDOJ 2081 手机短号
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2081#include #include int main(){ int T; chara[11]; scanf("%d",&T); while(T--) { scanf("%s",a); printf("6");
2015-12-18 18:07:42 535
原创 HDOJ 2072 单词数
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2072C语言的方式,gets()读入空格#include#include#define N 10000char article[N],tmp[101],word[N][101];int main(){ intlen,pos,k,cnt; while(gets(article
2015-12-18 18:07:39 393
原创 HDOJ 2025 查找最大元素
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2025#include #include int main(){ intlen; chara[105],p; while(scanf("%s",a)!=EOF) { len=strlen(a); p=a[0]; fo
2015-12-18 18:07:36 316
原创 HDOJ 2024 C语言合法标识符
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2024主要判断第一个字母,和中间的字母是否由字母,数字,下划线组成#include #include int main(){ intT,flag; chara,temp; scanf("%d",&T); temp=getchar(); while(T--
2015-12-18 18:07:34 377
原创 HDOJ 2016 数据的交换输出
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2016#include #include #define SWAP(A,B) {int T;T=A;A=B;B=T;}int main(){ int n; intmin,local,a[105]; while(scanf("%d",&n),n) {
2015-12-18 18:07:31 444
原创 HDOJ 2014 青年歌手大奖赛_评…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2014#include #include int main(){ int n; floatmax,min,sum,a[105]; while(scanf("%d",&n)!=EOF) { sum=0; for(int i=0;i
2015-12-18 18:07:29 341
原创 HDOJ 2013 蟠桃记
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2013简单题,直接找规律.....#include #include int main(){ intn,sum; while(scanf("%d",&n)!=EOF) { sum=1; for(int i=1;i s
2015-12-18 18:07:27 406
原创 HDOJ 2012 素数判定
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2012想想应为要测试多组数据,使用素数表还是比较好点#include #include #define SWAP(A,B) {int T;T=A;A=B;B=T;}bool p[3000];void prime(){ memset(p,false,sizeof(p)); for
2015-12-18 18:07:24 299
原创 HDOJ 2007 平方和与立方和
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2007#include int main(){ intn,m,k,d,temp; while(scanf("%d%d", &n,&m) !=EOF) { k=0; d=0; if(n>m) {
2015-12-18 18:07:22 302
原创 HDOJ 2005 第几天?
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2005只要知道什么是闰年就可以....能被4整除,不能被100整除,但能被400整除。#include int r[12]={31,29,31,30,31,30,31,31,30,31,30,31};int p[12]={31,28,31,30,31,30,31,31,30,31,30,31};
2015-12-18 18:07:19 383
原创 HDOJ 2004 成绩转换
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2004记得这是刚刚学习C++时候,学习while循环编的....#include int main(){ int n,k; while(scanf("%d", &n) != EOF) { if(n 100) printf("Score
2015-12-18 18:07:17 374
原创 HDOJ 1019 Least Common Multipl…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1019简单题,直接求最小公倍数就可以#include #include int gcd(int a,int b){ return!b?a:gcd(b,a%b);}int lcm(int a,int b){ return a/gcd(a,b)*b;}int main(){
2015-12-18 18:07:15 555
原创 HDOJ 1017 A Mathematical Cur…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1017水题,没有其它巧妙的办法,直接来做就可以,,问题是题目要读清楚,输出格式伤不起......#include int main(){ intnumber,n,m,e,sum,flag=0; scanf("%d",&number); while(number--)
2015-12-18 18:07:12 1288
原创 HDOJ 1013 Digital Roots
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1013#include #include #include int root(int a){ int t=0; while(a>9) { t+=a; a=(a-a)/10; } if(t+a>9) t=root(t+a);
2015-12-18 18:07:10 381
原创 HDOJ 1012 u Calculate e
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1012注意一下中间数据的保存,和最后结果的输出...#include int main(){ printf("ne\n"); printf("------------\n"); printf("01\n"); printf("12\n"); print
2015-12-18 18:07:07 513
原创 HDOJ 1016 Prime Ring Problem
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1016题解:素数环:由1到n个数构成一个环,其中环内任意2个相邻的数字之和是素数。 比较经典的搜索题,由于n#include #include using namespace std;const int MAXN = 41;bool visit[MAXN];int n,p[MAXN]
2015-12-18 18:07:05 759
原创 HDOJ 2181 哈密顿绕行世界问题
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2181有两种代码,感觉都挺好的#include #include using namespace std;const int MAXN = 23;bool visit[MAXN];int n,g,p[MAXN][3],pas[MAXN];void dfs(int c,int cnt){
2015-12-18 18:07:02 390
原创 HDOJ 1181 变形课
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1181#include#include #includeusing namespace std;struct{ charbeg; charend;}M[101];bool hash[101],f;int N;bool DFS(char ch){ if(ch
2015-12-18 18:07:00 517
原创 HDOJ 1350 Robot Motion
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1035这几天学习搜索,只能做一些简单的水题....#include #include char map[12][12];int visit[12][12];int main(){ charp,local; inta,b,c,M,N,sum; while(1)
2015-12-18 18:06:57 359
tonic-refs_heads_master.tar.gz
2019-08-09
微信webview唤起外部客户端接入说明2018版
2019-02-21
gradle_2.0.0-instant-run源码
2018-05-10
BinaryTree二叉树操作相关代码
2017-10-19
IntelliJ IDEA入门图文教程整理(全部)
2016-10-17
动态绘制图片
2014-07-23
NotificationDemo
2014-07-16
FTP套接字编程
2014-04-23
Windows平台简单socket编程
2014-03-27
内排序算法比较
2013-03-14
activity绑定Service成功时ServiceConnection的回调问题?
2017-06-30
TA创建的收藏夹 TA关注的收藏夹
TA关注的人