## Heights and Pairs SOLUTION ACL CONTEST

Heights and Pairs SOLUTION Problem Statement There are 2N people numbered 1 through 2N. The height of Person i is hi.How many ways are there to make N pairs of people such that the following conditions are satisfied? Compute the answer modulo 998,244,353.   Each person is contained in exactly one pair. For each pair, the heights of the two people in the pair are different. … Read more

## Replace Digits SOLUTION ACL CONTEST

Replace Digits SOLUTION Problem Statement You have a string S of length N. Initially, all characters in S are 1s.You will perform queries  Q times. In the i-th query, you are given two integers Li,Ri and a character Di (which is a digit). Then, you must replace all characters from the Li-th to the Ri-th (inclusive) with  Di.After each query, read the string S as a decimal integer, and print … Read more

## Flat Subsequence SOLUTION ACL CONTEST

Flat Subsequence SOLUTION Problem Statement You are given a sequence A1,A2,…,AN and an integer K.Print the maximum possible length of a sequence B that satisfies the following conditions:B is a (not necessarily continuous) subsequence of A.For each pair of adjacents elements of B, the absolute difference of the elements is at most K Constraints 1 … Read more

## Connect Cities SOLUTION ACL CONTEST

Connect Cities SOLUTION Problem Statement There are N cities numbered 1 through N, and M bidirectional roads numbered 1 through M. Road i connects City Ai and City Bi Snuke can perform the following operation zero or more time Choose two distinct cities that are not directly connected by a road, and build a new … Read more

## Integer Preference SOLUTION ACL CONTEST

Integer Preference SOLUTION Problem Statement Snuke likes integers that are greater than or equal to  A , and less than or equal to  B . Takahashi likes integers that are greater than or equal to  C , and less than or equal to  D .   Does there exist an integer liked by both people? … Read more

## Repeat ACL SOLUTION ACL CONTEST

Repeat ACL SOLUTION Problem Statement You are given an integer  K . Print the string obtained by repeating the string ACL  K  times and concatenating them.   For example, if  K = 3 , print ACLACLACL.   Constraints 1 ≤ K ≤ 5 All values in input are integers. Input Input is given from Standard … Read more

## Moving Pieces SOLUTIONS ACL CONTEST 1

Moving Pieces SOLUTION Issue Statement There is a board with N lines and M sections. The data of this board is spoken to by N strings S 1 , S 2 , … , S N . In particular, the condition of the square at the I – th line from the top and the … Read more

## Sum is Multiple SOLUTIONS ACL CONTEST 1

Sum is Multiple SOLUTION Issue Statement Given is a number N . Locate the base conceivable positive number k with the end goal that ( 1 + 2 + ⋯ + k ) is a various of N . It tends to be demonstrated that such a positive whole number k continuously exists. Requirements 1 … Read more

## Reachable Towns SOLUTIONS ACL CONTEST 1

Reachable Towns SOLUTION Issue Statement There are N urban areas on a 2D plane. The organize of the I – th city is (xi,yi).Here (x1,x2,… ,xN) and(y1,y2… ,yN) are both permuations of (1,2,… ,N) For each k=1,2,… ,N, discover the response to the accompanying inquiry: Rng is in City k . Rng can play out … Read more

## Simplified Reversi SOLUTION AtCoder Beginner Contest 179

Simplified Reversi SOLUTION Problem Statement There is a framework with N columns and N segments of squares. Let ( I , j ) be the square at the I – th column from the top and the j – th segment from the left. Every one of the focal ( N − 2 ) × ( N − 2 ) squares in the … Read more

error: Content is protected !!
+