原创 #640(Div.4)E. Special Elements(前綴和)

題目描述 Pay attention to the non-standard memory limit in this problem. In order to cut off efficient solutions from

原创 1 10 100 1000(map的應用)

題目描述 1,10,100,1000…組成序列1101001000…,求這個序列的第N位是0還是1。 Input 第1行:一個數T,表示後面用作輸入測試的數的數量。(1 <= T <= 10000) 第2 - T + 1行:

原创 #640(Div.4)F. Binary String Reconstruction(找規律+構造)

題目描述 For some binary string s (i.e. each character si is either ‘0’ or ‘1’), all pairs of consecutive (adjacent) c

原创 #640(Div.4)G. Special Permutation(找規律+構造)

題目描述 A permutation of length n is an array p=[p1,p2,…,pn], which contains every integer from 1 to n (inclusive) an

原创 #640(Div.4)C. K-th Not Divisible by n(數學)

題目描述 You are given two positive integers n and k. Print the k-th positive integer that is not divisible by n. For

原创 #640(Div.4)D. Alice, Bob and Candies(模擬)

題目描述 There are n candies in a row, they are numbered from left to right from 1 to n. The size of the i-th candy is

原创 #639 (Div. 2)B. Card Constructions

題目描述: A card pyramid of height 1 is constructed by resting two cards against each other. For h>1, a card pyramid o

原创 #639 (Div. 2)C. Hilbert's Hotel

題目描述: Hilbert’s Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one

原创 #639 (Div. 2)D. Monopole Magnets(連通塊)

題目描述 A monopole magnet is a magnet that only has one pole, either north or south. They don’t actually exist since

原创 #639 (Div. 2)A. Puzzle Pieces

題目描述 You are given a special jigsaw puzzle consisting of n⋅m identical pieces. Every piece has three tabs and one

原创 #638 (Div. 2)A. Phoenix and Balance(找規律+遞推)

Phoenix has n coins with weights 21,22,…,2n. He knows that n is even. He wants to split the coins into two piles s

原创 #638 (Div. 2)C. Phoenix and Distribution(分類討論)

Phoenix has a string s consisting of lowercase Latin letters. He wants to distribute all the letters of his string

原创 #638 (Div. 2)D. Phoenix and Science(貪心)

Phoenix has decided to become a scientist! He is currently investigating the growth of bacteria. Initially, on day

原创 #638 (Div. 2)B. Phoenix and Beauty(思維)

Phoenix loves beautiful arrays. An array is beautiful if all its subarrays of length k have the same sum. A subarr

原创 1342C. Yet Another Counting Problem(找規律+前綴和)

You are given two integers a and b, and q queries. The i-th query consists of two numbers li and ri, and the answe