随笔分类 -  A数论

CERC2017 F: Faulty Factorial 简单数论题
摘要:1 #include 2 using namespace std; 3 #define ll long long 4 const int N = 10000006; 5 ll n,p,r; 6 ll poww(ll a,ll b){ 7 ll ans =1ll; 8 while(b){ 9 if(b&1) ans =ans... 阅读全文

posted @ 2019-04-07 21:45 cltt 阅读(231) 评论(0) 推荐(0) 编辑

数学思想
摘要:L1-046 整除光棍 (20 分) L1-046 整除光棍 (20 分) L1-046 整除光棍 (20 分) 这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 阅读全文

posted @ 2019-03-28 17:35 cltt 阅读(142) 评论(0) 推荐(0) 编辑

数论小常识
摘要:牛客练习赛42 B 题目描述 注意本题有模数 给定一个 长度为 n 的序列 { a } ,求: max1≤i≤j≤n{(ai⊕ai+1⊕⋯⊕aj)+(ai+ai+1+⋯+aj)}mod100000007max1≤i≤j≤n{(ai⊕ai+1⊕⋯⊕aj)+(ai+ai+1+⋯+aj)}mod10000 阅读全文

posted @ 2019-03-16 22:40 cltt 阅读(319) 评论(0) 推荐(0) 编辑

倍数关系
摘要:牛客练习赛33 B tokitsukaze and RPG tokitsukaze最近沉迷一款RPG。这个RPG一天有k分钟,每一天从第1分钟开始。有n种怪物,第i种怪物每天第一次出现的时间为Xi分钟,第二次出现的时间为2*Xi分钟,第三次出现的时间为3*Xi分钟......同一时刻出现的怪物种类越 阅读全文

posted @ 2018-12-07 22:17 cltt 阅读(313) 评论(0) 推荐(0) 编辑

计数原理
摘要://cf 615D D. Multipliers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output //cf 615D D. Mu 阅读全文

posted @ 2018-12-04 12:12 cltt 阅读(270) 评论(0) 推荐(0) 编辑

牛客练习赛29 F 算式子
摘要:链接:https://www.nowcoder.com/acm/contest/211/F来源:牛客网 题目描述 给定 个整数 。保证 。 对于每个 ,求出 。为了避免过量输出,你只需要将所有的 m 个结果异或起来输出。 输入描述: 第一行两个整数 。 第二行 个整数,第 个表示 。 输出描述: 一 阅读全文

posted @ 2018-10-22 21:56 cltt 阅读(162) 评论(0) 推荐(0) 编辑

ACM-ICPC 2018 沈阳赛区网络预赛 K. Supreme Number
摘要:A prime number (or a prime) is a natural number greater than 11 that cannot be formed by multiplying two smaller natural numbers. Now lets define a nu 阅读全文

posted @ 2018-09-08 19:29 cltt 阅读(268) 评论(0) 推荐(0) 编辑

ACM-ICPC 2018 南京赛区网络预赛 J. Sum
摘要:A square-free integer is an integer which is indivisible by any square number except 1. For example, 6 = 2 * 3,6=2*3 is square-free, but 12 = 2^2 * 3, 阅读全文

posted @ 2018-09-06 23:02 cltt 阅读(156) 评论(0) 推荐(0) 编辑

牛客练习赛25
摘要:链接:https://www.nowcoder.com/acm/contest/158/A来源:牛客网 q次询问,每次给一个x,问1到x的因数个数的和。 输入描述: 输出描述: 示例1 输入 复制 4 1 2 3 10 输出 复制 1 3 5 27 说明 1的因数有12的因数有1,23的因数有1,3 阅读全文

posted @ 2018-08-25 10:05 cltt 阅读(221) 评论(0) 推荐(0) 编辑

莫比乌斯算法
摘要://hdu 1695 GCD Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15816 Accepted Submission(s): 6095 阅读全文

posted @ 2018-08-23 22:23 cltt 阅读(461) 评论(0) 推荐(0) 编辑

欧拉函数
摘要:// hdu 6434 ( Problem I. Count ) Problem I. Count Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s 阅读全文

posted @ 2018-08-23 11:50 cltt 阅读(245) 评论(0) 推荐(0) 编辑

容斥定理
摘要:ACM训练联盟周赛 131072K Teemo decides to use his money to conquer the universe. It is known that there are m planets that humans can reach at present. They 阅读全文

posted @ 2018-08-21 16:43 cltt 阅读(259) 评论(0) 推荐(0) 编辑

末尾有几个0
摘要:牛客小白月赛5 D 题目描述 输入描述: 输入数据共一行,一个正整数n,意义如“问题描述”。 输出描述: 输出一行描述答案:一个正整数k,表示S的末尾有k个0 示例1 输入 复制 10 输出 复制 7 说明 鸣谢真·dalao Tyxao 1 ll ans=0; 2 scanf("%d",&n); 阅读全文

posted @ 2018-08-04 23:37 cltt 阅读(377) 评论(0) 推荐(0) 编辑

组合数的几种写法
摘要:1 //数据量较小,1000 2 void C() 3 { 4 c[0][0]=1; 5 for(int i=1;in) return 0; 77 ll ans=1ll; 78 for(ll i=1;i a)return 0; 5 return fac[a] * inv[b] % mod * inv[a - b] % mod;... 阅读全文

posted @ 2018-07-29 19:54 cltt 阅读(2047) 评论(0) 推荐(0) 编辑

hdu 6298
摘要:Maximum Multiple Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1500 Accepted Submission(s): 650 阅读全文

posted @ 2018-07-24 23:59 cltt 阅读(162) 评论(0) 推荐(0) 编辑

E. Massage
摘要: 阅读全文

posted @ 2018-07-24 23:43 cltt 阅读(596) 评论(0) 推荐(0) 编辑

Persona5
摘要:65536K Persona5 is a famous video game. In the game, you are going to build relationship with your friends. You have NN friends and each friends have 阅读全文

posted @ 2018-07-24 23:35 cltt 阅读(542) 评论(0) 推荐(0) 编辑

逆元
摘要:1 https://www.cnblogs.com/linyujun/p/5194184.html a和p互质,a才有关于p的逆元 typedef long long LL;void ex_gcd(LL a, LL b, LL &x, LL &y, LL &d){ if (!b) {d = a, x 阅读全文

posted @ 2018-07-24 15:27 cltt 阅读(183) 评论(0) 推荐(0) 编辑

公式/定理
摘要:1 // 2018年全国多校算法寒假训练营练习比赛(第三场) 2 // 不凡的夫夫 3 #include <iostream> 4 #include <cstdio> 5 #include <cstring> 6 #include <string> 7 #include <utility> 8 #i 阅读全文

posted @ 2018-07-20 11:38 cltt 阅读(273) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示