摘要: 公钥算法的基本数论知识 欧几里得算法 \(\gcd\) \[ \gcd(r_0,r_1)=\gcd(r_0-r_1,r_1) \] c++实现 int gcd(int a,int b) { return b?gcd(b,a%b):a; } python实现 def gcd(a,b) : while 阅读全文
posted @ 2020-08-15 23:59 0xDkXy_DWM 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Educational Codeforces Round 93 (Rated for Div. 2) 题解 A. Bad Triangle 排序之后只用看第一个 第二个 和最后一个元素是否满足条件即可 #include<bits/stdc++.h> using namespace std; #pra 阅读全文
posted @ 2020-08-15 01:33 0xDkXy_DWM 阅读(272) 评论(3) 推荐(1) 编辑
摘要: Codeforces Round #662 (Div. 2) 题解 A. Rainbow Dash, Fluttershy and Chess Coloring 阅读题,题意比较难理解,但是读懂题多画几个例子之后就能发现答案其实就是 ans=n/2+1; #include<bits/stdc++.h 阅读全文
posted @ 2020-08-08 02:22 0xDkXy_DWM 阅读(284) 评论(0) 推荐(1) 编辑
摘要: Codeforces Round #661 (Div. 3) Remove Smallest #include<bits/stdc++.h> using namespace std; #pragma GCC optimize(2) typedef long long ll; typedef unsi 阅读全文
posted @ 2020-08-06 22:23 0xDkXy_DWM 阅读(123) 评论(0) 推荐(0) 编辑
摘要: CF-474D 很多人说是个dp,但其实更多的应该和数学递推关系更大,其实和紫书上的fibonacci数列的递推方法一样 我们先假设k=2,len=5时: 5=1+1+1+1+1(RRRRR) 5=2+1+1+1(WWRRR) 5=1+2+1+1(RWWRRR) 5=1+1+2+1(RRWWR) 5 阅读全文
posted @ 2020-07-11 20:57 0xDkXy_DWM 阅读(127) 评论(0) 推荐(0) 编辑
摘要: A.Required Remainder 传送门 #include<bits/stdc++.h> using namespace std; #pragma GCC optimize(2) typedef long long ll; typedef unsigned long long ull; ty 阅读全文
posted @ 2020-06-29 16:47 0xDkXy_DWM 阅读(185) 评论(3) 推荐(1) 编辑
摘要: A. Donut Shops 题目传送门 水题,就用a * b和c比一下大小就行了,要求买第一种饼干便宜的情况就假设只买一块,比较a和c的大小,求买第二种便宜就比较 a * b和c比大小就行了 #include<bits/stdc++.h> using namespace std; #pragma 阅读全文
posted @ 2020-06-26 04:12 0xDkXy_DWM 阅读(92) 评论(0) 推荐(0) 编辑
摘要: ACTF2020 writeup 所属学校:中南大学 Pwm 不会 Reverse 题目名称 easyalgorithm FLAG: ACTF 大概就先把文件拖进IDA里面反编译一下,看反编译出来的c代码大概就知道是首先判断输入是否为ACTF,然后将花括弧中的字符串赋给dest,然后通过4006A6 阅读全文
posted @ 2020-06-22 01:00 0xDkXy_DWM 阅读(310) 评论(0) 推荐(0) 编辑
摘要: A. Maximum GCD 题目链接 水题,n/2向下取整一定能得到最大的gcd,在此就不证明了(太菜了,不怎么会证,太菜了太菜了。 #include<bits/stdc++.h> using namespace std; const int maxn = 1e5+10; int t, n; in 阅读全文
posted @ 2020-06-22 00:58 0xDkXy_DWM 阅读(105) 评论(0) 推荐(0) 编辑
摘要: A. C+= 题目链接 水题,就每一次用小的加大的,保留大的就行了 具体看代码叭 #include<bits/stdc++.h> using namespace std; int t,a,b,n; int main() { ios::sync_with_stdio(false); cin>>t; w 阅读全文
posted @ 2020-06-20 00:03 0xDkXy_DWM 阅读(66) 评论(0) 推荐(0) 编辑