
cf
DATELOST
I'm curious.
展开
-
cf-1142c 求上凸包
题目#include<iostream>#include<string.h>#include<math.h>#include<stdio.h>#include<algorithm>#include<vector>using namespace std;typedef long long ll;const in...原创 2019-10-25 13:21:16 · 132 阅读 · 0 评论 -
CF-1165E 思维
E. Two Arrays and Sum of FunctionsYou are given two arrays a and b, both of length n.Let’s define a function f(l,r)=∑l≤i≤r ai⋅bi.Your task is to reorder the elements (choose an arbitrary order of ...原创 2019-05-15 11:21:43 · 292 阅读 · 0 评论 -
CF 670C 离散化
C. CinemaMoscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For convenience, we enumera...原创 2019-05-29 23:33:48 · 435 阅读 · 0 评论 -
CF 1176C贪心
You are given an array a consisting of n integers. Each ai is one of the six following numbers: 4,8,15,16,23,42.Your task is to remove the minimum number of elements to make this array good.An array...原创 2019-06-10 21:43:06 · 559 阅读 · 0 评论 -
cf-220B 莫队 //对询问分块
http://codeforces.com/problemset/problem/220/B155ms#include<bits/stdc++.h>using namespace std;const int N=1e5+5;typedef long long ll;int cnt[N],n,m,id;int pos[N],L=1,R,res,ans[N],block;s...原创 2019-07-20 20:07:59 · 136 阅读 · 0 评论 -
cf 600E/570D DSU on the tree 树上启发式合并
学习学习600E板子#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N=2e5+5;int fa[N],son[N],siz[N];struct Edge{ int to,next; Edge(){} Edge(int to,int next):to(to),nex...原创 2019-07-22 21:56:55 · 132 阅读 · 0 评论 -
cf-1201C 二分答案
C. Maximum MedianYou are given an array a of n integers, where n is odd. You can make the following operation with it:Choose one of the elements of the array (for example ai) and increase it by 1 (t...原创 2019-08-05 22:21:11 · 385 阅读 · 0 评论 -
cf-1203E 网络流
E. BoxersThere are n boxers, the weight of the i-th boxer is ai. Each of them can change the weight by no more than 1 before the competition (the weight cannot become equal to zero, that is, it must ...原创 2019-08-16 16:44:10 · 200 阅读 · 0 评论 -
cf-1019D 旋转坐标系 二分
D. Large Triangletime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a strange peculiarity: if you connect the cities of Rostov, Taganro...原创 2019-09-22 19:35:14 · 272 阅读 · 0 评论 -
cf-650A unordered_map
A. Watchmentime limit per test 3 secondsmemory limit per test 256 megabytesinputstandard inputoutputstandard outputWatchmen are in a danger and Doctor Manhattan together with his friend Daniel Dr...原创 2019-10-02 16:55:35 · 180 阅读 · 0 评论 -
cf-552D 组合数
D. Vanya and Trianglestime limit per test4 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputVanya got bored and he painted n distinct points on the plane. After th...原创 2019-10-03 19:32:28 · 131 阅读 · 0 评论 -
CF-1165D 分解质因子
D. Almost All DivisorsWe guessed some integer number x. You are given a list of almost all its divisors. Almost all means that there are all divisors except 1 and x in the list.Your task is to find ...原创 2019-05-15 09:58:47 · 222 阅读 · 0 评论 -
CF 1155C gcd
C. Alarm Clocks EverywhereIvan is going to sleep now and wants to set his alarm clock. There will be many necessary events tomorrow, the i-th of them will start during the xi-th minute. Ivan doesn’t ...原创 2019-04-23 21:21:41 · 189 阅读 · 0 评论 -
CF 1144D 模拟
D. Equalize Them AllYou are given an array a consisting of n integers. You can perform the following operations arbitrary number of times (possibly, zero):Choose a pair of indices (i,j) such that |i...原创 2019-04-01 18:05:21 · 374 阅读 · 0 评论 -
CF 1140A模拟
A. Detective BookIvan recently bought a detective book. The book is so interesting that each page of this book introduces some sort of a mystery, which will be explained later. The i-th page contains...原创 2019-03-23 19:52:49 · 362 阅读 · 0 评论 -
CF 1140B 思维
B. Good StringYou have a string s of length n consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still...原创 2019-03-23 20:09:36 · 438 阅读 · 0 评论 -
CF 1140C 贪心
C. PlaylistYou have a playlist consisting of n songs. The i-th song is characterized by two numbers ti and bi — its length and beauty respectively. The pleasure of listening to set of songs is equal ...原创 2019-03-23 20:12:35 · 733 阅读 · 2 评论 -
CF 1140D 区间DP
D. Minimum TriangulationYou are given a regular polygon with n vertices labeled from 1 to n in counter-clockwise order. The triangulation of a given polygon is a set of triangles such that each verte...原创 2019-03-23 20:29:15 · 437 阅读 · 0 评论 -
CF 1144A 思维
A. Diverse StringsA string is called diverse if it contains consecutive (adjacent) letters of the Latin alphabet and each letter occurs exactly once. For example, the following strings are diverse: “...原创 2019-04-01 17:55:20 · 207 阅读 · 0 评论 -
CF 1144B 贪心
B. Parity Alternated DeletionsPolycarp has an array a consisting of n integers.He wants to play a game with this array. The game consists of several moves. On the first move he chooses any element a...原创 2019-04-01 17:56:56 · 202 阅读 · 0 评论 -
CF 1144C 模拟
C. Two Shuffled SequencesTwo integer sequences existed initially — one of them was strictly increasing, and the other one — strictly decreasing.Strictly increasing sequence is a sequence of integers...原创 2019-04-01 17:59:00 · 196 阅读 · 0 评论 -
CF 1141B dp
Each day in Berland consists of n hours. Polycarp likes time management. That’s why he has a fixed schedule for each day — it is a sequence a1,a2,…,an (each ai is either 0 or 1), where ai=0 if Polycar...原创 2019-03-21 00:02:40 · 188 阅读 · 0 评论