05 2018 档案

摘要:問題文N を 1 以上の整数とします。 長さ 3N の数列 a=(a1,a2,…,a3N) があります。 すぬけ君は、a からちょうど N 個の要素を取り除き、残った 2N 個の要素を元の順序で並べ、長さ 2N の数列 a' を作ろうとしています。 このとき、a' のスコアを (a'の前半N要素の総 阅读全文
posted @ 2018-05-12 14:33 Styx-ferryman 阅读(150) 评论(0) 推荐(0) 编辑
摘要:You are given a tree with N nodes. The tree nodes are numbered from 1 to N and have colors C1, C2,. . . , CN initially. You have to handle M instructi 阅读全文
posted @ 2018-05-11 18:23 Styx-ferryman 阅读(166) 评论(0) 推荐(0) 编辑
摘要:This task is very simple. Given a string S of length n and q queries each query is on the format i j k which means sort the substring consisting of th 阅读全文
posted @ 2018-05-10 15:05 Styx-ferryman 阅读(251) 评论(0) 推荐(0) 编辑
摘要:問題文N 個の都市があり、K 本の道路と L 本の鉄道が都市の間に伸びています。 i 番目の道路は pi 番目と qi 番目の都市を双方向に結び、 i 番目の鉄道は ri 番目と si 番目の都市を双方向に結びます。 異なる道路が同じ 2 つの都市を結ぶことはありません。同様に、異なる鉄道が同じ 2 阅读全文
posted @ 2018-05-09 18:10 Styx-ferryman 阅读(591) 评论(0) 推荐(2) 编辑
摘要:We'll call an array of n non-negative integers a[1], a[2], ..., a[n] interesting, if it meets m constraints. The i-th of the m constraints consists of 阅读全文
posted @ 2018-05-09 10:36 Styx-ferryman 阅读(465) 评论(0) 推荐(0) 编辑
摘要:Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which can bake several types o 阅读全文
posted @ 2018-05-08 08:16 Styx-ferryman 阅读(255) 评论(0) 推荐(0) 编辑
摘要:Danil decided to earn some money, so he had found a part-time job. The interview have went well, so now he is a light switcher. Danil works in a roote 阅读全文
posted @ 2018-05-07 20:48 Styx-ferryman 阅读(316) 评论(0) 推荐(0) 编辑
摘要:Mad scientist Mike has constructed a rooted tree, which consists of n vertices. Each vertex is a reservoir which can be either empty or filled with wa 阅读全文
posted @ 2018-05-07 14:05 Styx-ferryman 阅读(390) 评论(0) 推荐(1) 编辑
摘要:Description 相传,在远古时期,位于西方大陆的 Magic Land 上,人们已经掌握了用魔法矿石炼制法杖的技术。那时人们就认识到,一个法杖的法力取决于使用的矿石。一般地,矿石越多则法力越强,但物极必反:有时,人们为了获取更强的法力而使用了很多矿石,却在炼制过程中发现魔法矿石全部消失了,从 阅读全文
posted @ 2018-05-05 11:06 Styx-ferryman 阅读(196) 评论(0) 推荐(0) 编辑
摘要:Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 阅读全文
posted @ 2018-05-01 20:17 Styx-ferryman 阅读(554) 评论(0) 推荐(1) 编辑