CC

自然万物都趋向从有序变得无序

0%


题目链接

时空限制 1000ms / 128MB

Problem Description

题目背景

数学题,无背景

题目描述

给出正整数n和k,计算G(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值,其中k mod i表示k除以i的余数。例如G(10, 5)=5 mod 1 + 5 mod 2 + 5 mod 3 + 5 mod 4 + 5 mod 5 …… + 5 mod 10=0+1+2+1+0+5+5+5+5+5=29

阅读全文 »


题目链接

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)

Problem Description

There are many trees forming a m * n grid, the grid starts from (1,1). Farmer Sherlock is standing at (0,0) point. He wonders how many trees he can see. If two trees and Sherlock are in one line, Farmer Sherlock can only see the tree nearest to him.

阅读全文 »


题目链接

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 131 Accepted Submission(s): 41

Problem Description

There is a positive integer sequence a1,a2,…,an with some unknown positions, denoted by 0. >Little Q will replace each 0 by a random integer within the range [1,m] equiprobably. After that, he >will calculate the value of this sequence using the following formula :

阅读全文 »

题目链接

Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)

Total Submission(s): 446 Accepted Submission(s): 91

Problem Description

After trying hard for many years, Little Q has finally received an astronaut license. To celebrate the fact, he intends to buy himself a spaceship and make an interstellar travel.

Little Q knows the position of n planets in space, labeled by 1 to n. To his surprise, these planets are all coplanar. So to simplify, Little Q put these n planets on a plane coordinate system, and calculated the coordinate of each planet (xi,yi).

阅读全文 »

题目链接

题目


Your task in this problem is to determine the number of divisors of Cnk. Just for fun – or do you need any special reason for such a useful computation?

Input

The input consists of several instances. Each instance consists of a single line containing two integers n and k (0 ≤ k ≤ n ≤ 431), separated by a single space.

阅读全文 »

题目链接

题目


Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relatively prime to 2006.

Now your job is easy: for the given integer m, find the K-th element which is relatively prime to m when these elements are sorted in ascending order.
阅读全文 »

题目链接

题目


Bob has a not even coin, every time he tosses the coin, the probability that the coin’s front face up is qp(qp12)qp(qp12)pq(pq21).qp(qp≤12)\frac{q}{p}(\frac{q}{p} \le \frac{1}{2})​p​​q​​(​p​​q​​≤​2​​1​​).
The question is, when Bob tosses the coin kkk times, what’s the probability that the frequency of the coin facing up is even number.
If the answer is XY\frac{X}{Y}​​​, because the answer could be extremely large, you only need to print (XY1)mod(109+7)(XY1)mod(109+7)(XY1)mod(109+7).(X∗Y^{−1})mod(10^9+7)(X * Y^{-1}) \mod (10^9+7)(X∗Y​−1​​)mod(10​^9​​+7).

阅读全文 »

题目链接

题目


We define a sequence F:

⋅ F0=0,F1=1;
⋅ Fn=Fn−1+Fn−2 (n≥2).

Give you an integer k, if a positive number n can be expressed by
n=Fa1+Fa2+...+Fak where 0≤a1≤a2≤⋯≤ak, this positive number is mjf−good. Otherwise, this positive number is mjf−bad.
Now, give you an integer k, you task is to find the minimal positive mjf−bad number.
The answer may be too large. Please print the answer modulo 998244353.
阅读全文 »