〔主机註記〕第 46 周主机註記 (Dec.23 - Dec.29)
第 46 周主机註記 月 (Dec.23) 火 (Dec.24) 水 (Dec.25) 木 (Dec.26) 金 (Dec.27) 土 (Dec.28) 日 (Dec.29)
Codeforces Round 994 (Div. 2) A - D
冬至快乐! 2049A - MEX Destruction 如果全 0,不需要操作,否则至少需要操作一次; 任何一个序列不包含 0 的序列操作一次都会变成 0; 任何一个序列操作两次都会变成 0,因此答案不超过 2; 什么时候只需要操作一次? 所有非零的数都连续,操作这个连续的段即可,否则一次不够。 123456789101112131415161718192021222324252627282930313233343536#include <bits/stdc++.h>using namespace std;using ll = long long;int main() { int t; cin >> t; while (t--) { int n; cin >> n; deque<int> a(n); for(int i = 0; i < n; i++) { ...
Educational Codeforces Round 173 A - E
2043A - Coin Transformation 按题意模拟。 12345678910111213141516171819202122#include <bits/stdc++.h>using namespace std;using ll = long long;int main() { int t; cin >> t; while (t--) { ll x; cin >> x; ll ans = 1; while (x > 3) { x /= 4; ans <<= 1; } cout << ans << endl; } return 0;} 2043B - Digits(分类) 写 n!n!n! 次数字 ddd。所以,他得到了数字...
数据结构第十三讲:查找
數據結構第十三講:查找
〔主机註記〕第 45 周主机註記 (Dec.16 - Dec.22)
第 45 周主机註記 月 (Dec.16) 火 (Dec.17) 水 (Dec.18) 木 (Dec.19) 金 (Dec.20) 土 (Dec.21) 日 (Dec.22)
Codeforces Round 993 (Div. 4) G(有向基环树)
2044G - Medium Demon Problem G1 题意 有向图,每个点的出度为 1,有点权。每秒末,对于每条边 u→vu\to vu→v,如果 wu>0w_{u}>0wu>0,则置 wu:=wu−1, wv:=wv+1w_{u}:=w_{u}-1,\ w_{v}:=w_{v}+1wu:=wu−1, wv:=wv+1,操作后,如果某个 wu>1w_{u}>1wu>1,则置 wu:=1w_{u}:=1wu:=1。问几秒后将达到稳定。 G2 题意 有向图,每个点的出度为 1,有点权。每秒末,对于每条边 u→vu\to vu→v,如果 wu>0w_{u}>0wu>0,则置 wu:=wu−1, wv:=wv+1w_{u}:=w_{u}-1,\ w_{v}:=w_{v}+1wu:=wu−1, wv:=wv+1。问几秒后将达到稳定。 两者区别是 G1 规定操作后,如果某个 wu>1w_{u}>1wu>1,则置 wu:=1w_{u}:=1wu:=1。 ...
【MIMI 重音テト】サイエンス
音源外链来自网易云音乐,歌词翻译来自 【重音テト SV】サイエンス【MIMI】,略有修改 .responsive-iframe { position: relative; width: 100%; padding-bottom: 56.25%; /* 16:9 宽高比 */ height: 0; } .responsive-iframe iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } table { border-collapse: collapse; /* 合并边框,确保没有双线 */ border: 0; /* 设置表格边框为 0,即不显示边框 */ width: 100%; /* 根据需要设置表格宽度 */ } table tr td:first-child { font-family: YuMin; ...
数据结构第十二讲:排序
數據結構第十二講:排序
〔主机註記〕第 44 周主机註記 (Dec.9 - Dec.15)
第 44 周主机註記 月 (Dec.9) 火 (Dec.10) 水 (Dec.11) 木 (Dec.12) 尽管这游戏现在半死不活的,圈子也烂烂的,但它毕竟陪伴了很多人的童年,甚至起码改变过一些人的人生轨迹。愿它在我们的回忆中永远年轻,我们祝它八岁快乐。——@spspste 金 (Dec.13) 土 (Dec.14) 日 (Dec.15)
Codeforces Round 992 (Div. 2) A-E
2040A - Game of Division 数据范围较小,枚举 iii 即可。 12345678910111213141516171819202122232425262728293031323334353637383940414243#include <bits/stdc++.h>using namespace std;int main() { int t; cin >> t; while (t--) { int n; cin >> n; int k; cin >> k; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } int res = -1; for (int i = 0; i < n; i++)...



