摘要: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...
阅读全文
摘要:L1-046 整除光棍 (20 分) L1-046 整除光棍 (20 分) L1-046 整除光棍 (20 分) 这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。
阅读全文
摘要:牛客练习赛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
阅读全文
摘要:牛客练习赛33 B tokitsukaze and RPG tokitsukaze最近沉迷一款RPG。这个RPG一天有k分钟,每一天从第1分钟开始。有n种怪物,第i种怪物每天第一次出现的时间为Xi分钟,第二次出现的时间为2*Xi分钟,第三次出现的时间为3*Xi分钟......同一时刻出现的怪物种类越
阅读全文
摘要://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
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/211/F来源:牛客网 题目描述 给定 个整数 。保证 。 对于每个 ,求出 。为了避免过量输出,你只需要将所有的 m 个结果异或起来输出。 输入描述: 第一行两个整数 。 第二行 个整数,第 个表示 。 输出描述: 一
阅读全文
摘要: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
阅读全文
摘要: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,
阅读全文
摘要:链接: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
阅读全文
摘要://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
阅读全文
摘要:// 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
阅读全文
摘要: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
阅读全文
摘要:牛客小白月赛5 D 题目描述 输入描述: 输入数据共一行,一个正整数n,意义如“问题描述”。 输出描述: 输出一行描述答案:一个正整数k,表示S的末尾有k个0 示例1 输入 复制 10 输出 复制 7 说明 鸣谢真·dalao Tyxao 1 ll ans=0; 2 scanf("%d",&n);
阅读全文
摘要: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;...
阅读全文
摘要:Maximum Multiple Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1500 Accepted Submission(s): 650
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:1 // 2018年全国多校算法寒假训练营练习比赛(第三场) 2 // 不凡的夫夫 3 #include <iostream> 4 #include <cstdio> 5 #include <cstring> 6 #include <string> 7 #include <utility> 8 #i
阅读全文