
数论
文章平均质量分 82
绿蚁.r
这个作者很懒,什么都没留下…
展开
-
A/B
Problem Description 要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input 数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 Output 对应每组数据输出(A/B)%9973。 Sample Input 2 1000 53原创 2017-04-27 16:38:04 · 392 阅读 · 0 评论 -
Frogs
Problem Description There are m stones lying on a circle, and n frogs are jumping over them. The stones are numbered from 0 to m−1 and the frogs are numbered from 1 to n. The i-th frog c原创 2017-08-04 09:23:17 · 703 阅读 · 0 评论 -
Sum
Problem Description XXX is puzzled with the question below: 1, 2, 3, ..., n (1 Operation 1: among the x-th number to the y-th number (inclusive), get the sum of the numbers which are co-prim原创 2017-08-04 09:07:09 · 303 阅读 · 0 评论 -
Co-prime
Problem Description 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 pr原创 2017-08-03 21:53:20 · 472 阅读 · 0 评论 -
The Boss on Mars
Problem Description On Mars, there is a huge company called ACM (A huge Company on Mars), and it’s owned by a younger boss. Due to no moons around Mars, the employees can only get the salaries p原创 2017-08-03 21:10:32 · 408 阅读 · 0 评论 -
GCD
Problem Description Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices ma原创 2017-08-03 19:50:09 · 724 阅读 · 0 评论 -
X问题
Problem Description 求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … (0 Input 输入数据的第一行为一个正整数T,表示有T组测试数据。每组测试数据的第一行为两个正整数N,M (0 Output原创 2017-08-03 19:46:31 · 504 阅读 · 0 评论 -
Super Sum
题目链接:https://vjudge.net/contest/174844#problem/J; 题意:给一群a,b,c,求解a1^m1*a2^m2*a3^m3*a4^m4......an^mn所有可能的和,其中b 思路:看到这题的时候,我联想到了求n因子的公式,设n=p1^e1*p2^e2*P3^e3*p4^e4......,则n的所有因子的和为:(1+p1+p1^2+p1^3+.原创 2017-08-09 09:46:10 · 666 阅读 · 0 评论 -
Romantic
Problem Description Do you have spent some time to think and try to solve those unsolved problem after one ACM contest? No? Oh, you must do this when you want to become a "Big Cattle". Now you will原创 2017-04-27 11:39:51 · 310 阅读 · 0 评论 -
Coprime
Problem Description Please write a program to calculate the k-th positive integer that is coprime with m and n simultaneously. A is coprime with B when their greatest common divisor is 1. Input The...原创 2017-08-03 20:10:11 · 1080 阅读 · 3 评论