- 博客(14)
- 收藏
- 关注
原创 div2 334 B binary search/ greedy 1400
原文题目Kevin Sun wants to move his precious collection of n cowbells from Naperthrill to Exeter, where there is actually grass instead of corn. Before moving, he must pack his cowbells into k boxes of a...
2019-09-10 21:32:47 141
原创 cf global 1 B greedy sortings 1400
原文题目You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.You have an infinitely long rep...
2019-08-29 18:07:43 429
原创 497 div1 A sorting two pointers 1300
原文题目You are given an array of integers. Vasya can permute (change order) its integers. He wants to do it so that as many as possible integers will become on a place where a smaller integer used to st...
2019-08-27 21:43:43 169
原创 559 div2B math 1300 题解
原文题目There 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 remai...
2019-08-23 23:01:33 152
原创 cf 569 div2 B题解
题目原文Nick had received an awesome array of integers a=[a1,a2,…,an] as a gift for his 5 birthday from his mother. He was already going to explore its various properties but after unpacking he was disap...
2019-08-20 20:03:53 178
原创 580 div2 C题解
题目描述You are given integer n. You have to arrange numbers from 1 to 2n, using each of them exactly once, on the circle, so that the following condition would be satisfied:For every n consecutive numb...
2019-08-19 20:14:54 163
原创 cf 535 div3 B 题解
(用心诠释什么叫心态炸裂)原题Recently you have received two positive integer numbers x and y. You forgot them, but you remembered a shuffled list containing all divisors of x (including 1 and x) and all divisors ...
2019-08-14 13:47:50 197
原创 cf 570 div3 D题解
原题This problem is actually a subproblem of problem G from the same contest.There are n candies in a candy box. The type of the i-th candy is ai (1≤ai≤n).You have to prepare a gift using some of the...
2019-08-13 15:33:31 187
原创 算法-二分
暑期学习—二分题目描述(poj-3258)Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, s...
2019-08-09 23:06:42 146
原创 cf 560 div3 -D
We 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 the minimum possible in...
2019-07-09 14:59:32 217
原创 士兵队列训练问题
题意 hdoj1276 典型的队列问题,入门水题题解:(第一次做普通队列,引用了别人的算法,优化了一下,题解记录学到的一点东西)队列和数组之类的东西完全不同,和栈一样,被固定的顺序和进出卡的很死,所以在做队列的题目时,不能像数组一样思维因为是3个人,所以首先按队列的大小来卡人数,初始化的时候,从1开始进入队列,然后因为是2,3删除交替出现,所以很容易想到用奇偶性来判断是删除2还是3,之后用...
2019-03-31 20:40:50 624
原创 map(-)
map典例 hdoj 1251 统计难题#include <bits/stdc++.h>using namespace std;int main(){ int n,i,j,k,t; string b; char a[52]; map<string,int>m; while(gets(a)) { ...
2019-03-17 12:33:37 132
原创 ACM-题解
hdoj 1005题意:A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).题解:开始一直想暴力递归,发现这就是一个简单的...
2019-02-26 00:01:58 290
原创 ACM之路
ACM之路水题系列:1.人见人爱A+B题意:给出了小时分钟和秒,计算加法之后的时间题解:循环判断进位,60进一次2.人见人爱A-B题意:算两个集合的差值题解:从一个数组映射到另外一个数组,对数组进行排序,定义一个新的数组来进行标记,用循环将满足条件的输出3.人见人爱A^B题意:计算A^B的最后三位数题解:循环保留最后的数字,和noj上一个类似,将保留的数字进行次方,避免超出数据...
2019-02-23 01:58:41 3698
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人