原创 Codeforces 1027D Mouse Hunt

Medicine faculty of Berland State University has just finished their admission campaign. As usual, about 80% of applica

原创 Codeforces 1025B Weakened Common Divisor

During the research on properties of the greatest common divisor (GCD) of a set of numbers, Ildar, a famous mathematici

原创 hihocoder 1048 Hamiltonian Cycle 狀態壓縮dp入門題5

描述 Given a directed graph containing n vertice (numbered from 1 to n) and m edges. Can you tell us how many different H

原创 ZOJ 4712 Modular Inverse (乘法逆元)

The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is eq

原创 hdu 3065 病毒侵襲持續中

Problem Description 小t非常感謝大家幫忙解決了他的上一個問題。然而病毒侵襲持續中。在小t的不懈努力下,他發現了網路中的“萬惡之源”。這是一個龐大的病毒網站,他有着好多好多的病毒,但是這個網站包含的病毒很奇怪,這些病毒的

原创 hdu 2896 病毒侵襲

Problem Description 當太陽的光輝逐漸被月亮遮蔽,世界失去了光明,大地迎來最黑暗的時刻。。。。在這樣的時刻,人們卻異常興奮——我們能在有生之年看到500年一遇的世界奇觀,那是多麼幸福的事兒啊~~ 但網路上總有那麼些網站,

原创 hdu 2662 Coin

Problem Description Moon has many coins, but only contains two value types which is 5 cents and 7 cents, Some day he fi

原创 HDU 6375 度度熊學隊列

danshlem Description 度度熊正在學習雙端隊列,他對其翻轉和合併產生了很大的興趣。 初始時有 N 個空的雙端隊列(編號爲 1 到 N ),你要支持度度熊的 Q 次操作。 ①1 u w val 在編號爲 u 的隊列里加入一