摘要:
CF1036A Function Height 答案为 \(\lceil \frac{k}{n}\rceil\)。 #include<iostream> #include<cstdio> using namespace std; long long n,k; int main() { scanf(" 阅读全文
posted @ 2023-09-27 22:17
Zhou_JK
阅读(28)
评论(0)
推荐(0)
摘要:
CF1020A New Building for SIS 分类讨论 \(a,b\) 两个端点的几种情况就好了,特判 \(t_a=t_b\) 的情况。 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> usi 阅读全文
posted @ 2023-09-27 22:17
Zhou_JK
阅读(39)
评论(0)
推荐(0)
摘要:
CF1011A Stages 每次记下上一个选的位置,贪心能填就填。 #include<iostream> #include<cstdio> using namespace std; const int N=55; int n,k; char s[N]; int cnt[27]; int main( 阅读全文
posted @ 2023-09-27 22:15
Zhou_JK
阅读(14)
评论(0)
推荐(0)
摘要:
CF1008A Romaji 直接模拟。 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=105; int n; char s[N]; int main() { scanf( 阅读全文
posted @ 2023-09-27 22:15
Zhou_JK
阅读(68)
评论(0)
推荐(1)
摘要:
CF996A Hit the Lottery 直接贪心尽可能的分配到 \(k_5\),剩下的依次分配给 \(k_4,k_3,k_2,k_1\)。 #include<iostream> #include<cstdio> using namespace std; int n; int k[6]; int 阅读全文
posted @ 2023-09-27 22:14
Zhou_JK
阅读(83)
评论(0)
推荐(0)
摘要:
CF992A Nastya and an Array 答案为非零数的个数。 #include<iostream> #include<cstdio> #include<map> using namespace std; const int N=100005; int n; int a[N]; map< 阅读全文
posted @ 2023-09-27 22:14
Zhou_JK
阅读(38)
评论(0)
推荐(0)
摘要:
CF957A Tritonic Iridescence 如果原序列中有两个相同的字符,显然不合法。 如果开头或者结尾为 ?,或者有两个连续的 ?,或者一个 ? 两边的字符不同显然合法。 否则一定不合法。 #include<iostream> #include<cstdio> using namesp 阅读全文
posted @ 2023-09-27 22:13
Zhou_JK
阅读(41)
评论(0)
推荐(0)
摘要:
CF935A Fafa and his Company 大概是 \(n\) 的因数个数减一? #include<iostream> #include<cstdio> #include<cmath> using namespace std; int n; int main() { scanf("%d" 阅读全文
posted @ 2023-09-27 22:12
Zhou_JK
阅读(28)
评论(0)
推荐(0)
摘要:
交配 / Crossing 令 J 为 \(0\),O 为 \(1\),I 为 \(2\),杂交相当于是 \(c\equiv -(a+b)\pmod 3\) 可以发现最后的状态数不会超过 \(27\) 种,直接暴力线段树维护即可。 #include<iostream> #include<cstdio 阅读全文
posted @ 2023-09-27 21:58
Zhou_JK
阅读(61)
评论(0)
推荐(0)
摘要:
バブルソート 2 / Bubble Sort 2 可以发现,答案即为 \(\max\limits_{i=1}^n \sum\limits_{j=1}^{i-1}[a_j>a_i]\)。 因为是 \(\max\),所以可能成为答案只有后缀最小值,可以把式子改写成 \(\max\limits_{i=1} 阅读全文
posted @ 2023-09-27 20:57
Zhou_JK
阅读(39)
评论(0)
推荐(0)