- 博客(13)
- 资源 (2)
- 收藏
- 关注
原创 区间重叠问题 Size Balanced Tree Gym - 101755C
Pavel is developing a game. To do that, he needs functions available in a third-party library too famous to be called. It is known that the function i first appeared in version ai and existed until ve...
2018-07-31 15:13:55 290
原创 扩展欧几里得求乘法逆元
好久没发博客了,总结下今晚学的扩展欧几里得吧虽然现在也没学会ax + by = c扩展欧几里得知道a b c 求x y求乘法逆元a*x = 1(mod m)知道a和m 求x先复习一下欧几里得求最大公约数吧inr gcd(int x,int y){ if(y==0) return x; else return gcd(y,x%y);}求 ax...
2018-07-30 21:03:13 352
原创 Coins and Queries CodeForces - 1003D
Polycarp has nn coins, the value of the ii-th coin is aiai. It is guaranteed that all the values are integer powers of 22 (i.e. ai=2dai=2d for some non-negative integer number dd).Polycarp wants to kn...
2018-07-13 22:07:57 190
原创 Intense Heat CodeForces - 1003C
The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But an...
2018-07-13 22:07:17 168
原创 Binary String Constructing CodeForces - 1003B
You are given three integers aa, bb and xx. Your task is to construct a binary string ssof length n=a+bn=a+b such that there are exactly aa zeroes, exactly bb ones and exactlyxx indices ii (where 1≤i&...
2018-07-13 22:06:18 206
原创 Polycarp's Pockets CodeForces - 1003A
Polycarp has nn coins, the value of the ii-th coin is aiai. Polycarp wants to distribute all the coins between his pockets, but he cannot put two coins with the same value into the same pocket.For exa...
2018-07-13 22:05:35 241
原创 Points and Powers of Two CodeForces - 988D
There are n distinct points on a coordinate line, the coordinate of i-th point equals to xi. Choose a subset of the given set of points such that the distance between each pair of points in a subset i...
2018-07-05 21:12:53 132
原创 Equal Sums CodeForces - 988C
You are given k sequences of integers. The length of the i-th sequence equals to ni.You have to choose exactly two sequences i and j (i≠j) such that you can remove exactly one element in each of them ...
2018-07-05 21:12:16 190
原创 Substrings Sort CodeForces - 988B
You are given n strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string, all strings that are placed before it are its sub...
2018-07-05 21:11:38 170
原创 Diverse Team CodeForces - 988A
There are n students in a school class, the rating of the i-th student on Codehorses is ai. You have to form a team consisting of k students (1≤k≤n) such that the ratings of all team members are disti...
2018-07-05 21:10:54 265
原创 Alphabetic Removals CodeForces - 999C
You are given a string s consisting of n lowercase Latin letters. Polycarp wants to remove exactly k characters (k≤n) from the string s. Polycarp uses the following algorithm k times: if there is at l...
2018-07-05 21:09:27 206
原创 Reversing Encryption CodeForces - 999B
A string s of length n can be encrypted by the following algorithm: iterate over all divisors of n in decreasing order (i.e. from n to 1#include <iostream>#include <cstdio>#include <c...
2018-07-05 21:08:39 190
原创 Mishka and Contest CodeForces - 999A
Mishka started participating in a programming contest. There are n problems in the contest. Mishka's problem-solving skill is equal to k.Mishka arranges all problems from the contest into a list. Beca...
2018-07-05 21:07:55 162
ACM国际大学生程序设计竞赛:知识与入门 俞勇
2018-08-29
ACM国际大学生程序设计竞赛:算法与实现 俞勇
2018-08-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人