KYOCERA Programming Contest 2021(AtCoder Beginner Contest 200) 题解 哦淦我已经菜到被ABC吊打了. A - Century 首先把当前年份减去\(1\),对应的世纪也减去\(1\),然后我们就发现第\(0\)到\(99\)年对应第\(0\)世纪,第\(100\)到\(199\)年对应第\(1\)世纪,以此类推. 答案就是\(\lfloor \frac {N-1} {100} \rfloor\).这里\(\lfloor x \rflo…
A - Grouping 2 Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups cons…
题意:给你一个数字\(n\)和\(k\)个区间,\(S\)表示所有区间的并的集合,你目前在\(1\),每次可以从集合中选择一个数字向右移动,问有多少种方法从\(1\)走到\(n\). 题解:我们从1开始遍历,\(dp[i]\)表示走到目前走到\(i\)的方案数,再去遍历每一个集合,用\(dp[i]\)更新所有\([i+l[j],i+r[j]]\)中的点,而遍历区间我们可以用差分来\(O(n)\)的运行出来. 代码: int n,k; int l[N],r[N]; ll dp[N]; int ma…
题目链接:E - Many Operations (atcoder.jp) 题意: 给定一个数x,以及n个操作(ti,ai): 当 t = 1 时,将 x & a 当 t = 2 时,将 x | a 当 t = 3 时,将 x ^ a 然后分别打印n个数:x进行前1个操作后打印,进一步地再进行前2个操作后打印,... ,进一步地再进行前n个操作后打印. 思路: 由于x.ai 均小于 230 ,每个操作又都是位运算,那么按二进制的每位去思考的话,最多有30个位,每位的初始值只能为0.1,只要先预处…
D - Ki 题意:给一棵有根树,节点1为根,有$Q$次操作,每次操作将一个节点及其子树的所有节点的权值加上一个值,问最后每个节点的权值. 思路:dfs序再差分一下就行了. #include <bits/stdc++.h> using namespace std; ; vector<int> G[N]; int dfn[N], id, n, q, last[N], pos[N]; long long val[N], ans[N]; void dfs(int u, int fa) {…
比赛传送门 水题大赛? 全是水题啊!!! T1 ABC333 就是判断是不是两个数都是奇数就行了. 代码: #include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; if(a%2&&b%2)cout<<"Yes"; else cout<<"No"; return 0; } T2 Shiritori…
人生第一场 AtCoder,纪念一下 话说年后的 AtCoder 比赛怎么这么少啊(大雾 AtCoder Beginner Contest 154 题解 A - Remaining Balls We have A balls with the string S written on each of them and B balls with the string T written on each of them. From these balls, Takahashi chooses one…
目录 AtCoder Beginner Contest 153 题解 A - Serval vs Monster 题意 做法 程序 B - Common Raccoon vs Monster 题意 做法 程序 C - Fennec vs Monster 做法 程序 D - Caracal vs Monster 做法 程序 E - Crested Ibis vs Monster 做法 程序 F - Silver Fox vs Monster 做法 程序 感谢 AtCoder Beginner Co…
AtCoder Beginner Contest 184 题解 目录 AtCoder Beginner Contest 184 题解 A - Determinant B - Quizzes C - Super Ryuma D - increment of coins E - Third Avenue F - Programming Contest 这把怎么感觉题目都比以往的ABC水啊,拜此所赐我只是程序写得慢就排名狂掉( A - Determinant 求二阶矩阵的行列式,是小学常见自定义题目(…
AtCoder Beginner Contest 173 题解 目录 AtCoder Beginner Contest 173 题解 A - Payment B - Judge Status Summary C - H and V D - Chat in a Circle E - Multiplication 4 F - Intervals on Tree A - Payment 首先我们可以把所有不用找零的部分都付掉,这样就只剩下了\(A \mod 1000\)这样一个"\(A\)除以\(10…