
数论/思维
文章平均质量分 91
VigiIante
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #529 (Div. 3) C. Powers Of Two题解及思路
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ivan wants to play a game with you. He picked some string ss of length nn consis...原创 2018-12-28 21:15:55 · 237 阅读 · 0 评论 -
Codeforces Round #554 (Div. 2) Problem B. Neko Performs Cat Furrier Transform
https://codeforces.com/contest/1152/problem/B 大致思路是找到二进制n的第一个0, 然后模拟,与位操作有关 #include<algorithm> #include <iostream> #include <sstream> #include <cstring> #include <cst...原创 2019-04-26 09:46:52 · 150 阅读 · 0 评论 -
同余定理【数论】
转载传送门:https://blog.youkuaiyun.com/qq_36345036/article/details/77407069 同余定理是数论中的重要概念。给定一个正整数m,如果两个整数a和b满足(a-b)能够被m整除,即(a-b)/m得到一个整数,那么就称整数a与b对模m同余,记作a≡b(mod m)。 同余符号 两个整数a、b,若它们除以整数m所得的余数相等,则称a与b对模m同余或a同余...转载 2019-04-26 17:40:11 · 573 阅读 · 0 评论 -
Codeforces Round #402 (Div. 2)题解
A. Pupils Redistribution https://codeforces.com/contest/779/problem/A 题意就是把数字1到5平均分到两个班内,题水但是判定容易出BUG #include<bits/stdc++.h> using namespace std; constexpr int maxl = 6; int numa[maxl], num...原创 2019-06-04 10:52:09 · 306 阅读 · 0 评论 -
矩阵快速幂中矩阵的构造
其实快速幂和矩阵快速幂是异曲同工,但是往往构造矩阵是难点,转载一个别人博客写的矩阵构造方法: Fibonacci数列:F(0)=1 , F(1)=1 , F(n)=F(n-1)+F(n-2) 我们以前快速求Fibonacci数列第n项的方法是 构造常系数矩阵 (一) Fibonacci数列f[n]=f[n-1]+f[n-2],f[1]=f[2]=1的第n项快速求法(不考虑高精度) ...转载 2019-07-07 18:51:44 · 229 阅读 · 0 评论 -
Codeforces Round #567 (Div. 2) B. Split a Number题解
B. Split a Number time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Dima worked all day and wrote down on a long paper strip his fa...原创 2019-07-02 16:25:05 · 349 阅读 · 0 评论