摘要: ビルの飾り付け 4 / Building 4 令 \(f_{i,0/1,j}\) 表示到第 \(i\) 位,第 \(i\) 位选的是 \(A_i/B_i\),\(1\sim i\) 选了 \(j\) 个 \(A_i\) 是否合法。 可以发现,对于一个 \(f_{i,0/1,j}\),合法的 \(j\ 阅读全文
posted @ 2023-09-27 20:37 Zhou_JK 阅读(34) 评论(0) 推荐(0)
摘要: 試験 / Examination 直接三维偏序。 #include<iostream> #include<cstdio> #include<cstring> #include<numeric> #include<algorithm> using namespace std; const int N= 阅读全文
posted @ 2023-09-27 20:36 Zhou_JK 阅读(26) 评论(0) 推荐(0)
摘要: A - Subscribers 最小值为 \(\min(A,B)\),最大值为 \(\max(A+B-n,0)\)。 #include<iostream> #include<cstdio> using namespace std; int n,A,B; int main() { scanf("%d% 阅读全文
posted @ 2023-09-27 20:23 Zhou_JK 阅读(14) 评论(0) 推荐(0)
摘要: A - Beginning 排序以后判断一下是否为 \(1,4,7,9\) 即可。 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=10; int a[N]; int m 阅读全文
posted @ 2023-09-27 20:21 Zhou_JK 阅读(16) 评论(0) 推荐(0)
摘要: A - Anti-Adjacency 合法的条件即为 \(k\leq \lceil \frac{n}{2} \rceil\)。 #include<iostream> #include<cstdio> using namespace std; int n,k; int main() { scanf(" 阅读全文
posted @ 2023-09-27 19:13 Zhou_JK 阅读(19) 评论(0) 推荐(0)
摘要: A - Nickname 直接输出前三个字符。 代码: #include<iostream> #include<cstdio> using namespace std; const int N=25; char s[N]; int main() { scanf("%s",s+1); printf(" 阅读全文
posted @ 2023-09-27 19:12 Zhou_JK 阅读(35) 评论(0) 推荐(0)
摘要: C - Stones 枚举分界点爆算即可。 #include<iostream> #include<cstdio> using namespace std; const int N=200005; int n; char s[N]; int sum[N][2]; int main() { scanf 阅读全文
posted @ 2023-09-27 19:11 Zhou_JK 阅读(23) 评论(0) 推荐(0)
摘要: A - Hitachi String 满足条件的串即为串长为偶数且相邻两个均为为 hi,直接判断即可。 代码: #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=15; int 阅读全文
posted @ 2023-09-27 19:10 Zhou_JK 阅读(19) 评论(0) 推荐(0)
摘要: A - Study Scheduling 先算出总时间,然后在减去 \(K\) 就好了。 代码: #include<iostream> #include<cstdio> using namespace std; int h1,m1,h2,m2,k; int main() { scanf("%d%d% 阅读全文
posted @ 2023-09-27 19:10 Zhou_JK 阅读(15) 评论(0) 推荐(0)
摘要: A - Sum of Two Integers 分奇偶讨论一下就好了,答案为 \(\lfloor \frac{n-1}\{2\}\rfloor\)。 #include<iostream> #include<cstdio> using namespace std; int n; int main() 阅读全文
posted @ 2023-09-27 19:09 Zhou_JK 阅读(19) 评论(0) 推荐(0)