标签: codeforces

25 篇文章

thumbnail
Codeforces Round 1058 (Div. 2)
链接:https://codeforces.com/contest/2160 A. MEX Partition 算法:     贪心。 思路:     无。 关键代码: void miyan() { int n; cin >> n; set<int> s; for (int i = 0; i < …
thumbnail
Codeforces Round 1057 (Div. 2)
链接:https://codeforces.com/contest/2153 A. Circle of Apple Trees 算法:     贪心。 思路:     不同元素的个数。 关键代码: void miyan() { int n; cin >> n; vector<int> a(n); for (auto &x : a) c…
thumbnail
Codeforces Round 1053 (Div. 2)
链接:https://codeforces.com/contest/2151 A. Incremental Subarray 算法:     贪心。 思路:     不难发现以下规律: 一个单调上升的子数组在数组中出现次数的取决于最后一个元素。 如果一个子数组存在下降,那么其答案必然为 [latex]1[/latex]。 关键代码: void mi…
thumbnail
Codeforces Round 1054 (Div. 3)
链接:https://codeforces.com/contest/2149 A. Be Positive 算法:     数学。 思路:     无。 关键代码: void miyan() { int n; cin >> n; vector<int> a(n); for (auto &x : …
thumbnail
Codeforces Round 1049 (Div. 2)
链接:https://codeforces.com/contest/2140 A. Shift Sort 算法:     贪心。 思路:     手玩几组样例后发现每次只能将一个 [latex]1[/latex] 换到正确位置,直接找有几个 [latex]1[/late…
thumbnail
Codeforces Round 1047 (Div. 3)
链接:https://codeforces.com/contest/2137 A. Collatz Conjecture     这题读假了以为是找出全部的可能值。 算法:     模拟。 思路:     无。 关键代码: voi…