上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 20 下一页
摘要: https://www.luogu.com.cn/problem/P2661 #include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; int fa[maxn]; int cnt,n,a,ans = 0x3f3f3 阅读全文
posted @ 2020-02-28 20:54 Hazelxcf 阅读(100) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1197 #include<bits/stdc++.h> using namespace std; const int maxn = 4e5 + 5; int a, b, n, m, k; int head[maxn], tot, 阅读全文
posted @ 2020-02-28 19:48 Hazelxcf 阅读(164) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1908 归并排序是用来求逆序对的 归并排序的思想就是分治 #include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 5 阅读全文
posted @ 2020-02-28 16:15 Hazelxcf 阅读(156) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1010 刚刚看到这个题时,有点懵,如果说这是个数学题 比如说7,应该先求出7 = 4 + 2 + 1; 即先分解出里面应该有最多的2的个数,然后再往下递推 算出2的多少次幂最接近给出的n; 用原来n的数减去2的幂,如果这个数大于2 阅读全文
posted @ 2020-02-28 15:43 Hazelxcf 阅读(171) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P3386 #include <bits/stdc++.h> using namespace std; const int maxn = 1e3 + 10; int n,m,e,link[maxn][maxn],ans; int us 阅读全文
posted @ 2020-02-28 12:12 Hazelxcf 阅读(141) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P2158 #include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 4e4 + 10; int v[maxn], phi 阅读全文
posted @ 2020-02-27 12:02 Hazelxcf 阅读(258) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1582 #include <bits/stdc++.h> using namespace std; #define int long long int n,k; //取出1的个数 int check(int x){ int c = 阅读全文
posted @ 2020-02-27 11:40 Hazelxcf 阅读(159) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1031 #include <bits/stdc++.h> #define int long long using namespace std; int n,s; int a[105]; signed main() { //freo 阅读全文
posted @ 2020-02-26 17:12 Hazelxcf 阅读(134) 评论(0) 推荐(0)
摘要: https://www.acwing.com/problem/content/1326/ 思路: 枚举起点 正反方向 如果满足.输出 #include <bits/stdc++.h> using namespace std; int n; int g[16][16]; int dx[4] = {-1 阅读全文
posted @ 2020-02-24 19:14 Hazelxcf 阅读(161) 评论(0) 推荐(0)
摘要: 给定一个单链表 L​1​​→L​2​​→⋯→L​n-1​​→L​n​​,请编写程序将链表重新排列为 L​n​​→L​1​​→L​n−1​​→L​2​​→⋯。例如:给定L为1→2→3→4→5→6,则输出应该为6→1→5→2→4→3。 输入格式: 每个输入包含1个测试用例。每个测试用例第1行给出第1个结 阅读全文
posted @ 2020-02-24 00:02 Hazelxcf 阅读(335) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 20 下一页