Codeforces Round 964 (Div.4)题解
题目链接 差一道题就ak了,打代码的速度还是慢了点 F时间不够了,于是随便糊了个时间复杂度不对的算法,结果算法对了,少了个预处理然后就TLE了,赛时没有发现 A.A+B Again? 1234567891011#include<iostream>using namespace std;int t , n;signed main(){ cin >> t; while( t -- ){ cin >> n; cout << (n/10)+(n%10) << endl; } return 0;} B.Card Game 直接穷举所有可能性即可 思路不是很难,就看如何实现了 123456789101112131415161718192021222324252627282930#include<iostream>#define int long longusing namespace std;int t ,...
数位板+onenote铅笔橡皮快速切换的实现方式
配置:高漫1060pro + windows11 + onenote(office最新版) 众所周知onenote最新版取消了笔收藏夹这一选项,导致选择画笔很不方便,一般情况下无法使画笔和橡皮快速切换,在一番探索下得到了以下方案 笔者之前使用c++做过控制键鼠点击等程序,但是黑窗口弹出需要一定时间很不方便,在和朋友交流下得到了知道了有一个叫AutoHotkey的编程语言,专门用来进行这样的操作 由上图可以知道切换画笔的操作是Alt+D+G+键盘右键*多次+键盘左键(切回黑色画笔)+Enter 这样就可以编写ahk脚本 12345678910111213141516171819202122232425262728Send {Alt Down}Sleep 50Send {Alt Up}Send {D Down}Sleep 50Send {D Up}Send {G Down}Sleep 50Send {G Up}Send {Right...
CRYTPO 24.8第一周刷题记录
[SWPUCTF 2021 新生赛]crypto3 123456789101112131415161718192021from gmpy2 import *from Crypto.Util.number import *flag = '******************'p = getPrime(512)q = getPrime(512)m1 = bytes_to_long(bytes(flag.encode()))n = p*qflag1 = pow(m1,p,n)flag2 = pow(m1,q,n)print('flag1= '+str(flag1))print('flag2= '+str(flag2))print('n= '+str(n))#flag1=...
Codeforces Round 963 (Div. 2)题解
题目链接 本场比赛应该算是今年我打的第一场算法竞赛,也是NOIP2021结束之后难得发挥出来的比赛。ABC都是比较简单的题,D是二分+dp,比较难想 E最终还是不会,疑似是一个高级dp A.Question Marks 观察样例就能打出来 12345678910111213141516171819202122232425#include<iostream>#include<string>using namespace std;signed main(){ int t;cin >> t; while( t -- ){ string s;int n;cin >> n;cin >> s; int a , b , c , d , e;a = b = c = d = e = 0; for(int i = 0;i < s.length();i ++){ if( s[i] == 'A' ) a ++;...
BUUCTF crypto wp
[NewStarCTF 2023 公开赛道]Rabin’s RSA12345678910111213141516171819from Crypto.Util.number import *from secret import flagp = getPrime(64)q = getPrime(64)assert p % 4 == 3assert q % 4 == 3n = p * qe = 2m = bytes_to_long(flag)c = pow(m,e,n)print('n =', n)print('c =', c)# n = 201354090531918389422241515534761536573# c = 20442989381348880630046435751193745753 Rabin加密算法——一种基于摸平方和模平方根的非对称加密 特点: 同一密文,可能有两个以上对应的明文 破解该体制等价于对大整数的分解 满足 $p\equiv 3\mod4$ 且 $q\equiv 3\mod4$ Rabin密码体制选取...
数论小芝士
欧拉定理:https://oi-wiki.org/math/number-theory/fermat/ 123456789101112131415#[LitCTF 2023]Eulerfrom Crypto.Util.number import *from secret import flagm = bytes_to_long(flag)p = getPrime(512)q = getPrime(512)n = p*qc = pow(m,n-p-q+3,n)print(f'n = {n}')print(f'c = {c}')"""n = c = """ $phi = n-p-q+1$,故 $c=m^{phi+2} mod \ n$ ,由欧拉定理可得 $c^{phi}\equiv 1 \ mod n $ 则 $c\equiv m^{2} mod \ n $ 直接开根即可 1234import gmpy2from...
制导镖
...
install crypto in sage of wsl
When I input sudo -pip install pycryptodome It output 12345678910111213141516171819202122root@LAPTOP-LDQVJGQS:/mnt/c/Users/coper# python3 -m pip install --user pipxerror: externally-managed-environment× This environment is externally managed╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m...
hexo usage
hexo s #启动并预览 hexo c #清除缓存文件 db.json 和已生成的静态文件 public hexo g #生成网站静态文件到默认设置的 public 文件夹(hexo generate 的缩写) hexo d #自动生成网站静态文件,并部署到设定的仓库(hexo deploy 的缩写)