intdu[N];intf[N];intfind(intx){if(f[x]==x)returnx;returnf[x]=find(f[x]);}/*1. 判断给定图,是否联通 dfs并查集2. 判断每个点的度数是不是2*/intmain(){intn,m;cin>>n>>m;for(inti=1;i<=n;i++)f[i]=i;for(inti=1;i<=m;i++){intu,v;cin>>u>>v;intfu=find(u),fv...
AtCoder Beginner Contest 044 题解 比赛链接:https://atcoder.jp/contests/abc044A - Tak and Hotels (ABC Edit)题目大意: 住NN 天旅馆,前 KK 天每晚 XX 元,接下来每晚 YY 元。问:一共花多少钱?解题思路: 直接一个if判断即可。示例程序:#include <bits/stdc++.h> using namespace std; long long ...
AtCoder Beginner Contest 044 题解 A - Tak and Hotels (ABC Edit) 题目大意: 住\(N\) 天旅馆,前 \(K\) 天每晚 \(X\) 元,接下来每晚 \(Y\) 元。问:一共花多少钱? 解题思路: 直接一个if判断即可。 示例程序: #include <bits/stdc++.h> using namespace std; long long N, K, X, Y; ...
AtCoder Beginner Contest 044(ABCD)题解 AtCoder Beginner Contest 044(ABCD)题解 传送门 A - Tak and Hotels (ABC Edit) 思路:显然讨论一下 k k k的范围即可。 时间复杂度: O ( 1 ) O(1) O(1) #include<bits/stdc++.h> using namespace std; typedef long long ll; const int...
Tak hasNcards. On thei-th(1≤i≤N)card is written an integerxi. He is selecting one or more cards from theseNcards, so that the average of the integers written on the selected cards is exactlyA. In how many ways can he make his selection?
·AtCoder Beginner Contest (ABC) 这是最频繁且最简单的入门赛,通常情况下每月至少举行2次。2019年4月27日(含)之前,每场比赛共4题,时长100分钟,满分1000分且Rating超过1199的选手不计Rating值。自2019年5月19日起改版升级为6道题目,时长不变,满分2100分且Rating值超过1999的选手不计Rating值。改版之后比赛质量...
AtCoder Beginner Contest 403 A-G 简易题解,如果题解中有什么问题可以找我反馈,谢谢! A.Odd Position Sum直接 for 循环输入,只对奇数求和即可。int main(){ int n; cin >> n; int res = 0; for(int i = 1; i… 枫落发表于Atcod... AtCoder Beginner Contest 404 A-G 简易题解,如果...
[AtCoder Beginner Contest 365](https://atcoder.jp/contests/abc365) 题解 ABC365的比赛题解,我做出G题了,但暂时不发,需要的请私信 私信前请看:https://www.luogu.com.cn/paste/lowgb1lx ### A - Leap Year [翻](https://blog.csdn.net/qianzhima2012/article/details/141070004?spm=1001.2014.3001....
最近总感觉有点惆怅,打完之后一直在发懵也没马上写题解,不知道在干嘛qwq A.Tomorrow 模拟即可。 inlinevoidqfl_zzz(){ll m=read(),d=read();ll Y=read(),M=read(),D=read();++D;if(D>d)++M,D=1;if(M>m)++Y,M=1;writet(Y),writet(M),writen(D);} ...
We will hold AtCoder Beginner Contest 167. Contest URL: https://atcoder.jp/contests/abc167 Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20200510T2100&p1=248 Duration: 100 minutes Number of Tasks: 6 Writer: gazelle, kort0n, kyopro_friends, potetisensei, she...