- 博客(8)
- 收藏
- 关注
原创 codeforces 1364 C
原题链接题意思路1.根据题意可知,不可能输出-12.因数组a是非递减序列,若a[i] != a[i-1],则b[i] = a[i-1] ;3.a[i]==a[i-1],那么b[i]可以在[0,n]中未占用的数据中,自小到大,进行选取。AC代码#include<bits/stdc++.h>using namespace std;const int N=1e6+10;int n;int a[N],b[N],vis[N],c[N],index;int main(
2020-12-28 21:19:03 193
原创 codeforces 1244 C 数论
原题链接洛谷翻译思路1.由题意知道,败一场不得分,对最后的结果没有影响,所以我们可以不考虑失败的场数,只考虑胜场和平长,最后拿n减就是败场的次数2.只需要输出一种符合题意的结果即可,我们可以这样想,尽可能的让胜场多,平场少,因为这样在相同的分数下可以使的比赛的场次最小,如果是平场多的话,有可能会超出n3.最后只需判断是否符合情况即可AC代码#include<bits/stdc++.h>using namespace std;long long n, p, a,
2020-12-21 19:28:06 186
原创 codeforces 1228 C 数论
原题链接Let’s introduce some definitions that will be needed later.Let prime(x) be the set of prime divisors of x. For example, prime(140)={2,5,7}, prime(169)={13}.Let g(x,p) be the maximum possible integer pk where k is an integer such that x is divisible
2020-12-21 18:43:02 171
原创 中北大学2020年新生赛 白嫖怪Long Long (KMP)
原题链接题意Long Long准备去吃串串,刚好发现串串店正在搞活动,只要能帮店主解决一个问题,这一顿就可以白嫖。作为白嫖怪,Long Long怎么能错过这次机会,但是他是一个字符串渣渣,现在需要你来帮他解决。由于他十分着急吃串串,他只给你1s的时间解决这个问题。问题是这样的:店主十分喜欢回文串(正着读和反着读都一样的字符串),比如 “nucun”,“acmmca” 这样的都是回文串,现在店主随机给你出两个字符串a和b,如果b串是回文串,求出a串中b串出现的个数和出现的所有位置。要求你写一个程序可以解
2020-12-19 19:50:46 396 2
原创 codeforces 1248 C
原题链接Recently Ivan the Fool decided to become smarter and study the probability theory. He thinks that he understands the subject fairly well, and so he began to behave like he already got PhD in that area.To prove his skills, Ivan decided to demonstrate
2020-12-19 15:09:13 154 1
原创 codeforces 1245 C
原题链接Constanze is the smartest girl in her village but she has bad eyesight.One day, she was able to invent an incredible machine! When you pronounce letters, the machine will inscribe them onto a piece of paper. For example, if you pronounce ‘c’, ‘o’, ‘d
2020-12-18 16:35:10 228 1
原创 Codeforces Round #688 (Div. 2) 1453 B
原题链接Gildong has an interesting machine that has an array a with n integers. The machine supports two kinds of operations:Increase all elements of a suffix of the array by 1.Decrease all elements of a suffix of the array by 1.A suffix is a subsegment (c
2020-12-06 09:55:55 152
原创 codeforces 948 C-------优先队列
原题链接Alice likes snow a lot! Unfortunately, this year’s winter is already over, and she can’t expect to have any more of it. Bob has thus bought her a gift — a large snow maker. He plans to make some amount of snow every day. On day i he will make a pile o
2020-12-01 20:34:27 227
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人