摘要: A. 买爱心气球(博弈) 输入 3 3 1 3 3 5 2 输出 Alice Alice Bob 点击查看代码 #include<bits/stdc++.h> #define int long long #define endl "\n" using namespace std; const int 阅读全文
posted @ 2023-09-25 01:24 chfychin 阅读(21) 评论(0) 推荐(0)
摘要: B. 序列的与和(二进制搜索) 输入 3 6 2 4 1 输出 0 说明 对于样例,其子序列有: [2]:其与和为10(二进制),仅包含一个1,不为6,所以对答案贡献为零 [2,4]:与和为 0 ,同理,贡献为零。 [2,1]:与和结果0 [2,4,1]:与和结果0 [4]:与和结果100 [4,1 阅读全文
posted @ 2023-09-25 01:01 chfychin 阅读(26) 评论(0) 推荐(0)
摘要: C. 计数问题(因素相乘相等,递推+dp) 输入 4 输出1 8 说明 八种方案分别为(1,1,1,3),(1,1,3,1),(1,2,1,2),(1,2,2,1),(1,3,1,1),(2,1,1,2),(2,1,2,1),(3,1,1,1) 输入2 1 输出2 0 点击查看代码 #include 阅读全文
posted @ 2023-09-25 00:44 chfychin 阅读(39) 评论(0) 推荐(0)
摘要: A. 自动收小麦机(循环并查集) 输入样例1 4 1 2 1 1 4 5 2 2 2 3 4 输出样例1 10 说明 在第4格放出水流后,水流会流向第3格,由于第3格高度比第4格低,所以水流继续向左流向第2格,因为平地水流只能流2格,所以到达第2格后水流停止,收获的小麦数量为1 + 4 + 5 = 阅读全文
posted @ 2023-09-25 00:20 chfychin 阅读(42) 评论(0) 推荐(0)
摘要: A. 你也喜欢数学吗?(数学公式,欧拉函数推理) 输入1 1 输出1 1 输入2 3 输出2 10 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; const int p = 1e9 + 7; sig 阅读全文
posted @ 2023-09-24 23:53 chfychin 阅读(40) 评论(0) 推荐(0)