随笔分类 - OJ-CodeForces
摘要:A:水题,先排序,有相连的输出2,否则输出1. #include<bits/stdc++.h> using namespace std; #define pii pair<int,int> #define mkp make_pair #define pb push_back #define fi f
阅读全文
摘要:Alice and Bob play a game. Initially they have a string s1,s2,…,sns1,s2,…,sn, consisting of only characters . and X. They take alternating turns, and
阅读全文
摘要:A country named Berland has n cities. They are numbered with integers from 1 to n. City with index 1 is the capital of the country. Some pairs of citi
阅读全文
摘要:What-The-Fatherland is a strange country! All phone numbers there are strings consisting of lowercase English letters. What is double strange that a p
阅读全文
摘要:E. e-Government time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The best programmers of E
阅读全文
摘要:题目地址:https://codeforces.com/contest/1136 A: Nastya Is Reading a Book 题解:挨个判断即可,水题。 参考代码: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,l[11
阅读全文
摘要:A.Regular bracket sequence A string is called bracket sequence if it does not contain any characters other than "(" and ")". A bracket sequence is cal
阅读全文
摘要:A : Be Positive 题目地址:https://codeforces.com/problemset/problem/1130/A 题解:让你求是否满足一个d使得数列长为n的a数组的每个数除以d以后,所得数列正数的数量大于ceil(n);(除以后四舍五入,0不是正数) 注意d为负数的情况 参
阅读全文
摘要:A. Sea Battle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Sea Battle time limit pe
阅读全文
摘要:D. Magic Gems time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Reziba has many magic gems
阅读全文
摘要:A. Best Subsegment time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array a1
阅读全文
摘要:You are given a rooted undirected tree consisting of nn vertices. Vertex 11 is the root. Let's denote a depth array of vertex xx as an infinite sequen
阅读全文
摘要:You are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour. Let's call colour c dominating in the subtree of vertex v i
阅读全文
摘要:Max Mex 题目地址:https://codeforces.com/contest/1084/problem/F Max Mex 然后合并时注意分情况讨论: 参考代码: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define pb p
阅读全文
摘要:A. The Fair Nut and Elevator time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. The Fair
阅读全文
摘要:A. Petya and Origami time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Petya and Origami
阅读全文
摘要:ProblemA Minimizing the String 题目链接 题解:这一题读完题就写了吧。就是让你删除一个字母,使得剩下的字符组成的字符串的字典序最小;我们只要第一个当前位置的字符比下一个字符小的位置把该字符删去即可; 参考代码: 1 #include<bits/stdc++.h> 2 u
阅读全文
摘要:链接:https://codeforc.es/contest/1038 A题: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long LL; 4 #define PI acos(-1.0) 5 typedef pai
阅读全文
摘要:You are a lover of bacteria. You want to raise some bacteria in a box. Initially, the box is empty. Each morning, you can put any number of bacteria i
阅读全文
摘要:Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pair li and ri and asks you to count the
阅读全文

浙公网安备 33010602011771号