X-man

导航

上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 59 下一页

2013年5月7日 #

爱情测试

摘要: http://ch.vijos.org/Contest/%E7%99%BD%E8%89%B2%E6%83%85%E4%BA%BA%E8%8A%82%E6%AC%A2%E4%B9%90%E8%B5%9B%20-%20Day1(Easy)/Problem/Show/%E7%88%B1%E6%83%85%E6%B5%8B%E8%AF%95#include<stdio.h>const long long mod=100007;long long multy(long long q, long long n){ long long cnt = n; long long base = q; . 阅读全文

posted @ 2013-05-07 21:52 雨钝风轻 阅读(222) 评论(0) 推荐(0) 编辑

2013年5月5日 #

擅长排列的小明

摘要: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=113题意: 从1~m的m个数中选出n(nint n,m, a[10];bool bz[10];//标记数字是否已经被用过int DFS(int k){ if (k==n)//搜出来的长度等于要求的长度,输出该序列,由于是从小到大搜索的所以输出的时候也是从小到大的 { for (int i=0; i<n; i++) printf("%d",a[i]); printf("\n"); } else//不等于要求的长度,继... 阅读全文

posted @ 2013-05-05 22:45 雨钝风轻 阅读(205) 评论(0) 推荐(0) 编辑

2013年5月4日 #

ZOJ DNA Sorting

摘要: #include<stdio.h>#include<vector>#include<string>#include<iostream>#include<algorithm>using namespace std;vector<string>v;string s;bool cmp(string a,string b){ int al=0,bl=0; for(int i=0;i<a.size();i++) for(int j=i+1;j<a.size();j++) if(a[j]<a[i])al++; for 阅读全文

posted @ 2013-05-04 16:04 雨钝风轻 阅读(187) 评论(0) 推荐(0) 编辑

2013年5月3日 #

hdu 1239 Calling Extraterrestrial Intelligence Again(数学题)

摘要: 题意及解题思路: 输入m,a,b;输出c,d 满足条件: 1.找出两个质数c,d。(大素数表) 2.满足c*d为不大于m的最大值,(循环判断) 先找最大的d,然后循环找出(m/d条件下)最大的c, 还得在用一次d*c最大的条件,退出循环条件为找到的c》d; 3.并满足 d>=c&&a*d<=b*c(判断条件)#include<stdio.h>#include<math.h>const int M=150000;int a[M];int isprime(){ for(int i=0;i<M;i++) a[i]=i; a[1]=0; f.. 阅读全文

posted @ 2013-05-03 17:04 雨钝风轻 阅读(195) 评论(0) 推荐(0) 编辑

1011: Longest word

摘要: http://acm.cug.edu.cn/JudgeOnline/problem.php?id=1011#include<stdio.h>#include<string>#include<vector>#include<string.h>#include<algorithm>#include<iostream>using namespace std;vector<string>v;vector<string>::iterator it;int main(){ string s,si; char s 阅读全文

posted @ 2013-05-03 15:08 雨钝风轻 阅读(362) 评论(0) 推荐(0) 编辑

hdu 2018 母牛的故事(过程模拟)

摘要: #include<stdio.h>int main(){ int n; int sum; while(scanf("%d",&n)!=EOF&&n!=0) { int a[4]= {1,0,0,0}; int b[4]= {1,0,0,0}; sum=0; for(int i=2; i<=n; i++) { a[0]+=b[1]; a[1]=b[2]; a[2]=b[3]; a[3]=a[0]; ... 阅读全文

posted @ 2013-05-03 10:16 雨钝风轻 阅读(250) 评论(0) 推荐(0) 编辑

2013年5月2日 #

hdu 4268 Alice and Bob(STL贪心)

摘要: 题解: 对Alice和Bob的数据一起排序,再贪Alice离Bob最进的矩形 做了整整一个下午,我晚饭后找了一会,还是没发现, 一筹莫展之际,只有使出杀手锏(求教飞机哥!!!) 正在注释代码准备求助时,终于的发现了坑货的小bug!!!! ( bool cmp()中忘写了return false;以前使用int cmp()) 1。起初是直接查找TLE,各种换数据结构。 2。数组开100005提交,Runtime Error (ACCESS_VIOLATION) 又百度,此错误好像有爆内存的原因(明明就够题目数据量的??)。 3。最... 阅读全文

posted @ 2013-05-02 20:52 雨钝风轻 阅读(212) 评论(0) 推荐(0) 编辑

1511: ADERA

摘要: #include<stdio.h>#include<algorithm>#include<string>#include<vector>#include<deque>#include<list>#include<string.h>#include<set>#include<iostream>using namespace std;string s1,s2,si;struct node{ int ii;//物品编号 int value;//价值 set<string>s;//描 阅读全文

posted @ 2013-05-02 15:20 雨钝风轻 阅读(231) 评论(0) 推荐(0) 编辑

2013年5月1日 #

%的输出

摘要: #include <stdio.h>int main(){int a=90;printf("%d%%\n",a);return 0;}这样就会在屏幕上得到 90% 阅读全文

posted @ 2013-05-01 15:55 雨钝风轻 阅读(288) 评论(0) 推荐(0) 编辑

sort实现vector的多级排序

摘要: #include<stdio.h>#include<vector>#include<string>#include<fstream>#include<algorithm>//include count#include<iostream>using namespace std;vector<string>v;vector<string>::iterator it;bool cmp(string s1,string s2){ if(s1.length()<s2.length())return tr 阅读全文

posted @ 2013-05-01 15:40 雨钝风轻 阅读(359) 评论(0) 推荐(0) 编辑

上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 59 下一页