- 博客(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 108
原创 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 112
原创 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 390
原创 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 99
原创 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 237
原创 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 138
原创 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 467
原创 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 176
原创 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 212
原创 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 126
原创 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 147
原创 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 149
原创 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 109
原创 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 224
原创 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 140
原创 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 122
原创 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 146
原创 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 389
原创 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 140
原创 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 160
原创 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 190
原创 Panasonic Programming Contest (AtCoder Beginner Contest 195)---- B (暴力,思维)
官方如果AN≤1000W≤BN,这个问题的答案是肯定的 ,否则不行(想象一下,首先选择重量不变的橘子,然后一点一点地用更重的橘子交换)
2021-06-16 13:54:35 158
原创 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 257
原创 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 221
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人