印尼首都雅加达市有 N" data-mce-tabindex="0">N 座摩天楼,它们排列成一条直线,我们从左到右依次将它们编号为 0" data-mce-tabindex="0">0 到 N−1" data-mce-tabindex="0">N−1。除了这 N" data-mce-tabindex="0">N 座摩天楼外,雅加达市没有其他摩天楼。 有 M" data-mce-tabindex="0">M 只叫做 “doge” 的神秘生物在雅加达市居住
Problem StatementTaichi thinks a binary string X of odd length N is beautiful if it is possible to apply the following operation N−12 times so that the only character of the resulting string is 1 : Choose three consecutive&n
Problem StatementSnuke has a rooted tree with N vertices, numbered 1 through N. Vertex 1 is the root of the tree, and the parent of Vertex i ( 2≤i≤N ) is Vertex Pi ( Pi<i ). There is a number, 0 or 1, writte
Problem Description You may not know this but it's a fact that Xinghai Square is Asia's largest city square. It is located in Dalian and, of course, a landmark of the city. It's an ideal place for outing any time of the year. And now: There are N children from a near
【题目描述】给定一个有n个元素的序列,元素编号为1~n,每个元素有三个属性a,b,c,求序列中满足i<j且ai<aj且bi<bj且ci<cj的数对(i,j)的个数。 【输入格式】第一行一个整数n,表示序列长度。 第二行n个整数,分别表示a1~an。 第三行n个整数,分别表示b1~bn。 第四行n个整数,分别表示c1~cn。 【输出格式】一个整数,表示答案。 【样例输入】5
1 5 3 4 2
2 5 3 4 1
1 2 5 3 4【样例输出】3【样例解释】满足条件的(i,j)共有以下三对: (1,2) (1,3) (1,4) 【数据范围与约定】对于30%的数据,n<
Problem StatementIn Republic of AtCoder, Snuke Chameleons (Family: Chamaeleonidae, Genus: Bartaberia) are very popular pets. Ringo keeps N" data-mce-tabindex="0">NN Snuke Chameleons in a cage. A Snuke Chameleon that has not eaten anything is blue. It changes its color according to the f
Problem StatementFind the number of the possible tuples of sequences (A0,A1,…,AN) that satisfy all of the following conditions, modulo M: For every i (0≤i≤N), Ai is a sequence of length i consisting of integers between 1 and K (inclusi
Problem StatementWe have a sequence A of length N. On this sequence, we can perform the following two kinds of operations: Swap two adjacent elements. Select one element, and increment it by 1. We will repeatedly perform these operations so that A will be a non-decreasi
描述:给定一个多边形,求对称轴数量。n <= 1000000 输入输出样例输入样例#1: 复制2
12
1 -1
2 -1
2 1
1 1
1 2
-1 2
-1 1
-2 1
-2 -1
-1 -1
-1 -2
1 -2
6
-1 1
-2 0
-1 -1
1 -1
2 0
1 1 输出样例#1: 复制4
2  
For long time scientists study the behavior of sharks. Sharks, as many other species, alternate short movements in a certain location and long movements between locations. Max is a young biologist. For n" data-mce-tabindex="0">nn days he watched a specific shark, and now he knows the di