随笔分类 -  算法笔记

摘要:Hash(散列函数) Hash,一般翻译做“散列”,也有直接音译为“哈希”的,就是把任意长度的输入(又叫做预映射pre-image)通过散列算法变换成固定长度的输出,该输出就是散列值。这种转换是一种压缩映射,也就是,散列值的空间通常远小于输入的空间,不同的输入可能会散列成相同的输出,所以不可能从散列 阅读全文
posted @ 2018-11-14 11:56 do+better 阅读(171) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <cmath> #include <cstring> #include <cstdio> #include <iostream> #include <algorithm> using namespace std; int a[11]; int 阅读全文
posted @ 2015-03-20 21:11 do+better 阅读(202) 评论(0) 推荐(0)
摘要:链接 :http://codeforces.com/contest/520/problem/B code forces two buttens代码 ********************* #include <stdio.h>int main(){ int s,g,r=0; scanf("%d%d 阅读全文
posted @ 2015-03-20 21:03 do+better 阅读(200) 评论(0) 推荐(0)
摘要:#include <cmath>#include <iostream>using namespace std;int main(){ int x = 2; int y = 3; cout << "2*2*2 = " << pow(x,y) << endl; return 0;} 阅读全文
posted @ 2015-01-27 13:22 do+better 阅读(7216) 评论(0) 推荐(0)
摘要://第一种写法 #include <stdio.h> int main(){ int a[100], T, n = 0; char ch; for(scanf("%d ", &T); T; T--){ n = 0; char ch; while((ch = getchar()) != '\n'){ 阅读全文
posted @ 2015-01-27 10:56 do+better 阅读(305) 评论(0) 推荐(0)
摘要:#include <iostream> #include <algorithm> using namespace std; int main(){ int a[3]={1, 2, 3}; do{ for (int i = 0; i < 3; i++) cout<<a[i]; cout<<endl; 阅读全文
posted @ 2015-01-26 13:12 do+better 阅读(118) 评论(0) 推荐(0)