原创 CD 路徑記憶

You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is on CDs. You nee

原创 Codeforces-Round-630-Div-2

個人博客:https://voids5.cn/2020/04/01/Codeforces-Round-630-Div-2/ 題目鏈接:https://codeforces.com/contest/1332 A. Exercisin

原创 Educational Codeforces Round 84 (Rated for Div. 2)

個人博客:voids5.cn A. Sum of Odd Integers 題意:兩個數n、k,判斷n是否能被產分成k個不同的素數 解題思路:首先n,k奇偶性要相同,然後根據求和公式k個奇數相加最小數爲k2,故n>=k2 Code

原创 2019CCPC江西省賽

A-Cotree 題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=6567 題目大意:有兩棵樹,在兩個樹間連一條邊,求兩兩節點之間的距離和 解題思路:兩棵樹分別稱爲a,b樹,在a,b上

原创 Labyrinth

Labyrinth The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divid

原创 HPU第二次個人訓練

HPU第二次個人訓練 A.Engines 題目鏈接:https://abc139.contest.atcoder.jp/tasks/abc139_f?lang=en 題目大意:給你n個位置,依次走到這些點,問在此過程中距離原點最遠

原创 STL

https://blog.csdn.net/qq_36136497/article/details/81041863

原创 HPU個人訓練3

A - Kefa and Park 題目鏈接:http://codeforces.com/problemset/problem/580/C 題目大意:kefa住在編號爲1的房子裏,現在kefa要去餐廳,餐廳位於樹的葉子節點,現在給

原创 Rails

波普什市有一個著名的火車站。那裏的鄉村有着令人難以置信的丘陵。這個車站建於上個世紀。不幸的是,當時的資金極爲有限。只能建立一條地面軌道。此外,事實證明,空間站可能只是一個死衚衕(見圖),由於缺乏可用的空間,它只能有一個軌道。 當

原创 Roads in the North

Roads in the North Building and maintaining roads among communities in the far North is an expensive business. Wit

原创 poj 2406 Power Strings

Sample Input abcd aaaa ababab . Sample Output 1 4 3 解題思路:需要用到週期串這個東西,週期 period=l - nxt[l-1], 其餘的就是kmp了,大佬教的kmp和網上大多

原创 杭電多校Day3 1006 Fansblog

原文鏈接:https://blog.csdn.net/cloudy_happy/article/details/99571628 原題鏈接:http://acm.hdu.edu.cn/s

原创 CodeForces-913C 派對檸檬水

原題鏈接:http://codeforces.com/problemset/problem/913/C Input 4 12 20 30 70 90 Output 150 Input 4 3 10000 1000 100 10 O

原创 HDU-1796 How many integers can you find

原題傳送門:http://acm.hdu.edu.cn/showproblem.php?pid=1796 Sample Input 12 2 2 3 Sample Output 7 題目大意:給你兩個整數n和m,m是一個整數集合的

原创 POj-1091 跳蚤

原題鏈接:http://poj.org/problem?id=1091 題目大意:給你兩個數n和m;總共有m^n張卡片,每張卡片上有n+1個數字,然後根據卡片上的數字可以向左跳也可以向右跳,每個數字跳的次數任意,直到跳達剛開始左邊