03 2018 档案
摘要:1 #include 2 #include 3 4 using namespace std; 5 static const int N = 100; 6 static const int INFTY = (1 q; 14 q.push(s); 15 for (int i = 0;i < n;i++ ) d[i] = INFTY; 16 d[s...
阅读全文
摘要:1 #include 2 #define MAX 5000003 3 #define SENTINEL 2000000000 4 using namespace std; 5 6 int L[MAX / 2 + 2], R[MAX / 2 + 2]; 7 int cnt; 8 9 void merge (int A[], int left, int...
阅读全文
摘要:题目链接 :https://vjudge.net/problem/Aizu-ALDS1_5_A 穷举搜索
阅读全文
摘要:分治法的基本思想:是将一个规模为n的原问题分解为k个规模较小的子问题,这些子问题互相独立且与原问题相同。递归地解这些子问题,然后将子问题的解合并为原问题的解。
阅读全文
摘要:在c++中封装好的stack,queue,list,vector中使用迭代器 定义 如vector<int>::iterator it; 数组用指针,已封装好的结构体用迭代器; lower_bound采用二分搜索; begin():返回指向容器开头的迭代器; end():返回指向容器末尾的迭代器,这
阅读全文
摘要:1 #include 2 #include 3 using namespace std; 4 5 void print(vector V) //输出函数 6 { 7 for (int i = 0;i V; 17 18 V.push_back(0.1); ...
阅读全文
摘要:题目链接:https://vjudge.net/problem/Aizu-ALDS1_3_B
阅读全文
摘要:题目链接 : https://vjudge.net/problem/Aizu-ALDS1_3_A 注 :刚学STL就用STL写了,STL还是很方便的
阅读全文
摘要:题目 :给出一组数,删除第一并作为第一位,下一个放置数列尾,重复操作,到删除到最后一个数,新数组为密码
阅读全文
摘要:1 #include 2 3 int a[101],n; 4 void quicksort(int left,int right) // 数组的左端和右端 5 { 6 int i,j,temp; //i,j左右两端移动的两个指针 7 if(left > right) return; //多次循环后只剩...
阅读全文
摘要:题目链接 : https://vjudge.net/problem/Aizu-ALDS1_3_C 注 :双向链表
阅读全文

浙公网安备 33010602011771号