水题
Healer66
他是谁啊?他究竟是什么身份啊?
展开
-
Gym - 101611D - Decoding of Varints( 爆unsigned 的水题)
链接: https://odzkskevi.qnssl.com/9c253207c02c61937a00eb712e34af9b?v=1536825252 题意: x = (b0 - 128)·2^0 + (b1 - 128)·2^7 + (b2 - 128)·2^14 + ... + (bm - 2 - 128)·2^7·(m - 2) + bm - 1·2^7·(m - 1) 对于上式...原创 2018-09-19 22:29:39 · 441 阅读 · 0 评论 -
Gym - 101502B - Linear Algebra Test
/* 求匹配数,遍历必定超时, 需要预先存一下相应行的数量, 最后对应每个列,找相等的行即可; 因为已知行不等于列,所以不必考虑特殊情况 */ #include <iostream> #include <map> using namespace std; int t,n,a[2][100005]; unsigned long long ans; map&...原创 2019-01-29 08:46:17 · 264 阅读 · 1 评论 -
Gym - 100781G- Goblin Garden Guards
/* 对于每个喷洒点,遍历这个圆的外切正方形内的所有点 */ #include <iostream> #include <cstdio> #include <cmath> using namespace std; const int maxn = 1e5+10; const int N = 1e4 + 10; struct Point { int...原创 2019-01-31 22:59:34 · 248 阅读 · 0 评论 -
HDU - 6308 - Time Zone
题意: 给出UTC+8的小时a和分钟b,求 "UTC+X'', "UTC-X'', "UTC+X.Y'', or "UTC-X.Y''的日期。 思路: 转成分钟计算 #include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { int t, h, m; char...原创 2019-01-19 11:01:34 · 156 阅读 · 0 评论 -
HDU - 6300 - Triangle Partition (水题)
题意: 给出3n个点,保证任意三个不共线,用这3*n给点构成三角形,输出每个三角形用哪几个点 思路: 按横坐标排序,逐个输出即可 #include <iostream> #include <algorithm> #include <cstdio> using namespace std; struct Node { int x,y; i...原创 2019-01-19 10:29:10 · 243 阅读 · 0 评论 -
HDU - 6298 - Maximum Multiple (规律)
题意: 给出n ,求使n = x + y + z 且 x,y,z都是n的因子且x*y*z最大的值 “|”这个符号指的是因子 思路: 1/3 + 1/3 + 1/3 = 1; 1/2 + 1/4 + 1/4 = 1; 另1/3 + 1/2 + 1/6 = 1 也符合条件但是可以整合在第一种情况中,因为是6的倍数则必然是3的倍数 所以满足条件的n必是3或4的倍数 #include &...原创 2019-01-19 10:09:35 · 161 阅读 · 0 评论 -
Kattis - missinggnomes- D - Missing Gnomes (水题)
链接: https://vjudge.net/contest/265795#problem/D 题意: 给出一个序列,问在1-n的全排列中,第一次出现当前序列时的序列是? 代码: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5+10; int a[maxn]; int vis[maxn]...原创 2018-10-27 18:20:17 · 370 阅读 · 0 评论 -
Gym - 101670 H - Dark Ride with Monsters (水题&&思路)
链接: https://vj.e949.cn/889526602f1f7ab5e44d789392754748?v=1539700753 题意: 求最少交换次数,使得一排列成为升序。 思路:从头遍历,位置不对就交换即可。 #include <iostream> #include <cstring> using namespace std; const int m...原创 2018-10-27 09:33:27 · 214 阅读 · 0 评论 -
HDU - 5533 G - Dancing Stars on Me (水题&&几何)
链接: http://acm.hdu.edu.cn/showproblem.php?pid=5533 题意: 给出n个点,坐标全是整数,问能否构成一个正多边形。 思路: 看了题解才发现自己想多了。坐标是整数的正多边形其实只有正方形。 以前的思路是,对于所有点,找距离它最远的点,只要最远的距离全部一样,就是正多边形,这个应该是个广泛的特点。 自己的做法: #include &...原创 2018-10-28 20:48:41 · 161 阅读 · 0 评论 -
HDU - 6235 - Permutation (模拟&&水题)
链接: https://vjudge.net/contest/253412#problem/F 题意: 1-n的全排列中满足 pi%(|pi-pi-2|)==0 的一项 思路: 奇数列和偶数列分别都是递增的自然数就行 #include <bits/stdc++.h> using namespace std; const int maxn = 1e6; int a[ma...原创 2018-09-12 20:25:14 · 179 阅读 · 0 评论 -
Gym - 101612B - Boolean Satisfability(字符串&&思路&&水题)
链接: https://odzkskevi.qnssl.com/76ee6a37a5e7b6e0a1da0f46372ab4da?v=1536788434 题意: 给出逻辑表达式,问你有多少种赋值能够使得使其值为真(只有 字母 和 ~ 和 | 三种字符) 思路: 只要所有字母只出现一次,答案就是2^n-1,因为只有一种成假赋值 再者,只要有一个字母同时有取反和本身,那么答案就为2^n...原创 2018-09-19 08:57:45 · 228 阅读 · 0 评论 -
POJ - 1696 - Space Ant (极角排序)
思路: 先找左下点,然后排序找其右下第一个点,重复即可 #include <iostream> #include <cmath> #include <algorithm> using namespace std; const double eps = 1e-8; int pos; int sgn(double x) { if(fabs(x) <...原创 2019-04-17 20:18:21 · 283 阅读 · 0 评论