原创 AtCoder Beginner Contest 169

AtCoder Beginner Contest 169 A - Multiplication 1 題目描述 輸出A * B 代碼 #include <iostream> #include <cstdio> #include <c

原创 ICPC NEAU Programming Contest 2020-D.旅遊 (倍增)

https://www.jisuanke.com/contest/9342/challenges 題目描述 皮皮準備去旅遊,共有n個景點可以選擇,景點編號爲1~n,每個景點都有一個“美觀值”ai​。共有m次查詢,對於第i次查詢,皮

原创 CF909C Python Indentation (dp)

CF909C Python Indentation 洛谷鏈接 思路借鑑自:鏈接 題目描述 In Python, code blocks don’t have explicit begin/end or curly braces t

原创 洛谷P3177 [HAOI2015]樹上染色 (樹上揹包)

鏈接 : [HAOI2015]樹上染色 題目描述 有一棵點數爲 n 的樹,樹邊有邊權。給你一個在 0∼n 之內的正整數 k ,你要在這棵樹中選擇 k 個點,將其染成黑色,並將其他 的 n−k 個點染成白色。將所有點染色後,你會獲得

原创 Codeforces Round #636 (Div. 3)

Codeforces Round #636 (Div. 3) A. Candies 題目大意 給定一個n,使得x + 2x + 4x + … + 2^k-1 x = n 成立,求x,且滿足k > 1。 Solution 求一個係

原创 Educational Codeforces Round 85 [Rated for Div. 2]

Educational Codeforces Round 85 [Rated for Div. 2] A. Level Statistics 給出n組(pi,ci),每輪可以選擇給p和c同時+1,或者只給p 進行+1,兩組數據之間

原创 洛谷 P2622 關燈問題II (狀壓bfs)

P2622 關燈問題II luogu鏈接 題目描述 現有n盞燈,以及m個按鈕。每個按鈕可以同時控制這n盞燈——按下了第i個按鈕,對於所有的燈都有一個效果。按下i按鈕對於第j盞燈,是下面3中效果之一:如果a[i][j]爲1,那麼當這

原创 Poj 2029 Get Many Persimmon Trees(二維前綴和/二維樹狀數組)

Poj 2029 Get Many Persimmon Trees 鏈接 Description Seiji Hayashi had been a professor of the Nisshinkan Samurai Schoo

原创 Zoj-4019 Schrödinger's Knapsack(線性dp)

Schrödinger’s Knapsack Time Limit: 1000 ms Memory Limit: 65536 KB 鏈接 zoj 4019 題目描述 有兩類物品,價值分別爲k1,k2,數量分別爲n,m,給出每個物品

原创 Zoj 4027 Sequence Swapping (線性dp)

Sequence Swapping Time Limit: 1000 ms Memory Limit: 65536 KB 題意 給出一個括號序列,每個括號對應一個值,當相鄰兩個括號k爲’ ( ‘,k+1爲’ ) '

原创 CodeForces - 1312E Array Shrinking (區間dp)

Array Shrinking 題目描述 You are given an array a1,a2,…,an. You can perform the following operation any number of times

原创 Codeforces Round #627 (Div. 3) D - Pair of Topics

**Pair of Topics ** 題目描述 The next lecture in a high school requires two topics to be discussed. The i-th topic is i

原创 Luogu P2657 [SCOI2009]windy數 (數位dp)

P2657 [SCOI2009]windy數 洛谷2657 windy數 題目描述 windy定義了一種windy數。不含前導零且相鄰兩個數字之差至少爲2的正整數被稱爲windy數。 windy想知道, 在A和B之間,包括A和B,

原创 Codeforces Round #627 (Div. 3) F - Maximum White Subtree (樹形dp)

**F - Maximum White Subtree ** 題目描述 You are given a tree consisting of n vertices. A tree is a connected undirected