11.22 #不孤不咕
1001.A+B Problem
1002.【样题0】猜数
1003.【样题1】A-B Problem
1004.【样题2】人以群分
1005.【样题3】最小环
1006.【样题4】再猜一次
1007.【样题5】情人节
- 1008.【样题6】组合数问题
- 凭本事打的表!!
-
- 1009.【样题7】随机动态图
1010.Welcome
- 1011.Deadline Management
- 输入不保证有序
pair<int, int>t[N];
- 输入不保证有序
- 1012.撕纸条
- 与顺序无关
- 不用保存数组
- 与顺序无关
-
- 1013.Counter-Strike: Global Offensive
-
- 1014.子段和问题
- 1015.加减乘除
- 函数指针数组
bool (*check[4])(int, int) = { check1,check2,check3,check4 };
- 4个if也可
- 用一张牌去匹配另一张牌
- 函数指针数组
-
- 1016.矩形
-
- 1017.流星雨
-
- 1018.异或
11.25 #11
-
- A - Ascending Rating
-
- B - Cut The String
-
- C - Dynamic Graph Matching
- D - Euler Function
- i f φ ( x ) ∉ 合 数 if\ \varphi(x)\not\in 合数 if φ(x)∈合数
- x = ∏ p i a i x=\prod p_i^{a_i} x=∏piai
- φ ( x ) = ∏ p i a i − 1 ∗ ( p i − 1 ) \varphi(x)=\prod p_i^{a_i-1}*(p_i-1) φ(x)=∏piai−1∗(pi−1)
- ∴ p i − 1 ∈ 非 合 数 \therefore p_i-1\in 非合数 ∴pi−1∈非合数
- ∴ p i = = 2 或 3 \therefore p_i==2或3 ∴pi==2或3
- x = = 1 或 2 或 3 或 4 或 6 x==1或2或3或4或6 x==1或2或3或4或6
-
- E - Find The Submatrix
- F - Grab The Tree
- 后者没有选择
- 异或和永远相等
- 先手永远不输
-
- G - Interstellar Travel
-
- H - Monster Hunter
-
- I - Random Sequence
-
- J - Rectangle Radar Scanner
-
- K - Transport Construction
- L - Visual Cube
- 按顺序打印
-
- M - Walking Plan
11.29 #12
- A - Buy and Resell
- 贪心
- 在待买和已卖的小根堆中找最小的买入卖出
- 贪心
-
- B - Congruence equation
- C - Dream
- 费马小定理
- 重定义加法和乘法
- ( n + m ) p = n p + m p (n+m)^p=n^p+m^p (n+m)p=np+mp
- 可行解: ( n + m ) p ≡ n p + m p ≡ n + m ( m o d p ) (n+m)^p\equiv n^p+m^p\equiv n+m(mod\ p) (n+m)p≡np+mp≡n+m(mod p)
- 费马小定理
- D - Find Integer
- 费马大定理
- 整数 n > 2 n>2 n>2时,关于 x , y , z x, y, z x,y,z的方程 x n + y n = z n x^n + y^n = z^n xn+yn=zn没有正整数解
- 在1995年,英国数学家安德鲁·怀尔斯宣布自己证明了费马大定理
- 费马大定理
-
- E - GuGu Convolution
-
- F - Neko and Inu
-
- G - Neko’s loop
-
- H - Search for Answer
- I - Tree and Permutation
- 左*右
- n ! ∗ ( n − 1 ) C n 2 = 2 ∗ ( n − 1 ) ! \frac{n!*(n-1)}{C_n^2}=2*(n-1)! Cn2n!∗(n−1)=2∗(n−1)!
-
- J - YJJ’s Salesman
12.2 #13
- A - Mischievous Problem Setter
for (int i = 0; i < n; i++) { if (m >= a[i].time) { ++ans; m -= a[i].time; } else break;//重点 }
-
- B - Balance of the Force
-
- C - GCD Land
-
- D - Cube
-
- E - Mr. Panda and Cactus
-
- F - Cones
- G - Pastoral Life in Stardew Valley
-
先
看
行
先看行
先看行
- 空 − 草 − 稻 草 人 − 草 − 空 空-草-稻草人-草-空 空−草−稻草人−草−空
- 至 少 一 个 : 草 , 稻 草 人 至少一个:草,稻草人 至少一个:草,稻草人
- 至 少 零 个 : 空 至少零个:空 至少零个:空
- ∴ C n + 1 4 \therefore C_{n+1}^4 ∴Cn+14
-
列
同
理
列同理
列同理
- ∴ C n + 1 4 ⋅ C m + 1 4 \therefore C_{n+1}^4\cdot C_{m+1}^4 ∴Cn+14⋅Cm+14
-
先
看
行
先看行
先看行
-
- H - Game on the Tree
-
- I - Cockroaches
-
- J - Mr. Panda and Sequence Puzzle
- K - Mr. Panda and Kakin
- e x g c d − Y Y D S exgcd-YYDS exgcd−YYDS
-
分
解
n
=
p
∗
q
,
只
要
n
%
p
=
=
0
分解 n=p*q,只要n\%p==0
分解n=p∗q,只要n%p==0
inline void exgcd(ll a, ll b, ll& x, ll& y) { if (!b)x = 1, y = 0; else exgcd(b, a % b, y, x), y -= a / b * x; }
- L - Ultra Weak Goldbach’s Conjecture
- 法 1 : n − 8 或 n − 9 , 然 后 G o l d b a c h ′ s c o n j e c t u r e 法1:n-8或n-9,然后Goldbach's\ conjecture 法1:n−8或n−9,然后Goldbach′s conjecture
- 法 2 : 找 较 大 的 素 数 , 然 后 在 小 范 围 内 G o l d b a c h ′ s c o n j e c t u r e 法2:找较大的素数,然后在小范围内Goldbach's\ conjecture 法2:找较大的素数,然后在小范围内Goldbach′s conjecture