摘要:Problem Statement Takahashi and Aoki are playing a stone-taking game. Initially, there are N piles of stones, and the i-th pile contains Ai stones and
阅读全文
摘要:题面在这里! 显然一段区间的 mul - sum * k = 0 才合法,然鹅我们发现sum * k 对于本题的数据来说最大才是1e18,也就是说mul必须得<=1e18. 我们不妨从这里入手,因为mul最多只能乘log个>1的数,所以我们用lef[]记录每个数往左第一个不是1的数在哪,于是前后两个
阅读全文
摘要:Problem Statement In the State of Takahashi in AtCoderian Federation, there are N cities, numbered 1,2,…,N. M bidirectional roads connect these cities
阅读全文
摘要:Discription Jzzhu have n non-negative integers a1, a2, ..., an. We will call a sequence of indexes i1, i2, ..., ik (1 ≤ i1 < i2 < ... < ik ≤ n) a grou
阅读全文
摘要:题目背景 题目描述 逃不掉的那一天还是来了,小 F 看着夜空发呆。 天上空荡荡的,没有一颗星星——大概是因为天上吹不散的乌云吧。 心里吹不散的乌云,就让它在那里吧,反正也没有机会去改变什么了。 小 C 拿来了一长串星型小灯泡,假装是星星,递给小 F,想让小 F 开心一点。不过,有 着强迫症的小 F
阅读全文
摘要:Discription You are given a tree consisting of nn vertices. A number is written on each vertex; the number on vertex ii is equal to aiai. Let's denote
阅读全文
摘要:Problem Statement Aoki loves numerical sequences and trees. One day, Takahashi gave him an integer sequence of length N, a1,a2,…,aN, which made him wa
阅读全文
摘要:Problem Statement One day, Takahashi was given the following problem from Aoki: You are given a tree with N vertices and an integer K. The vertices ar
阅读全文
摘要:Problem Statement You are participating in a quiz with N+M questions and Yes/No answers. It's known in advance that there are N questions with answer
阅读全文
摘要:Discription Arkady's code contains nn variables. Each variable has a unique name consisting of lowercase English letters only. One day Arkady decided
阅读全文
摘要:Discription Moriarty has trapped n people in n distinct rooms in a hotel. Some rooms are locked, others are unlocked. But, there is a condition that t
阅读全文
摘要:Discription Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Iv
阅读全文
摘要:B - RGB Coloring Time limit : 2sec / Memory limit : 1024MB Score : 700 points Problem Statement Takahashi has a tower which is divided into N layers.
阅读全文