摘要:Discription As you know, the most intelligent beings on the Earth are, of course, cows. This conclusion was reached long ago by the Martian aliens, as
阅读全文
摘要:Discription As you must know, the maximum clique problem in an arbitrary graph is NP-hard. Nevertheless, for some graphs of specific kinds it can be s
阅读全文
摘要:Discription Gargari got bored to play with the bishops and now, after solving the problem about them, he is trying to do math homework. In a math book
阅读全文
摘要:Discription You are given an array of n integers a1... an. The cost of a subsegment is the number of unordered pairs of distinct indices within the su
阅读全文
摘要:Discription Given a text s[1..n] of length n, we create its suffix array by taking all its suffixes: s[1..n], s[2..n],...., s[n..n] and sorting them l
阅读全文
摘要:Discription Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is d
阅读全文
摘要:Discription You are given two multisets A and B. Each multiset has exactly n integers each between 1 and n inclusive. Multisets may contain multiple c
阅读全文
摘要:Discription A group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are roads in to
阅读全文
摘要:Problem Statement You are given an integer sequence of length N, a= {a1,a2,…,aN}, and an integer K. a has N(N+1)⁄2 non-empty contiguous subsequences,
阅读全文
摘要:Discription Altanie is a very large and strange country in Mars. People of Mars ages a lot. Some of them live for thousands of centuries! Your old fri
阅读全文
摘要:Discription Statements Whistle has bought a new car, which has an infinite fuel tank capacity. He discovered an irregular country since it has n citie
阅读全文
摘要:Discription Berland is a tourist country! At least, it can become such — the government of Berland is confident about this. There are n cities in Berl
阅读全文
摘要:Discription You are given an undirected bipartite graph without multiple edges. You should paint the edges of graph to minimal number of colours, so t
阅读全文
摘要:Discription Given a permutation a1, a2, … aN of {1, 2, …, N}, we define its E-value as the amount of elements where ai > i. For example, the E-value o
阅读全文
摘要:Read problems statements in Mandarin Chinese and Russian. Rin is attending a university. She has M semesters to finish her program, and that program h
阅读全文
摘要:Discription Consider a sequence F i that satisfies the following conditions: Discription Consider a sequence F i that satisfies the following conditio
阅读全文
摘要:Discription Given a sequence of integers a1, ..., an and q queries x1, ..., xq on it. For each query xi you have to count the number of pairs (l, r) s
阅读全文
摘要:Discription Everyone knows what the Fibonacci sequence is. This sequence can be defined by the recurrence relation: We'll define a new number sequence
阅读全文
摘要:Discription Given a simple graph, output the number of simple cycles in it. A simple cycle is a cycle with no repeated vertices or edges. Input The fi
阅读全文
摘要:Problem Statement You are given a tree with N vertices. The vertices are numbered 0 through N−1, and the edges are numbered 1 through N−1. Edge i conn
阅读全文
摘要:Discription John likes playing the game Permutation Jumping. First he writes down a permutation A of the first n numbers. Then, he chooses any cell to
阅读全文
摘要:Discription Mahmoud and Ehab live in a country with n cities numbered from 1 to n and connected by n - 1 undirected roads. It's guaranteed that you ca
阅读全文
摘要:Read problems statements in Mandarin Chinese and Russian. Little Elephant from Zoo of Lviv likes to watch movies. There are N different movies (number
阅读全文
摘要:Read problems statements in Mandarin Chinese and Russian. A meteor fell on Andrew's house. That's why he decided to build a new home and chose a site
阅读全文
摘要:Discription Mahmoud has an array a consisting of n integers. He asked Ehab to find another arrayb of the same length such that: b is lexicographically
阅读全文
摘要:Discription Ehab has an array a of n integers. He likes the bitwise-xor operation and he likes to bother Mahmoud so he came up with a problem. He gave
阅读全文
摘要:Discription Ehab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete g
阅读全文
摘要:Discription Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes th
阅读全文
摘要:Discription Problem statement is simple. Given A and B you need to calculate S(A,B) . Here, f(n)=n, if n is square free otherwise 0. Also f(1)=1. Inpu
阅读全文
摘要:Discription Ilya got tired of sports programming, left university and got a job in the subway. He was given the task to determine the escalator load f
阅读全文
摘要:Discription Ostap already settled down in Rio de Janiero suburb and started to grow a tree in his garden. Recall that a tree is a connected undirected
阅读全文
摘要:Discription N ladies attend the ball in the King's palace. Every lady can be described with three values: beauty, intellect and richness. King's Maste
阅读全文
摘要:Discription It's the turn of the year, so Bash wants to send presents to his friends. There are n cities in the Himalayan region and they are connecte
阅读全文
摘要:Problem Statement You are given N integers A1, A2, ..., AN. Consider the sums of all non-empty subsequences of A. There are 2N−1 such sums, an odd num
阅读全文
摘要:Problem Statement Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeati
阅读全文
摘要:2212: [Poi2011]Tree Rotations Description Byteasar the gardener is growing a rare tree called Rotatus Informatikus. It has some interesting features:
阅读全文
摘要:Discription One day Polycarp decided to rewatch his absolute favourite episode of well-known TV series "Tufurama". He was pretty surprised when he got
阅读全文
摘要:题目背景 We could have had it all. . . . . . 我们本该,拥有一切 Counting on a tree. . . . . . 何至于此,数数树上 Counting on a Tree(CoaT)即是本题的英文名称。 题目描述 Access Globe 最近正在玩一
阅读全文
摘要:题目描述 You are given nn points on Cartesian plane. Every point is a lattice point (i. e. both of its coordinates are integers), and all points are disti
阅读全文
摘要:题目描述 English VietnameseGiven a sequence of n numbers a _{1}1 , a _{2}2 , ..., a _{n}n and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i
阅读全文