AtCoder Beginner Contest 144 题解】的更多相关文章

传送门 $cf$ 自闭了,打 $abc$ 散散心 A - 9x9 ...这个有什么好讲的吗,题目看懂就会做了 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std; typedef long long ll; inline int read() { ,f=; char ch=getc…
人生第一场 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 177 题解 目录 AtCoder Beginner Contest 177 题解 A - Don't be late B - Substring C - Sum of product of pairs D - Friends E - Coprime F - I hate Shortest Path Problem A - Don't be late 问你能不能在时间\(T\)内用不高于\(S\)的速度走过\(D\)的路程,转化为判断\(ST\)…
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…
AtCoder Beginner Contest 172 题解 目录 AtCoder Beginner Contest 172 题解 A - Calc B - Minor Change C - Tsundoku D - Sum of Divisors E - NEQ F - Unfair Nim A - Calc 程序如下(真的有人需要嘛): #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdi…
AtCoder Beginner Contest 169 题解 这场比赛比较简单,证明我没有咕咕咕的时候到了! A - Multiplication 1 没什么好说的,直接读入两个数输出乘积就好了. #include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; cout<<a*b; return 0; } B - Multiplication 2 让你连乘,同时在答案…
目录 AtCoder Beginner Contest 148 题解 前言 A - Round One 题意 做法 程序 B - Strings with the Same Length 题意 做法 程序 C - Snack 题意 做法 程序 D - Brick Break 题意 做法 程序 E - Double Factorial 题意 做法 程序 F - Playing Tag on Tree 题意 做法 程序 结束语 AtCoder Beginner Contest 148 题解 前言 包…
总的来说,这次的题目比较水,然而菜菜的我并没有把所有题目都做完,话不多说,直接来干货: A:Next Alphabet 题目链接:https://atcoder.jp/contests/abc151/tasks/abc151_a 题目描述:Given is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order. 大致解读:给你一个小写字母,输出这个小写字母…
题目链接:https://abc115.contest.atcoder.jp/ A Christmas Eve Eve Eve 题目: Time limit : 2sec / Memory limit : 1024MB Score : 100 points Problem Statement In some other world, today is December D-th. Write a program that prints Christmas if D=25, Christmas E…
目录 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}…
题目链接:https://atcoder.jp/contests/abc120 A Favorite Sound 分析:答案为. 代码: #include <iostream> using namespace std; int main() { int a, b, c; cin>>a>>b>>c; cout<<min(b / a, c)<<endl; ; } B K-th Common Divisor 分析:A.B范围很小,枚举即可.…
题目链接:https://atcoder.jp/contests/abc121 A White Cells 分析:题目数据规模很小,直接暴力修改都可以.或者可以推出公式. 代码: #include <iostream> #include <cstdio> using namespace std; int main() { ][] = {}; int H, W, h, w; scanf("%d %d", &H, &W); scanf("%…
https://atcoder.jp/contests/abc144/tasks/abc144_c #include<bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; long long min = (long long)1e18; ; i <= sqrt(n); i++) { && ((n/i) + i - ) < min) { min = (i + (n/i…
目录 G - Modulo Shortest Path H - King's Tour 因为偷懒就只写G和H的题解了. G - Modulo Shortest Path 首先可以观察到对于一条从点\(i\)到点\(j\)的边,权值只有两种:\(A_i+B_j\)和\(A_i+B_j-M\). 那么我们假如把点按照\(B\)升序排成一列,那么当中的一个点肯定只会向前半部分连权值为\(A_i+B_j\)的边,后半部分连权值\(A_i+B_j-M\)的边. 我们可以把一个点拆成入点和出点(此时仍旧按照…
A.当a=1就把a改成14,b=1就把b改成14,然后比较a,b大小即可. #include <iostream> #include <algorithm> #include <cstdio> using namespace std; int a, b; int main() { cin >> a >> b; if(a==1) a=14; if(b==1) b=14; cout << ((a>b)?"Alice&quo…
总结 第一次 \(AK\ ABC\) 的比赛,发一个截图纪念一下 A - Heavy Rotation 题目大意 一个人一开始穿白衣服,一天后换成黑衣服,再过一天又换成白衣服,问第 \(n(n \leq 30)\) 天这个人穿什么颜色的衣服 分析 当 \(n\) 为奇数时输出 \(Black\),否则输出 \(White\) 代码 #include<cstdio> #include<cstring> #include<algorithm> #include<cma…
A B 过水,略... C 统计长度为k的区间的最多本质不同的数.用尺取法维护下左右指针就可以了.调了许久的原因是更新答案时出现了问题. 当我移动指针时,我们应该移动一个就更新一个,而不是将移动与更新分离.这里就写到这了. D 遇到这种有绝对值的题,最好的做法还是分类讨论将绝对值拆开. 拆开后就会发现可以用二维前缀和的方式保留当前子矩阵的max,之后扫一遍即可. 比赛时光记录左边的矩阵了忽略了右边的矩阵......还是思维上的漏洞啊 E 真的是光明正大的用图论的背景考察数论的知识.根据克鲁斯卡尔…
A 题意 问\(x,y\)相差是否小于\(3\) #include<iostream> #include<cstdio> #include<cmath> #define ll long long ll x,y; int main(){ scanf("%lld%lld",&x,&y); if(abs(y - x) < 3) puts("Yes"); else puts("No"); } B…
掉大分力(悲 A - ^{-1} 直接模拟. #include<bits/stdc++.h> #define IOS ios::sync_with_stdio(false) #define TIE cin.tie(0),cout.tie(0) #define int long long using namespace std; int n,a[200005],x,ans; signed main(){ IOS;TIE; cin>>n>>x; for(int i=1;i&…
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…
AtCoder Beginner Contest 238 \(A - F\) 题解 A - Exponential or Quadratic 题意 判断 \(2^n > n^2\)是否成立? Solution 当 \(n\) 为 2,3,4 的时候不成立,否则成立 Code #include <bits/stdc++.h> using namespace std; using LL = long long; int main() { int n; cin >> n; bool…
小兔的话 欢迎大家在评论区留言哦~ AtCoder Beginner Contest 168 A - ∴ (Therefore) B - ... (Triple Dots) C - : (Colon) D - .. (Double Dots) E - ∙ (Bullet) 简单题意 小兔捕获了 \(N\) 条不同的沙丁鱼,第 \(i\) 条沙丁鱼的 美味程度 和 香味程度 分别是 \(A_i\) 和 \(B_i\) 她想在这些沙丁鱼中选择 一条 或者 多条 放入冷冻箱:但是必须保证沙丁鱼的选择是…
AtCoder Beginner Contest 137 F 数论鬼题(虽然不算特别数论) 希望你在浏览这篇题解前已经知道了费马小定理 利用用费马小定理构造函数\(g(x)=(x-i)^{P-1}\) \[x=i,g(x)=0\] \[x\ne i ,g(x)=1\] 则我们可以构造 \[f(x)=\sum^{i=0}_{P-1}(-a_i*(x-i)^{P-1}+a_i)\] 对于第\(i\)条式子当且仅当\(a_i=1 \ and \ x=i\)时取到\(1\) 代码写的比较奇怪 const…
A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contest, AtCoder Beginner Contest, is abbreviated as ABC. When we refer to a specific round of ABC, a three-digit number is appended after ABC. For example,…
AtCoder Beginner Contest 224 A - Tires 思路分析: 判断最后一个字符即可. 代码如下: #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s; cin >> s; string temp; if (s[s.size() - 1] == 'r') { cout <…
AtCoder Beginner Contest 223 A是纯纯的水题,就不说了 B - String Shifting 思路分析 我真的sb,一开始想了好久是不是和全排列有关,然后读了好几遍题目也没有想法. 最后看了眼数据范围S串的长度为1000,\(O(N^2)\)是可以过的. 然后我是这样想的,对于每一个位置都有可能成为答案的第一位,对于原串在它后面的字符在新串中不改变,在它前面的字符接在最后即可,然后对于每一个位置放在第一位构成字符串存起来,最后sort得到答案. 看了眼别人的做法,比…
Aising Programming Contest 2022(AtCoder Beginner Contest 255) - AtCoder E - Lucky Numbers 题意: 给两个数组a,b,构成一个S数组,保证S[i]+S[i]+1==a[i],问S数组中出现的元素中,与b数组相同的最多有几个. 题解: 首先要知道,你确定了这个数组中的某一个值,那么其他的值也就确定了,所以,我们可以让最少有一个相同的,所以每个位置遍历b数组的几种数字. 首先我们构成一个第一位为0的S数组,然后可…
AtCoder Beginner Contest 260 - AtCoder D - Draw Your Cards 题意:N张卡牌数字 1-n,以某种顺序排放,每次拿一张,如果这一张比前面某一张小(不是最大的) ,就把它放在比他大的牌中数字最小的,如果没有就单独放在第一个位置,当某个位置的牌数达到k张,就将他们拿走,问最后每张牌都会在第几次操作被拿走,如果没被拿走输出 -1. 题解:可以利用set或者map这种自动排序的迭代器来进行存储,然后利用二分找到第一个比它大的数字,然后进行操作即可.…