利用 fjzzq2002 的 CPIdeas 生成的一些绝世好题。欢迎投稿。
-
Given is an integer N. How many integers between 1 and N (inclusive) are there?
-
Given is a prime number P. How many integers a between 1 and P (inclusive) are there?
-
Given are sequences A1,A2,…,AN and B1,B2,…,BN. If Ai and Bi are the same sequence, print Yes; otherwise, print No.
-
Given are integers a and b. If a*b<=c, print Yes; otherwise, print No.
-
Given are integers A, B, and C. Find the maximum possible value of the product of A and B.
-
You are given a string S consisting of lowercase English letters. If the length of S is even, print S; if the length of S is odd, print S.
-
Given are integers a and b. Find the maximum integer between a and b (inclusive).
-
You are given a string S of length N consisting of 0 and 1. If the string S is not empty, print Yes; otherwise, print No.
-
Given is a permutation P1,…,PN of 1,…,N. For each i=1,…,N-1, find the number of pairs of integers (i,j) such that i < j and Pi = Pj.
-
You are given a tree with N vertices. The vertices are numbered 1 through N, and the i-th edge connects Vertex Ui and Vertex Vi. Vertex i has an integer Ai written on it. How many different integer values are written on the vertices?
附加题(非常有难度):
-
You are given two integers A and B. Determine whether A*B is a prime number.
-
Given is a string S. How many times can we insert a character c between two adjacent characters of S?
-
Given are integers N and M. Find the number of non-empty intervals [a,b) containing N*M+1 integers, modulo 998244353.
-
You are given positive integers L and R. Find the number of pairs of integers (x,y) that satisfy the following condition: x and y are both odd.
-
You are given an integer X. What is the maximum possible value of Y?
-
Takahashi loves eating takoyaki, a type of ball-shaped fried snack made of batter. How many takoyaki does Takahashi eat in a day?