随笔分类 - 题库—Codeforces比赛
摘要:You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1and bottom card — index n. Each card has its color: the 𝑖
阅读全文
摘要:Let's define the cost of a string 𝑠s as the number of index pairs i and j (1≤i<j<|s|) such that si=sj and si+1=sj+1. You are given two positive integ
阅读全文
摘要:Codeforces Round #712 (Div. 2) A. Déjà Vu 暴力瞎搞即可,只有全a是不满足的,否则挑选a更多的一端加上a,当然也可以分别加a进行判断。 #include <bits/stdc++.h> using namespace std; int main() { int
阅读全文
摘要:Diamond Miner is a game that is similar to Gold Miner, but there are 𝑛n miners instead of 11 in this game. The mining area can be described as a plan
阅读全文
摘要:You are given a multiset S initially consisting of n distinct non-negative integers. A multiset is a set, that can contain some elements multiple time
阅读全文
摘要:A. Split it! Kawashiro Nitori is a girl who loves competitive programming. One day she found a string and an integer. As an advanced problem setter, s
阅读全文
摘要:A. Dense Array 数据范围很小可以直接枚举,对于每个间隔用while循环二倍二倍往里插。 #include <iostream> using namespace std; int a[55]; int main() { freopen("data.txt", "r", stdin); i
阅读全文
摘要:Educational Codeforces Round 104 (Rated for Div. 2) A~D A. Arena 除去最少的那部分以外都对答案有贡献。 #include <iostream> #include <algorithm> #include <set> using name
阅读全文
摘要:A. 签到,因为是等概率,且红色数字两两不同,黑色数字两两不同,故只需要看第一张即可。然后就是枚举每张卡片比较上面的两个数字。 #include <iostream> using namespace std; int main() { freopen("data.txt", "r", stdin);
阅读全文
摘要:You are given an array [𝑎1,𝑎2,…,𝑎𝑛][a1,a2,…,an] such that 1≤𝑎𝑖≤1091≤ai≤109. Let 𝑆S be the sum of all elements of the array 𝑎a. Let's call an a
阅读全文
摘要:You are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of th
阅读全文
摘要: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 s
阅读全文
摘要:Note that girls in Arpa’s land are really attractive. Arpa loves overnight parties. In the middle of one of these parties Mehrdad suddenly appeared. H
阅读全文
摘要:Boring Apartments 模拟 #include <iostream> using namespace std; int main() { //freopen("data.txt", "r", stdin); int t; cin >> t; while(t--) { int x; cin
阅读全文
摘要:Kolya got an integer array a1,a2,…,an. The array can contain both positive and negative integers, but Kolya doesn't like 0 , so the array doesn't cont
阅读全文
摘要:You are given an array a consisting of n integers numbered from 1to n . Let's define the k -amazing number of the array as the minimum number that occ
阅读全文
摘要:You are given a binary string s consisting of n zeros and ones. Your task is to divide the given string into the minimum number of subsequences in suc
阅读全文
摘要:There are n people who want to participate in a boat competition. The weight of the i -th participant is wi. Only teams consisting of two people can p
阅读全文
摘要:You have n gifts and you want to give all of them to children. Of course, you don't want to offend anyone, so all gifts should be equal between each o
阅读全文
摘要:You are given the array aa a consisting of n positive (greater than zero) integers. In one move, you can choose two indices i and j (i≠j) such that th
阅读全文