随笔分类 - Atcoder
摘要:Problem StatementYou are given a string $S$ of length $N$ consisting of 0, 1, and ?. You are also given $Q$ queries $(x_1, c_1), (x_2, c_2), \ldots, (
阅读全文
摘要:Problem StatementYou are given a sequence $A=(A_1,\ldots,A_N)$ of length $N$. Each element is $0$, $1$, or $2$. Process $Q$ queries in order. Each que
阅读全文
摘要:Problem StatementIn an $N$-dimensional space, the Manhattan distance $d(x,y)$ between two points $x=(x_1, x_2, \dots, x_N)$ and $y = (y_1, y_2, \dots,
阅读全文
摘要:Problem StatementTakahashi is at the origin of a two-dimensional plane. Takahashi will repeat teleporting $N$ times. In each teleportation, he makes o
阅读全文
摘要:Problem StatementThere is a sequence $A=(A_0,\ldots,A_{N-1})$ of length $N$. Determine if there exists a tuple of integers $(x,y,z,w)$ that satisfies
阅读全文
摘要:Problem StatementWe have a grid with $H$ horizontal rows and $W$ vertical columns. $(i, j)$ denotes the square at the $i$-th row from the top and $j$-
阅读全文
摘要:Problem StatementTakahashi is exploring a cave in a video game. The cave consists of $N$ rooms arranged in a row. The rooms are numbered Room $1,2,\ld
阅读全文
摘要:Problem StatementA fruit store sells apples. You may perform the following operations as many times as you want in any order: Buy one apple for $X$ ye
阅读全文
摘要:Problem StatementYou are given an integer sequence of length $N$: $A=(A_1,A_2,\ldots,A_N)$. You will perform the following consecutive operations just
阅读全文
摘要:NotesFor two integer sequences of the same length $A_1,A_2,\dots,A_N$ and $B_1,B_2,\dots,B_N$, $A$ is said to be lexicographically earlier than $B$ if
阅读全文
摘要:Problem StatementThere are $N$ people, called Person $1$, Person $2$, $\ldots$, Person $N$. The parent of Person $i$ $(2 \le i \le N)$ is Person $P_i$
阅读全文
摘要:Problem StatementWe have five cards with integers $A$, $B$, $C$, $D$, and $E$ written on them, one on each card. This set of five cards is called a Fu
阅读全文
摘要:Problem StatementThere are $N$ squares called Square $1$ though Square $N$. You start on Square $1$. Each of the squares from Square $1$ through Squar
阅读全文
摘要:Problem StatementThere are integers with $N$ different values written on a blackboard. The $i$-th value is $A_i$ and is written $B_i$ times. You may r
阅读全文
摘要:Problem Statement$2^N$ people, numbered $1$ to $2^N$, will participate in a rock-paper-scissors tournament. The tournament proceeds as follows: The pa
阅读全文
摘要:Problem StatementA sport event is held in June of every year whose remainder when divided by $4$ is $2$. Suppose that it is now January of the year $Y
阅读全文
摘要:Problem StatementThere is an empty sequence $X$ and an empty stack $S$. Also, you are given an integer sequence $A=(a_1,\ldots,a_N)$ of length $N$. Fo
阅读全文
摘要:Problem StatementYou are given a simple undirected graph with $N$ vertices and $M$ edges. The vertices are numbered $1, \dots, N$, and the $i$-th $(1
阅读全文
摘要:Problem StatementYou are given a sequence $a = (a_1, \dots, a_N)$ of length $N$ consisting of integers between $1$ and $N$. Find the number of pairs o
阅读全文
摘要:Problem StatementYou are given a sequence of positive integers $A=(a_1,\ldots,a_N)$ of length $N$. There are $(2^N-1)$ ways to choose one or more term
阅读全文