摘要: 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意 阅读全文
posted @ 2019-11-09 20:24 Hazelxcf 阅读(101) 评论(0) 推荐(0)
摘要: It is winter now, and ... 阅读全文
posted @ 2019-11-03 15:00 Hazelxcf 阅读(73) 评论(0) 推荐(0)
摘要: #includeusing namespac... 阅读全文
posted @ 2019-11-01 22:00 Hazelxcf 阅读(195) 评论(0) 推荐(0)
摘要: time limit per test:2 ... 阅读全文
posted @ 2019-10-27 20:19 Hazelxcf 阅读(224) 评论(0) 推荐(0)
摘要: 青蛙的约会 设跳k次,能遇到一起,说明到了同一个点,(x + k * m) = (y + k * n) (mod l), k *(n - m) = (x - y) (mod l) k * (n - m) + t * l = x - y; 令a = n - m; x = k; y = t; b = l 阅读全文
posted @ 2019-10-15 19:44 Hazelxcf 阅读(139) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int phi[maxn]; void euler() { for (int i = 2; i < maxn; i++) { if (!phi[i]) { 阅读全文
posted @ 2019-09-02 07:51 Hazelxcf 阅读(123) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; vector<int> G[maxn]; int DFN[maxn], LOW[maxn], index, cnt; int ans[maxn], belo 阅读全文
posted @ 2019-08-13 10:53 Hazelxcf 阅读(99) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1022 #include<cstdio> #include<cstring> using namespace std; double num=0,x=0;//num是数字之和,x为系数之和 char c,p;//c被用作读入每一个 阅读全文
posted @ 2019-08-08 10:28 Hazelxcf 阅读(74) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1464 记忆化搜索就是记录之前程序走过的, 当再次走到的时候 直接取出来即可 这个题 由2可以确定下来要将20步以内的状态记录下来 #include <bits/stdc++.h> using namespace std; int 阅读全文
posted @ 2019-08-07 14:22 Hazelxcf 阅读(101) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1149先把所有的数表示出来 #include <cstdio> #include <iostream> using namespace std; int b[1000] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 阅读全文
posted @ 2019-08-02 17:14 Hazelxcf 阅读(68) 评论(0) 推荐(0)