Coder

舒心、快乐,比什么都重要

摘要: /* 就是二维变成了三维,模版题。*/#include <iostream> #include <cstring> #include <string> #include <queue> using namespace std; int k,a,b,c,t; int mp[55][55][55]; b 阅读全文
posted @ 2020-03-13 10:26 H123K 阅读(139) 评论(0) 推荐(0) 编辑
摘要: /* 要注意使用优先队列,成功的路有长有短。 */ #include <iostream> #include <cstring> #include <queue> using namespace std; int n,m,sx,sy; char mp[222][222]; bool vis[222] 阅读全文
posted @ 2020-03-12 09:40 H123K 阅读(148) 评论(0) 推荐(0) 编辑
摘要: /* * @Author: LinHaiCheng * @Date: 2020-03-11 11:42:52 * @Last Modified by: mac * @Last Modified time: 2020-03-11 15:04:12 */ #include <iostream> #inc 阅读全文
posted @ 2020-03-11 15:08 H123K 阅读(141) 评论(0) 推荐(0) 编辑
摘要: //Problem B /* BFS找路,判断楼梯状态,如果到达楼提前的步数是奇数 那么便可快速通过楼梯,反之不能 如果使用普通队列可能会出现步数大的结果,或者遍历所有情况再排查最小的情况 优先队列则可以解决该问题,让步数小的排在前,减少麻烦 */ #include <iostream> #incl 阅读全文
posted @ 2020-03-10 22:55 H123K 阅读(164) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-05-03 17:28 H123K 阅读(0) 评论(0) 推荐(0) 编辑
摘要: // 这个排序很简单,只是想加深对于异或运算的理解#include using namespace std; void swap(int a[], int x, int y) { //通过异或运算来进行交换 a[x] = a[x] ^ a[y]; a[y] = a[x] ^ a[y]; a[x] = a[x] ^ a[y]; } int main() { i... 阅读全文
posted @ 2019-05-03 16:34 H123K 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; void insort (int s[], int n) { for (int i = 2; i > a[i]; insort(a, 10); for (int i = 1; i < 11; i++) cout << a[i] << ' '; return 0; } 阅读全文
posted @ 2019-05-03 13:38 H123K 阅读(170) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { int a[100], tmp = 0; for (int i = 0; i > a[i]; for (int i = 0; i a[j + 1]) { tmp = a[j]; a[j] = a[j + 1]; ... 阅读全文
posted @ 2019-05-03 13:16 H123K 阅读(112) 评论(0) 推荐(0) 编辑
摘要: // 不稳定排序#include using namespace std; int main() { int arr[100], tmp; for (int i = 0; i > arr[i]; for (int j = 0; j arr[k]) { tmp = arr[j]; arr[j] = arr[... 阅读全文
posted @ 2019-05-03 13:11 H123K 阅读(81) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; setss; void tmp() { int n, m, t; cin >> t >> n >> m; for (int i = 1; i > s; if (i == m && ss.count(s) == 0) { // count() 用来查... 阅读全文
posted @ 2019-05-01 00:55 H123K 阅读(412) 评论(0) 推荐(0) 编辑