随笔分类 - online judge Codeforces
摘要:A. Maximum Square Ujan decided to make a new wooden roof for the house. He has 𝑛 rectangular planks numbered from 1 to 𝑛. The 𝑖 th plank has size �
阅读全文
摘要:F. Equalizing Two Strings You are given two strings s and t both of length n and both consisting of lowercase Latin letters. In one move, you can choo
阅读全文
摘要:E. Yet Another Division Into Teams There are n students at your university. The programming skill of the i th student is ai. As a coach, you want to d
阅读全文
摘要:D. Binary String Minimizing You are given a binary string of length n (i. e. a string consisting of n characters '0' and '1'). In one move you can swa
阅读全文
摘要:C. Platforms Jumping There is a river of width n. The left bank of the river is cell 0 and the right bank is cell n+1 (more formally, the river can be
阅读全文
摘要:B. Minimize the Permutation You are given a permutation of length n. Recall that the permutation is an array consisting of n distinct integers from 1
阅读全文
摘要:A. Payment Without Change You have a coins of value n and b coins of value 1. You always pay in exact change, so you want to know if there exist such
阅读全文
摘要:F. Daniel and Spring Cleaning While doing some spring cleaning, Daniel found an old calculator that he loves so much. However, it seems like it is bro
阅读全文
摘要:E. Hyakugoku and Ladders Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of beco
阅读全文
摘要:D. Shichikuji and Power Grid Shichikuji is the new resident deity of the South Black Snail Temple. Her first job is as follows: There are 𝑛 new citie
阅读全文
摘要:C. Constanze's Machine Constanze is the smartest girl in her village but she has bad eyesight. One day, she was able to invent an incredible machine!
阅读全文
摘要:F. Tree Factory Bytelandian Tree Factory produces trees for all kinds of industrial applications. You have been tasked with optimizing the production
阅读全文
摘要:E. Rock Is Push You are at the top left cell (1,1) of an n×m labyrinth. Your goal is to get to the bottom right cell (n,m). You can only move right or
阅读全文
摘要:B2. TV Subscriptions (Hard Version) The only difference between easy and hard versions is constraints. The BerTV channel every day broadcasts one epis
阅读全文
摘要:A. Forgetting Things Kolya is very absent minded. Today his math teacher asked him to solve a simple problem with the equation 𝑎+1=𝑏 with positive i
阅读全文
摘要:D. Power Products You are given n positive integers a1,…,an, and an integer k≥2. Count the number of pairs i,j such that 1≤i using namespace std; cons
阅读全文
摘要:C. p binary Vasya will fancy any number as long as it is an integer power of two. Petya, on the other hand, is very conservative and only likes a sing
阅读全文
摘要:F. Bits And Pieces 题面 You are given an array 𝑎 of 𝑛 integers. You need to find the maximum value of 𝑎𝑖|(𝑎𝑗&𝑎𝑘) over all triplets (𝑖,𝑗,𝑘) su
阅读全文
摘要:G. Polygons Description You are given two integers 𝑛 and 𝑘. You need to construct 𝑘 regular polygons having same circumcircle, with distinct number
阅读全文
摘要:B. Tokitsukaze and Mahjong time limit per test1 second memory limit per test256 megabytes Tokitsukaze is playing a game derivated from Japanese mahjon
阅读全文