码迷,mamicode.com
首页 >  
搜索关键字:ans    ( 3741个结果
poj 1780 欧拉回路构造字符串
和西安邀请赛D题类似的题目 这道题会爆栈,所以要非递归写,但是看了很久其实代码没理解,回头重写 #include #include #include using namespace std; const int SIZE = 100000+10; int a,s; int sta[SIZE*10],li[SIZE*10]; char ans[SIZE*10]; void s...
分类:其他好文   时间:2014-07-27 11:29:42    阅读次数:160
UVALive 5962 Strongly Connected Chemicals --最大独立集
题意:给n个阳离子和m个阴离子,并给出相互的吸引关系,求一个最大的点集,使其中的每个阴阳离子相互吸引。解法:枚举每条边,使该条边存在,然后建立反图,求一个最大匹配,此时的点数减去最大匹配与ans求一个最大值即可。代码:#include #include #include #include #incl...
分类:其他好文   时间:2014-07-27 10:51:22    阅读次数:333
HDU 1864 最大报销额
注意数组的大小,以及字符的输入问题 #include #include int dp[4000000],a[4],money[400]; char s[120]; double str[120]; int max(int a,int b) {return a>b?a:b;} int main() { int N,sum,ans,ok,count,i,j,num; double Q...
分类:其他好文   时间:2014-07-26 02:38:26    阅读次数:253
POJ 1011 Sticks
DFS 题意是让你把这些木棍组合成长度相等的一些木棍。要求长度最短。 #include #include #include #include using namespace std; int a[65],n,sum,ans; bool v[65],ok; bool cmpa(int a,int b) { return a>b; } bool dfs(int num,int ne...
分类:其他好文   时间:2014-07-26 02:37:26    阅读次数:130
UVa1586,Molar Mass
#include #include #include using namespace std;int main(){double c,h,o,n;int t,i,j;cin>>t;getchar();double ans;char s[100];while (t-->0){gets(s);c=0;h...
分类:其他好文   时间:2014-07-26 01:47:46    阅读次数:248
UVa1585 Score
#include #include #include using namespace std;int main(){ char s[100]; int i,j,n,ans; cin>>n; getchar(); while (n>0) { n--; ...
分类:其他好文   时间:2014-07-26 01:46:56    阅读次数:221
C++ int转string
不论是过去写的这个转换方法,还是今天看到的这个:string cvt2str( int x ){ int d = x; string ans = ""; while( x > 0 ) { d = x%10; ans = char(d+'0')+an...
分类:编程语言   时间:2014-07-25 16:40:51    阅读次数:217
ACDream - Lowbit Sum
先上题目:C-Lowbit SumTime Limit:2000/1000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatusProblem Descriptionlong long ans = 0;for(int...
分类:其他好文   时间:2014-07-25 14:00:01    阅读次数:197
暑期多校 第一场
A:描述:代码: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int k,p; 8 int a[104]; 9 //void solve(){10 // int ans=0;11 // ...
分类:其他好文   时间:2014-07-25 02:37:54    阅读次数:258
hdu 4217Data Structure?
树状数组+二分 就是找第几小的数,,找几次,再求和。。 #include #include #include #include #include using namespace std; const int N=277777; int t,n,m,bit[N],num,i; long long ans; int low(int g) { return g&(-g); } void up...
分类:其他好文   时间:2014-07-24 23:29:33    阅读次数:266
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!