AtCoder Beginner Contest 050 ABC题】的更多相关文章

A - Addition and Subtraction Easy Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Joisino wants to evaluate the formula "A op B". Here, A and B are integers, and the binary operator op is either + or -. Your task is…
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,…
A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) oth…
题目链接:http://abc069.contest.atcoder.jp/assignments A - K-City Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement In K-city, there are n streets running east-west, and m streets running north-south. Each street running east-w…
A - Infinite Coins 题目链接:https://abc088.contest.atcoder.jp/tasks/abc088_a Time limit : 2sec / Memory limit : 256MB Score: 100 points Problem Statement E869120 has A 1-yen coins and infinitely many 500-yen coins. Determine if he can pay exactly N yen u…
A - Buying Sweets 题目链接:https://abc087.contest.atcoder.jp/tasks/abc087_a Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement You went shopping to buy cakes and donuts with X yen (the currency of Japan). First, you bought one…
题目链接:http://abc070.contest.atcoder.jp/assignments A - Palindromic Number Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement You are given a three-digit positive integer N.Determine whether N is a palindromic number.Here, a…
A - Remaining Time Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.In this country, 24-hour clock is used. For example, 9:00 p.m. is re…
A - Haiku Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement As a New Year's gift, Dolphin received a string s of length 19.The string s has the following format: [five lowercase English letters],[seven lowercase English le…
A - ι⊥l Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right. We will call the arrangement of the poles beautiful if the to…
[题意]一共有N个任务和M天,一个人一天只能做一个任务,做完任务之后可以在这一天之后的(Ai-1)天拿到Bi的工资,问M天内最多可以拿到多少工资. 链接:https://atcoder.jp/contests/abc137/tasks/abc137_d [思路]按时间将任务排序,把 ii 时刻能做的任务都扔进堆里 , 因为任务是一次性的,所以每个任务放进去过就不再放入了.然后每个时刻看一下堆里面有没有数,有的话就取堆顶出来,而且每个时刻只能取一次.正确性显然. 代码: #include<bits…
刚开始的时候被E题卡住了,不过发现是个数学题后就开始使劲推式子,幸运的是推出来了,之后的F题更是树形DP换根的模板吧,就草草的过了,看了一眼G,随便口胡了一下,赶紧打代码,毕竟时间不多了,最后也没打完!比赛结束五分钟后,打完代码,woc,连样例都过不去,一看,确实忽略了一些情况.这个题卡的值了! G - Isosceles Trapezium 题目中有1000个点,每个点都有一定的权值,要求你选出四个点,使得他们的权值和最大并且能够组成一个等腰梯形. 首先我们肯定是要挖掘等腰梯形的性质,来帮助我…
F - Dist Max 2 什么时候我才能突破\(F\)题的大关... 算了,不说了,看题. 简化题意:给定\(n\)个点的坐标,定义没两个点的距离为\(min(|x_i-x_j|,|y_i-y_j|)\),求所有点对中距离的最大值.其实看到一个最小,一个最大就应该想到二分的...最小值最大或最大值最小,二分答案不是最擅长解决这类问题的吗?但有时候就会想想了,为什么二分答案在这些条件下就十分适用了...考虑最小值最大(或最大值最小),说明有很多方案,每个方案都有对应的最小值,求所有方案的最大值…
F - Common Prefixes 该题也是囤了好久的题目了,看题目公共前缀,再扫一眼题目,嗯求每个后缀与其他后缀的公共前缀的和,那不就是后缀数组吗?对于这类问题后缀数组可是相当在行的. 我们用后缀数组的思想转化下题意就是: 经过后缀排序,我们得到\(height\)数组,考虑排名从小到大依次处理每一个字符串,显然对于一个后缀i而言\(ans(sa[i])=\sum_{j=2}^{i} min_{k=j}^i (a_k)+\sum_{j=i+1}^{n} min_{k=i+1}^j(a_k)…
A - Two Rectangles Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement There are two rectangles. The lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle…
A - One Card Poker Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Alice and Bob are playing One Card Poker.One Card Poker is a two-player game using playing cards. Each card in this game shows an integer between 1 and 1…
C - Grand Garden In a flower bed, there are NN flowers, numbered 1,2,......,N1,2,......,N. Initially, the heights of all flowers are 00. You are given a sequence h={h1,h2,h3,......}h={h1,h2,h3,......} as input. You would like to change the height of…
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 - 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…
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 - Rating Goal Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Takahashi is a user of a site that hosts programming contests.When a user competes in a contest, the rating of the user (not necessarily an integer) changes…
AtCoder Beginner Contest 075 C bridge 桥就是指图中这样的边,删除它以后整个图不连通.本题就是求桥个数的裸题. dfn[u]指在dfs中搜索到u节点的次序值,low[u]指dfs栈中u能追溯到的最早栈中节点从次序号.这里写的很好. #include<bits/stdc++.h> using namespace std; ; vector<int> G[maxn]; int dfn[maxn],low[maxn]; int n,m,u,v,dep,…
比赛链接:https://atcoder.jp/contests/abc161/tasks AtCoder Beginner Contest 161 第一次打AtCoder的比赛,因为是日本的网站终于不用倒时差了233. A - ABC Swap 可以直接按照交换后的顺序输出. #include <bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<…
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得到答案. 看了眼别人的做法,比…
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 求二阶矩阵的行列式,是小学常见自定义题目(…
没看到Beginner,然后就做啊做,发现A,B太简单了...然后想想做完算了..没想到C卡了一下,然后还是做出来了.D的话瞎想了一下,然后感觉也没问题.假装all kill.2333 AtCoder Beginner Contest 052 A题意: 输出大的面积? 思路: max(A*B,C*D); AtCoder Beginner Contest 052 B题意: 枚举过程,然后...太水了.. AtCoder Beginner Contest 052 C题意: 输出N!的因子个数mod1…
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 Beginner Contest 079 D - Wall Warshall Floyd 最短路....先枚举 k #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ][]; int H, W, A, ans; int main() { scanf("%d%d", &H, &a…
AtCoder Beginner Contest 064 D - Insertion Problem Statement You are given a string S of length N consisting of ( and ). Your task is to insert some number of ( and ) into S to obtain a correct bracket sequence.Here, a correct bracket sequence is def…