摘要: @(第十三届蓝桥杯省赛C/C++B组) A九进制转十进制 答案是1478 B顺子日期 答案14(如果012算的话) C刷题统计 数据范围1e18,所以不能直接暴力,先取余,再暴力剩下的 #include<bits/stdc++.h> using namespace std; #define rep( 阅读全文
posted @ 2022-04-09 20:01 巴扎嘿~ 阅读(1595) 评论(6) 推荐(4) 编辑
摘要: @(2022牛客寒假算法基础集训营3) 题目链接 前言 本人菜鸡一个,写到一半吃饭去了(不吃饭后面的题也写不出来...),后续会补题 另附官方题解 A 智乃的Hello XXXX 题解 没啥说的直接输出 代码 print("hello ") B 智乃买瓜 题解/思路 使用的算法:简单dp,类似于01 阅读全文
posted @ 2022-01-29 02:17 巴扎嘿~ 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #中国剩余定理 ###acwing 204. 表达整数的奇怪方式 题目描述 给定 2n 个整数 a1,a2,…,an 和 m1,m2,…,mn,求一个最小的非负整数 x,满足∀i∈[1,n],x≡mi(mod ai)。 输入 第 1 行包含整数 n。 第 2…n+1 行:每 i+1 行包含两个整数 阅读全文
posted @ 2021-09-08 20:06 巴扎嘿~ 阅读(86) 评论(0) 推荐(0) 编辑
摘要: #超级快读 namespace fastIO { #define BUF_SIZE 100000 bool IOerror = 0; inline char nc() { static char buf[BUF_SIZE], * p1 = buf + BUF_SIZE, * pend = buf + 阅读全文
posted @ 2021-08-01 13:32 巴扎嘿~ 阅读(62) 评论(0) 推荐(0) 编辑
摘要: #数论模板 ##1.快速幂 模板 int mypow(int a,int b ,int p) { ll ans=1; while(b) { if(b&1) ans=ans*a%p; a=(ll)a*a%p; b>>=1; } return ans%p; } ##2.筛法 ###2.1埃氏筛法 模板 阅读全文
posted @ 2021-07-29 08:30 巴扎嘿~ 阅读(48) 评论(0) 推荐(0) 编辑
摘要: #数论之快速幂 模板: int quick_pow(int a,int b,int P) { int res=1; while(b) { if(b&1) res=(long long)res*a%P; a=(long long)a*a%P; b>>=1; } return res; } 注意运算时可 阅读全文
posted @ 2021-07-29 08:19 巴扎嘿~ 阅读(36) 评论(0) 推荐(0) 编辑