2017ACM-ICPC GuangXi
YancyKahn
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU-6185(Covering)
先暴力打表找规律:#include <iostream>using namespace std;int xx, yy;const int MAXN = 1000;int visit[4][MAXN];int ans;int dis[2][2] = {1, 0, 0, 1};void f(int n){ for(int i = 0; i < 4; ...原创 2018-07-14 19:41:49 · 424 阅读 · 1 评论 -
HDU-6182(A Math Problem)
给定n求满足k^k < n的数的个数, 数据范围 n < 1e18, 应用快速幂.#include <iostream>using namespace std;typedef long long LL;LL qpow(LL x, LL n){ LL result = 1; while(n) { if(n & 1)...原创 2018-07-15 15:43:59 · 377 阅读 · 0 评论 -
HDU-6186(CS Course)
对于and和or运算分别记录一个前缀运算和后缀运算, 去掉k位置值得运算结果就为前缀和后缀的运算结果#include <iostream>using namespace std;const int MAXN = 1e5 + 5;int a[MAXN], andl[MAXN], andr[MAXN], orl[MAXN], orr[MAXN], xora;int ma...原创 2018-07-15 15:51:54 · 476 阅读 · 0 评论 -
HDU-6188(Duizi and Shunzi)
贪心, 优先找对子, 有一种特殊情况1 2 3 3 4 5这种情况优先顺子#include <cstdio>#include <cstring>#include <iostream>using namespace std;const int MAXN = 1e6 + 5;int arr[MAXN];int main() { int n, ...原创 2018-07-15 15:54:07 · 928 阅读 · 0 评论 -
HDU-6187(Destory Wall)
国王要到达每一个点要求图不能有环, 所以按照要求, 去掉墙的数量少, 去掉墙的花费小, 可转化为最大生成树求解#include <algorithm>#include <cstdio>#include <cstring>#include <iostream>using namespace std;const int MAXN = ...原创 2018-07-15 18:28:13 · 360 阅读 · 0 评论 -
HDU-6189(Law of Commutation)
先打表可以发现当 a 为奇数的时候, 结果全为 1当 a 为偶数时: 因为a为偶数, 则a可以表示为 a = 2*k a^b%mod 可表示为: a^b%mod = 2^b * k^ b % 2 ^ n 当b >= n 时, a^b%mod == 0 恒成立 所以就要求满足此式: a^b%mod == b^a%mod == ...原创 2018-07-15 19:09:12 · 366 阅读 · 0 评论
分享