摘要: A. QAQ 法1 由于数据范围比较小,可以三层循环求解 法2 每一个A的下标存到数组v中,开个cnt数组记录每个位置前面有多少个'Q',利用前缀和可以求得范围内'Q'的数量 $$ ans = \sum_{i = 0}^{v.size()-1} cnt[i - 1] × (cnt[n] - cnt[ 阅读全文
posted @ 2023-03-11 11:38 Keith- 阅读(20) 评论(0) 推荐(0) 编辑
摘要: A. Stone Game 代码 点击查看代码 #include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int t; cin >> t; while(t -- ){ int n; 阅读全文
posted @ 2023-03-11 10:41 Keith- 阅读(12) 评论(0) 推荐(0) 编辑
摘要: GDUT 2022 grade Qualifying # 3总结 A. Takeaway 模拟 B. Easy Math Problem https://codeforces.com/group/jv8nZnsO6t/contest/431471/problem/B 找规律,比赛时以为是数论题怎么也 阅读全文
posted @ 2023-03-11 00:05 Keith- 阅读(18) 评论(0) 推荐(0) 编辑