随笔分类 -  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 阅读全文
posted @ 2019-10-23 23:59 StarHai 阅读(445) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-10-08 15:01 StarHai 阅读(381) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-09-20 19:48 StarHai 阅读(410) 评论(1) 推荐(0)
摘要: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 阅读全文
posted @ 2019-09-11 14:36 StarHai 阅读(678) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-09-01 00:01 StarHai 阅读(306) 评论(0) 推荐(0)
摘要:题目地址: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 阅读全文
posted @ 2019-04-09 00:17 StarHai 阅读(427) 评论(0) 推荐(1)
摘要: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 阅读全文
posted @ 2019-03-09 16:39 StarHai 阅读(773) 评论(0) 推荐(1)
摘要:A : Be Positive 题目地址:https://codeforces.com/problemset/problem/1130/A 题解:让你求是否满足一个d使得数列长为n的a数组的每个数除以d以后,所得数列正数的数量大于ceil(n);(除以后四舍五入,0不是正数) 注意d为负数的情况 参 阅读全文
posted @ 2019-03-04 21:49 StarHai 阅读(403) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-02-24 11:01 StarHai 阅读(699) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-02-20 20:22 StarHai 阅读(256) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-02-20 12:54 StarHai 阅读(664) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-01-19 21:28 StarHai 阅读(439) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-01-19 21:18 StarHai 阅读(433) 评论(1) 推荐(0)
摘要:Max Mex 题目地址:https://codeforces.com/contest/1084/problem/F Max Mex 然后合并时注意分情况讨论: 参考代码: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define pb p 阅读全文
posted @ 2018-12-29 16:44 StarHai 阅读(472) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-12-25 22:29 StarHai 阅读(560) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-11-25 02:04 StarHai 阅读(494) 评论(0) 推荐(0)
摘要:ProblemA Minimizing the String 题目链接 题解:这一题读完题就写了吧。就是让你删除一个字母,使得剩下的字符组成的字符串的字典序最小;我们只要第一个当前位置的字符比下一个字符小的位置把该字符删去即可; 参考代码: 1 #include<bits/stdc++.h> 2 u 阅读全文
posted @ 2018-11-17 01:39 StarHai 阅读(237) 评论(0) 推荐(0)
摘要:链接: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 阅读全文
posted @ 2018-09-09 21:30 StarHai 阅读(331) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-08-22 21:12 StarHai 阅读(643) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-08-19 23:06 StarHai 阅读(261) 评论(0) 推荐(0)