自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

转载 Codeforces Round #736 (Div. 2)

A Gregor and Cryptography题目大意给定一个质数n,求任意两个数a, b,使得n % a == n % b主要思路由于给定的数是质数,质数一定是奇数,那么n % 2一定为1,那么b为多少时n % b也等于1呢,答案是n - 1AC代码#include <bits/stdc++.h>using namespace std;int main() { ios::sync_with_stdio(0); cin.tie(0); int t; ci...

2021-08-04 19:27:37 88

原创 A. Nastia and Nearly Good Numbers

A. Nastia and Nearly Good Numberstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNastia has22positive integersAAandBB. She defines that:The integer is good if it is divisible by...

2021-07-17 19:01:09 91

原创 A. AquaMoon and Two Arrays

A. AquaMoon and Two Arraystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAquaMoon and Cirno are playing an interesting game with arrays. Cirno has prepared two arraysaaandbb, both c...

2021-07-12 13:12:20 362

原创 Codeforces Round #732 (Div. 2) ---- B

B. AquaMoon and Stolen Stringtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAquaMoon hadnnstrings of lengthmmeach.nnis anoddnumber.When AquaMoon was gone, Cirno tried to pair...

2021-07-12 12:56:47 82

原创 AtCoder Beginner Contest 175---C - Walking Takahashi()

Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementTakahashi, who lives on the number line, is now at coordinateXX. He will make exactlyKKmoves of distanceDDin the positive or negative direction.More specifically, i...

2021-06-22 19:13:13 192

原创 AtCoder Beginner Contest 176-----C - Step(单调不减序列维护最大值)

C - StepEditorial/Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementNNpersons are standing in a row. The height of theii-th person from the front isAiAi.We want to have each person stand on a stool of some heigh...

2021-06-22 17:16:11 109

原创 AtCoder Beginner Contest 177 --- C - Sum of product of pairs(类似前缀和,双指针的优化)

Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementGiven areNNintegersA1,…,ANA1,…,AN.Find the sum ofAi×AjAi×Ajover all pairs(i,j)(i,j)such that1≤i<j≤N1≤i<j≤N, modulo(109+7)(109+7).Constraints2≤N≤2×1052...

2021-06-22 16:29:42 308

原创 AtCoder Beginner Contest 178----C - Ubiquity(容斥定理)

Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementHow many integer sequencesA1,A2,…,ANA1,A2,…,ANof lengthNNsatisfy all of the following conditions?0≤Ai≤90≤Ai≤9 There exists someiisuch thatAi=0Ai=0holds. There ...

2021-06-22 15:36:01 137

原创 AtCoder Beginner Contest 179---C - A x B + C(思维)

Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementGiven is a positive integerNN. How many tuples(A,B,C)(A,B,C)of positive integers satisfyA×B+C=NA×B+C=N?Constraints2≤N≤1062≤N≤106 All values in input are integers....

2021-06-22 14:04:35 153

原创 AtCoder Beginner Contest 180 ----- B(abs,max,sqrt 精度问题)

Time Limit: 2 sec / Memory Limit: 1024 MBScore :200200pointsProblem StatementGiven is a point(x1,…,xN)(x1,…,xN)in anNN-dimensional space.Find the Manhattan distance, Euclidian distance, and Chebyshev distance between this point and the origin....

2021-06-18 13:13:40 98

原创 AtCoder Beginner Contest 182-----C(思维题,类似整数相加,取模)

C - To 3Editorial/Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementGiven is a positive integerNN, where none of the digits is00.Letkkbe the number of digits inNN. We want to make a multiple of33by erasing...

2021-06-17 23:50:44 117

原创 AtCoder Beginner Contest 182 --- B(暴力)

B - Almost GCDEditorial/Time Limit: 2 sec / Memory Limit: 1024 MBScore :200200pointsProblem StatementGiven is an integer sequenceAA:A1,A2,A3,…,ANA1,A2,A3,…,AN.Let theGCD-nessof a positive integerkkbe the number of elements amongA1,A2,A...

2021-06-17 23:42:09 123

原创 AtCoder Beginner Contest 183 -- B(图的搜索)

思路:暴搜,递归结束条件x == 1,cost == kcode:#include<bits/stdc++.h>#define INF 0x3f3f3f3f#define N 100003#define mod 100000#define pb push_back#define x first#define y second#define ull unsigned long long#define ll long longusi...

2021-06-17 09:20:16 87

原创 AtCoder Beginner Contest 183 ---- B(计算几何)

Time Limit: 2 sec / Memory Limit: 1024 MBScore :200200pointsProblem StatementTakahashi is playing billiards on a two-dimensional plane. Thexx-axis functions as a wall; when a ball hits the axis, it will bounce off the axis so that the angle of inc...

2021-06-17 08:52:48 195

原创 AtCoder Beginner Contest 192 ----C(模拟,排序求和的o(n)做法)

C - Kaprekar NumberEditorial/Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementFor an integerxxnot less than00, we defineg1(x),g2(x),f(x)g1(x),g2(x),f(x)as follows:g1(x)=g1(x)=the integer obtained by rearr...

2021-06-16 17:19:31 123

原创 AtCoder Beginner Contest 192 ---- B(暴力)

B - uNrEaDaBlE sTrInGEditorial/Time Limit: 2 sec / Memory Limit: 1024 MBScore :200200pointsProblem StatementWe call a stringhard-to-readwhen its odd-positioned (11-st,33-rd,55-th, ... from the beginning) characters are all lowercase Eng...

2021-06-16 16:46:01 102

原创 Caddi Programming Contest 2021(AtCoder Beginner Contest 193) ----- C(思维)

C - Squared ErrorTime Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementGiven is a number sequenceAAof lengthNN.Find the sum of squared differences of every pair of elements:N∑i=2i−1∑j=1(Ai−Aj)2∑i=2N∑j=1i−1(Ai−Aj)2....

2021-06-16 16:28:03 120

原创 Caddi Programming Contest 2021(AtCoder Beginner Contest 193) --------B(暴力)

B - Play SnukeTime Limit: 2 sec / Memory Limit: 1024 MBScore :200200pointsProblem StatementTakahashi wants to buy the popular video game console called Play Snuke.There areNNshops that sell Play Snuke: Shop1,2,…,N1,2,…,N. ShopiiisAiAim...

2021-06-16 15:58:32 361

原创 AtCoder Beginner Contest 194----B(暴力)

We can exhaustively search every pair of of indices of employees assigned to Work A and Work B.The total time complexity of this solution isΘ(N2). Besides, one can also solve this problem in a total ofO(N)time.

2021-06-16 15:44:27 114

原创 AtCoder Beginner Contest 194 ----- C(思维)

We can find the answer fast enough without the constraint|Ai|≤200|Ai|≤200.∑ni=2∑i−1j=1(Ai−Aj)2∑i=2n∑j=1i−1(Ai−Aj)2=12(∑ni=1∑nj=1(Ai−Aj)2)=12(∑i=1n∑j=1n(Ai−Aj)2)(Because(Ai−Ai)2=0(Ai−Ai)2=0)=12(∑ni=1∑nj=1(A2i+A2j−2AiAj))=12(∑i=1n∑j=1n(Ai2+Aj2−2AiAj))...

2021-06-16 15:40:34 127

原创 Panasonic Programming Contest (AtCoder Beginner Contest 195)-------C(思维)

C - CommaEditorial/Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementWhen Takahashi writes an integer, he uses a comma every third digit from the right. For example,12345671234567is written as1,234,567, and777777...

2021-06-16 14:35:09 155

原创 Panasonic Programming Contest (AtCoder Beginner Contest 195)---- B (暴力,思维)

官方如果AN≤1000W≤BN,这个问题的答案是肯定的 ,否则不行(想象一下,首先选择重量不变的橘子,然后一点一点地用更重的橘子交换)

2021-06-16 13:54:35 133

原创 AtCoder Beginner Contest 196 --- C(思维)

Time Limit: 2 sec / Memory Limit: 1024 MBScore :300300pointsProblem StatementGiven is an integerNN.How many integersxxbetween11andNN(inclusive) satisfy the following condition?The decimal representation (without leading zeros) ofxxhas a...

2021-06-16 11:29:19 208

原创 AtCoder Beginner Contest 196 ----- B(模拟)

Problem StatementGiven an integer or a decimalXX, round it down to an integer and print the result.Constraints0≤X≤101000≤X≤10100 XXis an integer or a decimal with at most100100digits after the decimal point, without unnecessary leading zeros....

2021-06-16 10:33:45 180

原创 AtCoder Beginner Contest 197---C(二进制暴搜)

数据范围 20所以是个暴搜题1 暴搜策略dfs2 2进制枚举

2021-06-15 23:42:19 129

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除