前言
2026.08.03-2026.08.17,我将记录暑假集训的做题记录和日常生活。
时间:
- 上午 08:30-11:30。
- 下午 13:00-16:00。
整个集训:全天做题,独立 AC。
谨记:账号不退登,机惨两行泪。
集训帮助
文件传输 这个就是机房禁 U 盘拿它代传课件。
代码框架
#include"bits/stdc++.h"
#define AC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define m(a) memset((a),0,sizeof(a))
using namespace std;
using ll=long long;
/*
思路:\
*/
const int MAXN=1e5+5;
int a[MAXN];
int n;
int main(){
return 0;
}快读
ll read(){
ll x=0,flag=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-')flag=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9'){
x=x*10+ch-'0';
ch=getchar();
}
return x*flag;
}快写
void print(ll x){
if(x<0){putchar('-');x=-x;}
if(x>=10)print(x/10);
putchar('0'+x%10);
}Day ? 07.31-08.02
看 B 班人似乎比我想象的多?我以为大家都去 A 班了。
听说机房空调又坏了(去年好像也坏了哈哈),08.03 大概率不在四中上,在四中对面。
不知道食堂会不会开。大概率吃盒饭吧,希望蒋老师不要再点绿色盲盒了。
Day 1 08.03
快速幂
其中 为底数(base), 为指数(exp).
性质:
- .
- .
1.二分思想
利用性质 1。
- 当 时,.
- 当 时,.
- 当 时,.
由此可递归:
ll ksm(ll a,ll b,ll p){
if(b==0)return 1;
ll half=ksm(a,b/2,p);
if(b%2)return half*half*a%p;
return half*half%p;
}但据说因为神秘原因不能 AC?
2.二进制拆分
.
由此可步步迭代 :
ll ksm(ll a,ll b,ll p){
ll sum=1;
while(b){
if(b&1)sum=sum*a%p;
a=a*a%p;
b>>=1;
}
return sum;
}拓展
小数点第 位
逆元
矩阵快速幂
龟速乘
ll gsc(ll a,ll b,ll p){
ll sum=0;
while(b){
if(b&1)sum=(sum+a)%p;
a=(a+a)%p;
b>>=1;
}
return sum;
}前缀和差分没啥好说的,中规中矩。
在机房能绷住也是神人了。鬼知道我今天说了多少句“受不了了”。
拜谢同桌 zws 大佬 %%%。
食堂中规中矩,就是贯通班伙食。
夏老师讲的很有意思,听懂了。就是快速幂强度有点大,做题时间有点紧,