上一页 1 ··· 106 107 108 109 110 111 112 113 114 ··· 182 下一页
摘要: 不明白为什么电话号码第一个数字不能是0,如果是0就是impossible简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 1000005int f[maxn];char st[maxn];int main(){ //freopen("t.txt", "r", stdin); int t = 1; while (1) { sc 阅读全文
posted @ 2011-07-14 19:42 undefined2024 阅读(216) 评论(0) 推荐(0)
摘要: BigInteger的构造函数BigInteger(string, base)可以用来进行进制转换,把base进制转为10进制。输出时BigInteger.toString(base)是把10进制数按base进制输出。View Code importjava.io.*;importjava.util.*;importjava.math.*;publicclassMain{publicstaticvoidmain(Stringargs[]){Scannercin=newScanner(newBufferedInputStream(System.in));while(true){intb=cin. 阅读全文
posted @ 2011-07-14 15:33 undefined2024 阅读(187) 评论(0) 推荐(0)
摘要: 最短路View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>usingnamespacestd;#defineinf0x3f3f3f3f#definemaxn105intvis[maxn];intcost[maxn][maxn];intlowcost[maxn];intn;voiddijkstra(intbeg){inti,j,min;memset(vis,0,sizeof(vis));vis[beg]=1;for(i=0;i<n;i++) 阅读全文
posted @ 2011-07-14 10:55 undefined2024 阅读(440) 评论(0) 推荐(0)
摘要: 最小生成树View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>usingnamespacestd;#definemaxn55#defineinf0x3f3f3f3fintn,m;intvis[maxn];intlowc[maxn];intcost[maxn][maxn];intprim(){inti,j,p;intminc,res=0;memset(vis,0,sizeof(vis));vis[0]=1;for(i=1;i<n;i++)l 阅读全文
posted @ 2011-07-14 10:21 undefined2024 阅读(191) 评论(0) 推荐(0)
摘要: 递推View Code importjava.io.*;importjava.util.*;importjava.math.*;publicclassMain{publicstaticvoidmain(Stringargs[]){Scannercin=newScanner(newBufferedInputStream(System.in));BigInteger[][]f=newBigInteger[101][3];f[0][0]=newBigInteger("0");f[0][1]=newBigInteger("1");f[0][2]=newBigIn 阅读全文
posted @ 2011-07-14 09:51 undefined2024 阅读(176) 评论(0) 推荐(0)
上一页 1 ··· 106 107 108 109 110 111 112 113 114 ··· 182 下一页