B. Serval and Toy Brickstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLuckily, Serval got onto the right bus, and he came
A. Serval and Bus time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output It is raining heavily. But this is the first day for Serval, who just became
problem 视频讲解链接:https://www.bilibili.com/video/BV1Du411X7Nksolution可以直接推导原答案ans = ,即对于每一段来说的最大值和最小值。或者从贡献的角度考虑:对于一个数Ai来讲,如果其有贡献的价值,要么是-Ai作为最小值,要么是+Ai作为最大值。 那么Ans=ΣAi*maxn-Ai*minn,这里maxn表示Ai作为最大值出现的次数,m
problem D. Presents in Bankopolistime limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Bankopolis is an incredible city in which all the n crossroad
A题意:n个物品各有一个价格,不买小于l和大于r的,有k块钱,最多可以买几件?思路:去掉不买的从小到大排个序,买到不能买为止。#include<bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 1e5+10; int main(){ ios::sync_with_stdio(0)
A题意:有一个开关,每天s点开,t点关(可能在第2天或第n天),判断x点时开着还是关着。思路:按照是否需要隔夜分个类。#include<bits/stdc++.h> using namespace std; int main(){ int s, t, x; cin>>s>>t>>x; if(s<t){ i
1、排0 Expert 蓝<2100 Candidate Master 紫
t maxn = 1e6+10;typedef __int128 LL;inline
problem 给出一个数列 两个操作 交换位置或者+1 -1 使数列成为首项为1的等比 求最少操作次数solution考虑到等比数列一定递增,直接排序(过渡)试想特殊情况,排序后如果知道公比,那直接O(n)统计就好了,这显然是不可能的,所以要枚举公比,计算复杂度OK,一遍过。枚举可能的公比,每次扫一遍统计需要的次数。#include<bits/stdc++.h>using names
problemD. Hexagons time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Lindsey Buckingham told Stevie Nicks “Go your own way”. Nicks is now sad an
problemA. Contest Start time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There are n people participating in some contest, they start participat
problemA. Ezzat and Two Subsequences time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Ezzat has an array of n integers (maybe negative). He want
problemC. Moamen and XOR time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Moamen and Ezzat are playing a game. They create an array a of n non-
problemB. Moamen and k-subarrays time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Moamen has an array of n distinct integers. He wants to sort
problemB. Mocha and Red and Blue time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output As their story unravels, a timeless tale is told once again…Sh
problemC. Mocha and Hiking time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The city where Mocha lives in is called Zhijiang. There are n+1 vill
problemA. Mocha and Math time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Mocha is a young girl from high school. She has learned so much intere
A题意:给出A坐标(0,0)和B坐标,d表示两点横纵坐标绝对值之和。求是否存在C(x,y)满足d(A,C)=d(B,C)=d(A,B)/2,不存在就-1.思路:d(A,B)直接已知,如果是个奇数就-1。因为A是00,所以C坐标x+y直接已知,然后枚举C的x和y,代入计算d(B,C)是否满足条件即可#include<bits/stdc++.h>using namespace std;ty
problem给出N个数,可以进行三次操作, 每次选中一个区间,区间里任意一个元素可以加上一个区间长度的倍数(并且加的数可以互相不同) 让所有数变成0 求方案solution好久没打CF了,签到题一点都不友好。。。 这题好像错位相减,上一题等比数列,,这。。。题目规定了只有3次操作,加上是T3签到题,所以想到很可能是乱搞(强行操作)用掉两次操作减掉序列上每个位置的值,即 -a[i]*n,+a[i]
problemsolution统计各个字符数,只要都是n的倍数就可以了#include<iostream>#include<string>#include<cstring>using namespace std;int num[250];int main(){ int T; cin>>T; while(T--){ int n; cin&
problemA. XORwice time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output In order to celebrate Twice’s 5th anniversary, Tzuyu and Sana decided to play
problemA. Cancel the Trains time limit per test1 second memory limit per test512 megabytes inputstandard input outputstandard output Gildong’s town has a train system that has 100 trains that travel f
1、 本学期场次从2020.09.19-2021.01.18,一共18周。题号场次日期备注1475Codeforces Round #697 (Div. 3)1.251474Codeforces Round #696 (Div. 2)1.19放假1476Codeforces Round #695 (Div. 2)1.081471Codeforces Round #694 (Div. 2)1.051
文章目录A. DivisionB. TripleC. Odd/Even IncrementsD. Colorful StampE. 2-Letter StringsF. Eating CandiesG. Fall DownH. Maximal AND不愧是div4, 打完还有一个多小时()A. Divisionifelse判断就行#i
problemC. Stable Groupstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n stud
problemD. PriceFixedtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLen
problemA. Omkar and Bad Storytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputo
problemC. Diluc and Kaeyatime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputst
problemC2. Potions (Hard Version)time limit per test1 secondmemory limit per test256 megabytesinputstanda
problemA. Mean Inequalitytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are
Copyright © 2005-2023 51CTO.COM 版权所有 京ICP证060544号