上一页 1 ··· 151 152 153 154 155 156 157 158 159 ··· 182 下一页
摘要: 简单题,注意判断0View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;int main(){ //freopen("t.txt", "r", stdin); int t; scanf("%d", &t); while (t--) { int a, b; scanf("%d%d& 阅读全文
posted @ 2011-05-17 12:56 undefined2024 阅读(167) 评论(0) 推荐(0)
摘要: 高精度递推,用javaView Code import java.util.*;import java.io.*;import java.math.*;public class Main { static public void main (String[] args)throws FileNotFoundException { Scanner cin = new Scanner(new BufferedInputStream(System.in)); //Scanner cin = new Scanner(new FileInputStream("t.txt")); Bi 阅读全文
posted @ 2011-05-17 12:35 undefined2024 阅读(258) 评论(0) 推荐(0)
摘要: trie树。这题学会的:1.strtok(char * st1, char*st2)用st2分割st1,损坏原串,返回分割后的第一个串的指针,想获得被分割的第二个串则需要调用第二次,并且第一个参数给NULL2.unget(ch, stdin);可以把读到的字符ch放回到输入文件中去。相当于getchar()的你过程。3.树状结构频繁开辟指针空间浪费时间,可以直接开辟节点数组,并让指针指向数组中的未使用位。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <c 阅读全文
posted @ 2011-05-16 19:51 undefined2024 阅读(612) 评论(0) 推荐(0)
摘要: 简单dpView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int main(){ //freopen("t.txt", "r", stdin); int t; scanf("%d", &t); while (t--) { int a, b, c, d, e, f, g, h, n, fun[1005]; scanf(" 阅读全文
posted @ 2011-05-16 18:50 undefined2024 阅读(125) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxl 50char w1[maxl], w2[maxl];int f1[26], f2[26];void work(char *w, int *f){ int len = strlen(w); for (int i = 0; i < len; i++) f[w[i] - 'a']++;}int ma 阅读全文
posted @ 2011-05-16 16:50 undefined2024 阅读(173) 评论(0) 推荐(0)
上一页 1 ··· 151 152 153 154 155 156 157 158 159 ··· 182 下一页