#include<bits/stdc++.h> #define ll long long using namespace std; ll n,m,a,lcm,now; bool flag; void exgcd(ll a,ll b,ll &d,ll &x,ll &y) { if(b==0) { d=... ...
分类:
其他好文 时间:
2019-08-24 16:54:17
阅读次数:
70
ADJ-GRADED 奇怪的;古怪的;不寻常的If you describe someone or something as peculiar, you think that they are strange or unusual, sometimes in an unpleasant way. M ...
分类:
其他好文 时间:
2019-08-18 13:26:28
阅读次数:
79
更新 Archive_Tar Archive_Tar upgrade to Archive_Tar 1.4.3 version,問題就解決了 參考 1. "Remove unneeded by reference on built in fuction" 2. "PHP 7.2 compatibil ...
分类:
系统相关 时间:
2019-08-11 23:25:28
阅读次数:
175
背景 后台基本使用 Amazon 的全家桶(EC2、DynamoDB、S3、Step Fuction 等等)构建。现在需要根据访问者的 IP 确定访问者的国家或地区。 已知: 1. 访问者 IP 2. 一个 "ipdata.csv" 文件,已放置在 S3 的桶 中,格式如下 | ip_from | ...
分类:
编程语言 时间:
2019-08-11 13:15:16
阅读次数:
126
Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minut ...
分类:
其他好文 时间:
2019-08-03 14:22:55
阅读次数:
71
There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two ...
分类:
其他好文 时间:
2019-07-10 16:57:04
阅读次数:
126
分析 汉诺四塔 设 $f[i]$ 表示求解 $i$ 盘四塔的最少步数,设 $d[i]$ 表示求解 $i$ 盘三塔的最少步数: $$ d[i]=2\cdot d[i 1]+1\\ f[i]=\min_{j=1}^{i 1}\left\{2\cdot f[j]+d[i j]\right\} $$ 第二个 ...
分类:
其他好文 时间:
2019-06-15 09:30:03
阅读次数:
88
pro:有一个长度为N的数组a[i],要求选择k[i]>0,使得b[i]=a[i]^k[i]%M中出现的不同数最多。N<=200, M<=1e9; sol:a^x%p的个数的有限的,但是全部求出来再二分匹配显然是不可取的。 但是考虑到二分匹配的特殊性,对于每个a[],最多求min(N,全部)个即可满 ...
分类:
其他好文 时间:
2019-06-11 10:51:56
阅读次数:
109
Codeforces 718 A 题意:给一个小数,问最多取$t$次四舍五入到某一个小数点后的位后这个数最大能到多少。 思路:首先肯定贪心。(但不知道为什么tag上是$dp$ 首先我们找到最靠左的一个大于等于5的数,把它四舍五入到上一位, 然后再不断地往前找到下一个大于等于5的数,再四舍五入到上一位 ...
分类:
其他好文 时间:
2019-05-05 01:15:42
阅读次数:
136
Strange Towers of Hanoi (POJ1958) n个盘子4座塔的Hanoi问题至少需要多少步?(1 $d[n] = 2^n 1$ 1. 前n 1盘子 A B 2. 第n盘子 A C 3. 前n 1盘子 B C n盘4塔:$f[n] = min_{1\leq iB (四塔模式) 2 ...
分类:
其他好文 时间:
2019-04-24 14:46:27
阅读次数:
135