题目传送门:G - Scalene Triangle Area (atcoder.jp) 题意: 给定大小为N*N的OX矩阵,若矩阵的(s,t)处为O,其覆盖范围为:满足以下条件的所有位置(i,j) s <= i && t <= j (i - s) + (j - t) / 2 < M 再给出Q次询问,对于每次询问(x,y),要求给出对应位置被覆盖了多少次. 思路:imos 不妨先考虑 n = 7, m = 3, 且仅在左上角处为 'O' .那么矩阵上每个位置被覆盖次数如T…
目录 C - 1111gal password D - ABC Transform E - (∀x∀) F - Black and White Rooks G - Range Pairing Query Ex - Random Painting C - 1111gal password C 题可不可以算给 Beginner 打开了数数的大门啊. 定义状态 \(f_{i,j}\) 表示长度为 \(i\) 的符合题目要求的数字,结尾数位是 \(j\) 的有多少个.那么递推式就是: \[f_{i,j}…
AtCoder Beginner Contest 136 题目链接 A - +-x 直接取\(max\)即可. Code #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b; cin >> a >> b; cout &…
人生第一场 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 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…
A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E869120's and square1001's 16-th birthday is coming soon.Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces. E869…