codeforces
文章平均质量分 96
a碟
这个作者很懒,什么都没留下…
展开
-
Deltix Round, Summer 2021 Div. 1 + Div. 2 A B C D
目录A. A Variety of OperationsB. Take Your Places!C. Compressed Bracket SequenceA. A Variety of Operations题目链接题意: 给定两个数a,ba,ba,b,初始值为000,有三个操作,aaa和bbb都加kkk;或者aaa加kkk,bbb减kkk;或者bbb加kkk,aaa减kkk。问最少执行多少次操作,使得a=c,b=da=c,b=da=c,b=d。无法完成则输出−1-1−1。分析: 因为在任意变化之原创 2021-08-30 11:02:53 · 505 阅读 · 3 评论 -
Codeforces Round #741 Div. 2 A B C D1 D2
大胆假设,猜到结论就可以冲了(bushiA. The Miracle and the Sleeper题目链接分析: 在给定的l,rl,rl,r中,选择r≥a≥b≥lr≥a≥b≥lr≥a≥b≥l,的a,ba,ba,b使得amodba mod bamodb最大。可以想到如果有数xxx使得rr%x=1......x-1r,这样的xxx最大是多少?r=2x−1r=2x-1r=2x−1,x=(r+1)/2x=(r+1)/2x=(r+1)/2,如果l≤(r+1)/2l \leq (r+1)/2l≤(r+1)/原创 2021-08-27 01:15:00 · 522 阅读 · 0 评论 -
Codeforces Round #740 Div. 2 A B C D1 D2
目录A. Simply Strange SortB. Charmed by the GameC. Deep Down BelowD1. Up the Strip (simplified version)A. Simply Strange Sort题目链接题意: 给你一个从1−n1-n1−n的排列数组,nnn的长度是奇数,按照题目给定的要求对序列进行变换,求多少次变换之后能够使得数组递增。分析: 简单的模拟题,主要是要读懂题意,f(i)f(i)f(i)代表如果ai>ai+1a_i > a原创 2021-08-25 11:53:15 · 359 阅读 · 0 评论 -
1459C. Row GCD(经典数论)
You are given two positive integer sequences a1,…,an and b1,…,bm. For each j=1,…,m find the greatest common divisor of a1+bj,…,an+bj.InputThe first line contains two integers n and m (1≤n,m≤2⋅105).The second line contains n integers a1,…,an (1≤ai≤1018).原创 2020-12-21 10:40:04 · 824 阅读 · 0 评论 -
1453B Suffix Operations
题目Gildong has an interesting machine that has an array a with n integers. The machine supports two kinds of operations:1.Increase all elements of a suffix of the array by 1.2.Decrease all elements of a suffix of the array by 1.A suffix is a subsegment原创 2020-12-05 10:14:12 · 223 阅读 · 0 评论 -
1416A k-Amazing Numbers
A. k-Amazing NumbersYou are given an array a consisting of n integers numbered from 1 to n.Let’s define the k-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length k (recall that a subsegment o原创 2020-10-24 10:39:06 · 298 阅读 · 0 评论