摘要:Discription Nikolay and Asya investigate integers together in their spare time. Nikolay thinks an integer is interesting if it is a prime number. Howe
阅读全文
摘要:题目描述 We are given a sequence of n decimal digits. The sequence needs to be partitioned into one or more contiguous subsequences such that each subsequ
阅读全文
摘要:Discription Today you are going to lead a group of elven archers to defend the castle that is attacked by an army of angry orcs. Three sides of the ca
阅读全文
摘要:Discription Little town Nsk consists of n junctions connected by m bidirectional roads. Each road connects two distinct junctions and no two roads con
阅读全文
摘要:E - BBQ Hard Time limit : 2sec / Memory limit : 256MB Score : 1400 points Problem Statement Snuke is having another barbeque party. This time, he will
阅读全文
摘要:Problem Statement Snuke loves colorful balls. He has a total of N×K balls, K in each of his favorite N colors. The colors are numbered 1 through N. He
阅读全文
摘要:1 Function function.cpp/in/out Time limit: 2s Memory limit: 512MB 1.1 Description 给定 m 元不等式组 ∀1 ≤ i ≤ n, xi ≤ t , 且∑ xi ≤ S 。 给定 S, t, n, m,其中 n ≤ m,
阅读全文
摘要:2.1 Description 在平面上找 n 个点, 要求这 n 个点离原点的距离分别为 r1, r2, ..., rn. 最大化这 n 个点构成的凸包面积, 凸包上的点的顺序任意. 2.2 Input Format 第一行一个整数 n. 接下来一行 n 个整数依次表示 ri . 2.3 Outp
阅读全文
摘要:题目描述 给出一个长度为 m 的序列 A, 请你求出有多少种 1...n 的排列, 满足 A 是它的一个 LIS. 题目描述 给出一个长度为 m 的序列 A, 请你求出有多少种 1...n 的排列, 满足 A 是它的一个 LIS. 题目描述 给出一个长度为 m 的序列 A, 请你求出有多少种 1..
阅读全文
摘要:描述 Q先生是一个热爱学习的男孩子。 他认为一个 n 位的正整数 x 若能被称作是绚丽多彩的,一定要满足对于{1,3,5,7,9} 中任意一个奇数或者没有在 x 中出现,或者在 x 中出现了恰好奇数次;同时对于 {0,2,4,6,8} 中任意的偶数或者没有在 x 中出现,或者在x 中出现了偶数次。同
阅读全文
摘要:Discription Calculate the value of the sum: n mod 1 + n mod 2 + n mod 3 + ... + n mod m. As the result can be very large, you should print the value m
阅读全文
摘要:Discription Dima is a beginner programmer. During his working process, he regularly has to repeat the following operation again and again: to remove e
阅读全文
摘要:Discription You have a rooted tree consisting of n vertices. Each vertex of the tree has some color. We will assume that the tree vertices are numbere
阅读全文
摘要:Discription Vasya is studying number theory. He has denoted a function f(a, b) such that: f(a, 0) = 0; f(a, b) = 1 + f(a, b - gcd(a, b)), where gcd(a,
阅读全文
摘要:Discription Devu wants to decorate his garden with flowers. He has purchased n boxes, where the i-th box contains fi flowers. All flowers in a single
阅读全文
摘要:题目描述 小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一个小X讨厌的数。他列出了所有小X不讨厌的数,然后选取
阅读全文
摘要:1419: Red is good Description 桌面上有R张红牌和B张黑牌,随机打乱顺序后放在桌面上,开始一张一张地翻牌,翻到红牌得到1美元,黑牌则付 出1美元。可以随时停止翻牌,在最优策略下平均能得到多少钱。 桌面上有R张红牌和B张黑牌,随机打乱顺序后放在桌面上,开始一张一张地翻牌,翻
阅读全文
摘要:Discription A maze is represented by a tree (an undirected graph, where exactly one way exists between each pair of vertices). In the maze the entranc
阅读全文
摘要:Discription In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108
阅读全文
摘要:Discription The Bad Luck Island is inhabited by three kinds of species: r rocks, s scissors andp papers. At some moments of time two random individual
阅读全文
摘要:题目描述 Alice and Bob play the following game. First, they collect N small stones and put them together in one pile. After that, they throw a coin one by
阅读全文
摘要:Blocks Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7381 Accepted: 3585 Description Panda has received an assignment of painting a line
阅读全文
摘要:排列组合 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4721 Accepted Submission(s): 2036 Problem D
阅读全文
摘要:1858: [Scoi2010]序列操作 Description lxhgww最近收到了一个01序列,序列里面包含了n个数,这些数要么是0,要么是1,现在对于这个序列有五种变换操作和询问操作: 0 a b 把[a, b]区间内的所有数全变成0 1 a b 把[a, b]区间内的所有数全变成1 2 a
阅读全文
摘要:Discription An addition chain for n is an integer sequence <a0, a1,a2,...,am="">with the following four properties: a0 = 1 am = n a0 < a1 < a2 < ... <
阅读全文
摘要:Discription #define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important. As the
阅读全文
摘要:Discription There are well-known formulas: , , . Also mathematicians found similar formulas for higher degrees. Find the value of the sum modulo 109 +
阅读全文
摘要:Discription In this problem you have to build tournament graph, consisting of n vertices, such, that for any oriented pair of vertices (v, u) (v ≠ u)
阅读全文
摘要:Discription Far away from our world, there is a banana forest. And many lovely monkeys live there. One day, SDH(Song Da Hou), who is the king of banan
阅读全文
摘要:Discription Let's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate th
阅读全文
摘要:Discription LCM is an abbreviation used for Least Common Multiple in Mathematics. We say LCM (a, b, c) = L if and only if L is the least integer which
阅读全文
摘要:Disciption Chef has recently learnt Function and Addition. He is too exited to teach this to his friend Churu. Chef and Churu are very fast friends, t
阅读全文
摘要:4872: [Shoi2017]分手是祝愿 Description Zeit und Raum trennen dich und mich. 时空将你我分开。B 君在玩一个游戏,这个游戏由 n 个灯和 n 个开关组成,给定这 n 个灯的初始状态,下标为 从 1 到 n 的正整数。每个灯有两个状态亮和
阅读全文
摘要:Diciption Let's consider m apples divided into n groups. Each group contains no more than 100 apples, arranged in a line. You can take any number of c
阅读全文
摘要:Seg 【问题描述】数轴上有n条线段,第i条线段的左端点是a[i],右端点是b[i]。Bob发现1~2n共2n个整数点,每个点都是某条线段的端点。这些线段有如下两类特点:1 x y,表示第x条线段和第y条线段相交(相交在这里指至少有一个公共点)2 x y,表示第x条线段在第y条线段的左边,且它们不相
阅读全文
摘要:numbers Problem Description Now you have a stack and n numbers 1,2,3,…,n. These n numbers are pushed in the order and popped if the number is at the t
阅读全文
摘要:题目描述 — This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With hands joined, go everywhere at a
阅读全文
摘要:Description 有一个长度为n的序列,有三个操作1.I a b c表示将[a,b]这一段区间的元素集体增加c,2.R a b表示将[a,b]区间内所有元素变成相反数,3.Q a b c表示询问[a,b]这一段区间中选择c个数相乘的所有方案的和mod 19940417的值。 有一个长度为n的序
阅读全文
摘要:Discription Anton goes to school, his favorite lessons are arraystudying. He usually solves all the tasks pretty fast, but this time the teacher gave
阅读全文