数论
文章平均质量分 56
Phantom_matter
庸俗的博主。
展开
-
codeforces 1594b
https://codeforces.com/problemset/problem/1594/B 思路:第KKK个数可以用二进制表示,那么这个二进制对应的基数NNN就是第KKK大的数。 #include<bits/stdc++.h> using namespace std; // clock_t start, end; // start = clock(); // end = clock(); // cout原创 2021-10-15 09:34:59 · 155 阅读 · 0 评论 -
codeforces-1594e1
https://codeforces.com/problemset/problem/1594/E1 一道很简单的题,但是模运算的时候出错了,想当然的把4N4^ N4N中的NNN取模了。在此记录一下: #include<bits/stdc++.h> using namespace std; // clock_t start, end; // start = clock(); // end = clock(); // cout << (double) (end原创 2021-10-14 19:08:19 · 77 阅读 · 0 评论 -
洛谷 进制转换
https://www.luogu.com.cn/problem/P1017 题意:给一个十进制数,转换成负进制数。 思路:对于余数为负的情况,考虑借位。 #include<bits/stdc++.h> using namespace std; // clock_t start, end; // start = clock(); // end = clock(); // cout << (double) (end - start) / CLOCKS_PER_原创 2021-10-11 09:10:33 · 219 阅读 · 0 评论 -
数论总结XXXX
https://blog.csdn.net/qq_17080419/article/details/98320343?utm_source=app&app_version=4.14.1&utm_source=app原创 2021-09-23 11:29:29 · 109 阅读 · 0 评论 -
2020 icpc 沈阳 i题 Rise of Shadows
题意: 一天有HHH小时,一小时有MMM分钟。 问有多少整数分钟满足时针和分钟的夹角小于A×2πH×M\dfrac{A\times 2\pi}{H\times M}H×MA×2π 很明显的可以列出等式: t×(H−1)≤A(modHM)t\times (H-1)\le A\pmod{HM}t×(H−1)≤A(modHM) ...原创 2021-09-23 11:20:31 · 871 阅读 · 3 评论 -
数论学习中 持续更新。。。快速幂,概率dp,期望dp
快速幂取模的板子题: https://www.luogu.com.cn/problem/P1226 #include <bits/stdc++.h> using namespace std; #define int long long const int maxn=2e3; const int INF=1e12; double dp[maxn][maxn]; int k; int fastpow(int a,int n){ int base=a,res=1; while(n){原创 2021-05-05 16:26:37 · 114 阅读 · 0 评论