
atcoder
atcoder题解
葛济维的博客
总想日更博客的小白
展开
-
AtCoder Beginner Contest 180 D - Takahashi Unevolved补题解题解
传送门题中有XA 和 X+B 两种增长方法当XA < X+B 而且 XA < Y时,使用第一种方法否则用第二种方法,第二种方法可以直接计算出答案,不用累加#include<stdio.h>#include<iostream>#include<cstring>#define ll long longusing namespace std;int main(){ ll x,y; ll a,b; cin>>x原创 2020-10-24 09:56:07 · 348 阅读 · 0 评论 -
AtCoder Beginner Contest 180 ABC详解题解
AtCoder Beginner Contest 180传送门A - box#include<iostream>using namespace std;int main(){ int n,a,b; cin>>n>>a>>b; cout<<n-a+b<<endl; return 0;}B - Various distances解题思路:按题目中的公式进行求解,注意The Eucli原创 2020-10-18 11:28:14 · 904 阅读 · 0 评论 -
二分法典型例题atcoder beginner contest 174 E题解 解题思路 代码
Sample Input 12 37 9Sample Output 14Sample Input 23 03 4 5Sample Output 25Sample Input 310 10158260522 877914575 602436426 24979445 861648772 623690081 433933447 476190629 262703497 211047202Sample Output 3 292638192解题思路:求<=k的切割次数中.原创 2020-09-19 00:12:35 · 309 阅读 · 0 评论 -
AtCoder Beginner Contest 174 C - Repsept 解题思路 代码 欧拉定理
解题思路:Sample Input 1101Sample Output 14None of 7, 77, and 777 is a multiple of 101, but 7777 is.对这个例子分析先从7尝试对101取余,然后7*10+7 = 77,77对101取余后 乘10 +7 = 777 ,一直到 777 对101取余后,777变为70,70又继续 乘10+7 = 707,在这里对101取余为 0 ,符合 答案为 4 。我们可以得出规律,k的范围是[1, 1e6],假如该数能被.原创 2020-09-18 15:32:04 · 333 阅读 · 0 评论 -
AtCoder Beginner Contest 178 C - Ubiquity题解
C.UbiquitySample Input 12Sample Output 12Sample Input 21Sample Output 20Sample Input 3869121Sample Output 32511445题解:输入一个N,0<=Ai<=9,所以一共10N 种情况,序列中元素个数为N,序列中一定存在 0 和 9,要得到至少有一个0和一个9的所有情况,思路使用总共的情况减去只有一个 0 、只有 一个 9 、或者 0 和 9 都没有的情况。用 10原创 2020-09-16 18:37:50 · 306 阅读 · 0 评论 -
AtCoder Beginner Contest 175 C - Walking Takahashi
Sample Input 16 2 4Sample Output 12Sample Input 27 4 3Sample Output 21Takahashi is now at coordinate 7. It is optimal to make, for example, the following moves:Move from coordinate 7 to 4Move from coordinate 4 to 7Move from coordinate 7 to 4Mo.原创 2020-09-13 16:11:56 · 301 阅读 · 0 评论 -
AtCoder Beginner Contest 176 D-Wizard in Maze(双端队列)
Sample Input 1Copy4 41 14 4..#...#..#...#..Sample Output 1Note that he cannot walk diagonally.Sample Input 2Copy4 41 44 1.##.########.##.Sample Output 2Copy-1He cannot move from there.Sample Input 34 42 23 3…………Sample ..原创 2020-09-13 09:59:53 · 239 阅读 · 0 评论 -
AtCoder Beginner Contest 177 B-Substring
Sample Input 1cabaccabcSample Output 11Sample Input 2codeforcesatcoderSample Output 26#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>#include<cstring>#include<string>#includ..原创 2020-09-12 11:20:48 · 203 阅读 · 0 评论 -
AtCoder Beginner Contest 150 C-Count Order (next_permutation排列函数的应用)
c-Count OrderEditorialTime Limit: 2 sec/ Memory Limit:1024MBScore: 300 pointsProblem StatementWe have two permutations Pand Q of size N(that is, Pand Q are both rearrangements of(1,2,…,N)).There are N!possible permutatons of size N.Among them,let Pan原创 2020-09-10 20:05:41 · 366 阅读 · 0 评论