17995 Stupid thief 时间限制:1000MS 内存限制:65535K提交次数:0 通过次数:0 题型: 编程题 语言: 不限定 Description A stupid thief has just discovered the treasure in a cave. There are N bottles filled with gold coins. Because of darkness, he can't see the exact number of coins…
题面 有一个长为 N N N 的序列,相邻的两个数中只能选一个,总共选 k k k 个数,一种方案的价值为选的 k k k 个数的和,问所有合法方案的价值总和,答案对 998244353 取模. 1 ≤ N ≤ 3 ⋅ 1 0 5 , 1 ≤ k ≤ ⌈ N 2 ⌉ 1\leq N\leq 3\cdot10^5~,~1\leq k\leq \left\lceil \frac{N}{2} \right\rceil 1≤N≤3⋅105 , 1≤k≤⌈2N⌉. 题解 把每个数的贡献拆开求,答案就是…
E. Thief in a Shop time limit per test 5 seconds memory limit per test 512 megabytes input standard input output standard output A thief made his way to a shop. As usual he has his lucky knapsack with him. The knapsack can contain k objects. There ar…
题目 Source http://codeforces.com/contest/632/problem/E Description A thief made his way to a shop. As usual he has his lucky knapsack with him. The knapsack can contain k objects. There are n kinds of products in the shop and an infinite number of pro…
A pair of numbers has a unique LCM but a single number can be the LCM of more than one possiblepairs. For example 12 is the LCM of (1, 12), (2, 12), (3,4) etc. For a given positive integer N, thenumber of different integer pairs with LCM is equal to N…
Round Numbers DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) in order to make arbitrary decisions such…
Paths on a Grid DescriptionImagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time he's explaining that (a+b)2=a2+2ab+b2). So you decide to waste…
Code DescriptionTransmitting and memorizing information is a task that requires different coding systems for the best use of the available space. A well known system is that one where a number is associated to a character sequence. It is considered t…
Problem Description Do you know Kaitou Kid? In the legend, Kaitou Kid is a master of disguise, and can take on the voice and form of anyone. He is not an evil person, but he is on the wrong side of the law. He's the very elusive phantom thief who nev…
Problem A Chess Queen Input: Standard Input Output: Standard Output You probably know how the game of chess is played and how chess queen operates. Two chess queens are in attacking position when they are on same row, column or diagonal of a chess bo…
hdu 2451 Simple Addition Expression Problem Description A luxury yacht with 100 passengers on board is sailing on the sea in the twilight. The yacht is ablaze with lights and there comes out laughers and singing from the hall where an evening party i…
Blocks Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3997 Accepted: 1775 Description Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of paint…