数论专题
数论专题
水墨青杉
这个作者很懒,什么都没留下…
展开
-
寒假训练数论K
题目Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.Two integers are said to be co-prime or relatively prime if they have no c...原创 2020-01-21 12:36:46 · 249 阅读 · 0 评论 -
寒假训练数论J
题目解题思路不会证明,找规律。。。发现答案是(2^(n-1))mod(1e9+7)由于n很大,1e9+7是个质数由费马小定理 2^(1e9+6)≡1(mod (1e9+7))所以答案是(2^((n-1) mod (1e9+6)))mod(1e9+7)代码#include <cstdio>#include <iostream>using namespace...原创 2020-01-21 12:12:16 · 201 阅读 · 1 评论 -
寒假训练数论G
题目小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个区间,你能计算出这个区间内有多少个美素数吗?Input第一行输入一个正整数T,表示总共有T组数据(T <= 1000...原创 2020-01-20 18:06:51 · 325 阅读 · 0 评论 -
寒假训练数论F
题目两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的...原创 2020-01-20 17:50:41 · 170 阅读 · 0 评论 -
寒假训练数论E
题目In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or greatest common measure (gcm), of two or more integers (when at le...原创 2020-01-19 20:56:32 · 231 阅读 · 0 评论 -
寒假集训数论D
题目Vitaly is a very weird man. He’s got two favorite digits a and b. Vitaly calls a positive integer good, if the decimal representation of this integer only contains digits a and b. Vitaly calls a go...原创 2020-01-19 20:52:39 · 164 阅读 · 0 评论 -
寒假训练数论C
题目要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。解题思路9973是一个质数。由费马...原创 2020-01-19 10:52:52 · 102 阅读 · 0 评论 -
寒假训练数论B
题目Fedya studies in a gymnasium. Fedya’s maths hometask is to calculate the following expression:(1^n + 2^n + 3^n + 4^n) mod 5for given value of n. Fedya managed to complete the task. Can you? Not...原创 2020-01-19 09:10:59 · 131 阅读 · 0 评论 -
寒假训练数论A
题目For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and is divisible by n.For example, 4-rounding of 375 is 375...原创 2020-01-18 10:18:28 · 104 阅读 · 0 评论