原创 NCPC 2014 H Clock Pictures(KMP)

題意:給出兩個時鐘上相對於某個固定位置的n個點的距離,判斷兩鍾是否是同一時刻。 思路:排序後,找相鄰之差,然後kmp匹配。 #include <bits/stdc++.h> using namespace std; const int

原创 CSU1576---Catalan Square(卡特蘭數&&大整數)

思路: 關於卡特蘭數: 遞推公式:C(n)=C(n-1)*((4*n-2)/(n+1)); import java.math.BigInteger; import java.util.*; public class Main {

原创 HDU - 2102 - A計劃 (BFS)

題意: 兩層地圖,只有通過時空傳輸機才能在兩層之間移動,問能否在規定時間移動到'P' #include <iostream> #include <queue> #include <string.h> using namespace st

原创 Gym - 100829C - The Fox and the Owl(模擬&& 思維)

題意: 給你一個數n,求位數和比n的位數和大一的且與n最接近的的比n小的數。 思路: 見註釋 #include <bits/stdc++.h> using namespace std; string s,ss; const int m

原创 Gym - 101170B - British Menu (tarjan縮點 + 拓撲最長路)

#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 +10; int n,m,ans; vector<int> e[maxn],ee[maxn],vec[

原创 換博客通知!!!

新博客地址:https://healer.top/

原创 Gym - 102040F - Path Intersection (樹鏈剖分)

類似 hdu3966 #include <bits/stdc++.h> using namespace std; const int maxn = 10000+10; struct Edge { int to,next; } e