原创 D - Nim POJ - 2068 (記憶化搜索)

Let's play a traditional game Nim. You and I are seated across a table and we have a hundred stones on the table (we kn

原创 A - Beautiful numbers CodeForces - 55D

Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if

原创 B2. Cat Party (Hard Edition)(思維)

This problem is same as the previous one, but has larger constraints. Shiro's just moved to the new house. She wants to

原创 F. Graph Without Long Directed Paths

You are given a connected undirected graph consisting of 𝑛 vertices and 𝑚 edges. There are no self-loops or multiple ed

原创 C. Division and Union

There are 𝑛 segments [𝑙𝑖,𝑟𝑖] for 1≤𝑖≤𝑛 . You should divide all segments into two non-empty groups in such way that ther

原创 I - Induced Metric Space Gym - 102190I

題目鏈接:http://codeforces.com/gym/102190/attachments 題解:先按照題目要求遍歷一下數組,若存在不滿足題目要求的直接輸出NO,其他的:先將主對角線上的元素變爲0,若存在對稱方面,如果一方面可變化

原创 G - Green-Red Tree Gym - 102190G

題目鏈接:http://codeforces.com/gym/102190/attachments 題解:我們先將前5個點分別塗上紅色或者綠色,使得這兩棵樹在5個點中都是連通,並不存在自環。那麼從第6個點開始:分別找一個固定的點與該點連邊

原创 C - 不要62 HDU - 2089

杭州人稱那些傻乎乎粘嗒嗒的人爲62(音:laoer)。 杭州交通管理局經常會擴充一些的士車牌照,新近出來一個好消息,以後上牌照,不再含有不吉利的數字了,這樣一來,就可以消除個別的士司機和乘客的心理障礙,更安全地服務大衆。 不吉利的數字爲所

原创 12

                                                                           The Technology First      In my opinion, we

原创 E. Minimum Array(multiset暴力)

You are given two arrays aa and bb, both of length nn. All elements of both arrays are from 00 to n−1n−1. You can reord

原创 I - Interesting Numbers URAL - 2070

Nikolay and Asya investigate integers together in their spare time. Nikolay thinks an integer is interesting if it is a

原创 P - A Dangerous Maze (II) (期望)

You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for c

原创 C. Serval and Parenthesis Sequence(合法括號序列)

Serval soon said goodbye to Japari kindergarten, and began his life in Japari Primary School. In his favorite math clas

原创 E. Two Teams

There are nn students standing in a row. Two coaches are forming two teams — the first coach chooses the first team and

原创 G - Dice (III)

Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its fac