原创 bzoj2986 Non-Squarefree Numbers (莫比烏斯函數)

傳送門:http://www.lydsy.com/JudgeOnline/problem.php?id=2986 首先能想到二分答案,然後判斷1~X中有多少個squarefree,這裏用莫比烏斯函數來容斥即可。 #include

原创 C++ 01 —— 重載

C++明天考試,複習一波 重載的作用域 我們參考下C++primer上的例子 string read(); void print(const string&); void print(double); void fooBar(in

原创 C++ 05 —— 析構函數

源碼 // 05Destructor.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "ios

原创 2018 區域賽前訓練

BZOJ bzoj5301 [Cqoi2018]九連環 莫隊 bzoj5442 [Ceoi2018]Global warming 考慮轉換問題,對於一個區間 [l,r] 的增加,等價於對 [l,n]的增加。對於一個區間 [l,r] 的

原创 C++ 19 —— 模板

源碼 // 19Template.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostream

原创 C++ 14 —— 私有繼承

源碼 // 14Inhe_private.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostr

原创 2017 ACM暑期特訓

upd 所有代碼可以參見我的github:https://github.com/xaphoenix/codeforces codeforces 現在已經完成:6 Round 422 Div2A I’m bored with life

原创 C++ 11 —— 繼承

源碼 // 11Inhe_Concept.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostr

原创 2017 組隊賽補題

已完成: 42 2017 2017 Multi-University Training Contest - Team 9 [10/10] 2017 Multi-University Training Contest - Team 10

原创 C++ 12 —— 初始化順序

源碼 // 12Inhe_Init_list.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "ios

原创 2017 Multi-University Training Contest - Team 10

A. Admiral [jds] 數據很小,頭尾各處理一半。 B. Array Challenge [zmy] 通過找規律可以得到 Fn=7∗Fn−1−4∗Fn−2 矩陣倍增 C. Boring Game [zmy] 對於二維的

原创 2017 ACM/ICPC Asia Regional Urumqi Online

A. Banana [wbr] 三層for循環。 B. Out-out-control cars [wbr] 很簡單的計算幾何,換算成相對參考系之後就是判斷射線與線段相交的老套問題。有兩個坑點:其一是開始時刻可能重疊。其二是double會

原创 2017 CCPC - Online

A. Vertex Cover [zmy] 二分圖,貪心構造。 B. Party [zmy] 對於每個詢問我們處理一遍。首先有一個這樣的性質:如果紙上寫了男生集合X ,女生集合Y ,如果X 在Y 在gi 倍數的子圖中均存在一個完備匹配,那

原创 2017 Multi-University Training Contest - Team 9

A. Big binary tree [zmy] 每次修改一個點,修改其父親所有節點的mx[x] 值,即向下走的最大距離。查詢時,我們考慮 dp 的過程,先計算兩個子樹的結果,然後再向上推,計算向上路徑的最大長度。思路比較簡單。但是代碼技

原创 C++ 15 —— 多態

源碼 // 15Poly_Upcasting.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "ios