B cpp intmain(){inta, b; cin>>a>>b;if(a>b)swap(a, b);intans=0;while(b--){ans=ans*10+a;}cout<<ans;return0;} C 树状数组维护一下即可 cpp #pragmaGCC optimize("O3")#include<bits/stdc++.h>usingnamespacestd;#defineendl'\n'#definedebug(x) cerr << #x <<": "<< x <<...
AtCoder Beginner Contest 152 https://atcoder.jp/contests/abc152 F我看了半天,编码方式那里还算是感觉比较玄乎,这题确实妙。 D - Handstand 2 只需记录两端数字即可,不要想太复杂。 #include <bits/std
AtCoder Beginner Contest 106 D - AtCoder Express 2(二维树状数组) 题目大意:从西到东有N个城市,其中有M条铁路路线,每条铁路路线链接Ni-Nj(j>=i),有Q次询问,询问Ni到Nj完全包含的铁路数量。 举个例子,比如总共有三个站点,1,2,3四个路线,(1,1),(1,2),(1,3),(2,2)查询(1,2)之间完全包含...
AtCoder Beginner Contest 152 - F - Tree and Constraints (容斥定理+树上路径的性质) We have a tree with NN vertices numbered 11 to NN. The ii-th edge in this tree connects Vertex aiai and Vertex bibi. Consider painting each of these edges white or black. There are 2N−12N−1 such ...
G - Mediator(启发式合并 + lca) A - Past ABCs #include<bits/stdc++.h>usingnamespacestd;voidsolve(){strings;cin>>s;if(s[3]>='4'||s.substr(3)=="316"||s.substr(3)=="000"||(s[3]=='3'&&s[4]>='5'))cout<<"No\n";elsecout<<"Yes\n";}intmain(){ios::sync_with_stdio...
其中,⌈a⌉表示对数字a向上取整。 分析 对于正整数,需要判断除法结果是否有余数,如果存在余数,整除的结果需要加一。 对于负整数,直接进行除法即可。 hint:本题数据规模较大,需要使用long long类型存储数据。 代码 #include <bits/stdc++.h> using namespace std; ...
AtCoder Beginner Contest 216 个人题解 每篇一图 A题 Signed Difficulty 题目大意: 给出一个小数,根据小数部分改写 \(+,-\) 思路解析: 直接判断即可 AC代码: #include<bits/stdc++.h> using namespace std; int main(){ int x,y; scanf("%d.%d",&x,&y);...
AtCoder Beginner Contest 359(A ~ G 题讲解) https://www.bilibili.com/video/BV1e6421Z7XK/ AtCoder Beginner Contest 359 A~F https://www.bilibili.com/video/BV1G4gveBENB/ AtCoder Beginner Contest 359 | 完成度 [6 / 7] https://www.bilibili.com/video/BV1kS411A7M3/ AtCoder Beginner ...
Aising Programming Contest 2022(AtCoder Beginner Contest 255)实况 https://www.bilibili.com/video/BV1mY411K7PJ/ https://www.bilibili.com/video/BV1W3411g79S/ Aising Programming Contest 2022(AtCoder Beginner Contest 255)现场实况 https://www.bilibili.com/video/BV1Ba411L736/ ...
Did you enjoy the AtCoder Beginner Contest 128? A Japanese editorial is already out, but unfortunately there is no English editorial, so I translated it into English experimentally. Note that this is an unofficial one; AtCoder has no responsibility for this editorial. Also, I didn't do ...