原创 水篇快速冪

一,快速冪:取冪指數的二進制,從低到高尋找,當前位= 1時,加上當前位對應的值,複雜度順利降到O(logn) //b=1000001101(二進制) //a^b=a^0+a^2+a^3+a^9 //O(log2(b)) typedef

原创 暑假練習記錄(三):2016 CCPC Final

一,The Third Cup is Free 水題,排序,,,, #include <cstdio> #include <algorithm> using namespace std; const int maxn=1e5+5; in

原创 Codeforces上藍紀念

今天 某蒟蒻 經過了無數次翻車 codeforces終於也上藍了  2019年寒假,開始codeforces之旅,雖然一年時間纔到了大佬們隨手可到的藍名,但還是很高興,一年時間,開始的幾場場場掉 分,後來勉強到了集訓隊,大大小小的比賽

原创 JavaScript操作之name作爲變量名

一、問題:        在JS中,定義一個全局數組的時候,如果使用的數組名爲 name ,那麼定義的數組將自動轉化爲字符 就像下面的代碼,不論你給name賦什麼類型的值,最後輸出都是 string 二、查資料:        在java

原创 線段樹模板

#include <bits/stdc++.h> using namespace std; #define maxn 100007 //元素總個數 #define ls l,m,rt<<1 #define rs m+1,r,rt<<1

原创 數學模板整理

/***************** 數學整理 *****************/ #include <bits/stdc++.h> using namespace std; #define ll long long const in

原创 暑假練習記錄(四):2017 CCPC Final

一,Dogs and Cages 披着數論外皮的水(nan)題(si),狗狗進籠子,進錯籠子的狗狗的期望:n-1,打表許能找出規律來???,,,, #include <bits/stdc++.h> using namespace std

原创 暑假練習記錄(四):2016 CCPC Final

一,The Third Cup is Free 水題,排序,,,, #include <cstdio> #include <algorithm> using namespace std; const int maxn=1e5+5; in

原创 暑假練習記錄(二)2014廣州賽區

一,Dogs' Candies 暴力,開long long ,莫名其妙的wa,莫名其妙的ac #include <bits/stdc++.h> using namespace std; #define ll long long cons

原创 暑假練習記錄(一):2014北京區域賽

一,A Curious Matt 水題一道,排序 #include <cstdio> #include <algorithm> #include <cmath> using namespace std; const int maxn=1

原创 並查集——父親兒子傻傻分不清

算法板子記錄第一天:並查集(找爸爸) 並查集,處理不相交集的合併和查詢的數據結構,俗稱:找爸爸 最先寫這個數據結構就是他使用的存儲結構最簡單,一個數組搞定,當然有別的需要可以另加嘛 int num; //節點數量 int fa[

原创 HDU1097 快速冪取模運算

A hard puzzle Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Descriptionlcy gives a har