码迷,mamicode.com
首页 >  
搜索关键字:round    ( 15566个结果
Codeforces Round #629 (Div. 3) E. Tree Queries(LCA)
https://codeforces.com/contest/1328/problem/E 题目所描述的是一棵树,题中已明示1为root结点。 题目可以转化为,是否存在一条路径,满足集合中的k个点到路径的距离小于等于1? 思路: 1.首先倍增离线预处理出结点深度,便于后续在线询问LCA 2.对于每次 ...
分类:其他好文   时间:2020-03-29 01:40:42    阅读次数:93
Codeforces Round #627 (Div. 3) 补题
"CF1324A Yet Another Tetris Problem" 长度为n的数组a中有一组数,可以任意使其中一项+2,问能否使a中所有项的值相同。 感觉div.3的题目更多地在考简化问题的能力……比如原题目以俄罗斯方块作背景,让我想到的是能不能消除所有方块,导致代码很难写。但如果像上述一样简 ...
分类:其他好文   时间:2020-03-29 01:16:57    阅读次数:71
Codeforces Round #629 (Div. 3) F - Make k Equal (离散化 树状数组维护前缀和)
https://codeforces.com/contest/1328/problem/F 首先把a数组处理成pair对(num,cnt),表示数字num有cnt个,然后按num升序排序离散化一下。 对于一个数x,若想使得小于x的数字都变成x,必须先把所有小于x的数变成x-1,然后再+1变成x。 同 ...
分类:编程语言   时间:2020-03-29 01:15:50    阅读次数:94
Round A 2020 - Kick Start 2020
Allocation 题意:n(1e5)个数,选出尽可能多的数使他们总和小于等于b。 思路:排序,尽可能取小。 1 #include<bits/stdc++.h> 2 #define LL long long 3 #define dl double 4 void rd(int &x){ 5 x=0; ...
分类:其他好文   时间:2020-03-28 23:32:23    阅读次数:106
a除于b
a=eval(input()) b=eval(input()) if b!=0: print("{}".format(round(a/b,2))) else: print("除零错误") ...
分类:其他好文   时间:2020-03-28 23:25:06    阅读次数:63
Codeforces Round #629 (Div. 3) E. Tree Queries(lca题)
https://codeforces.com/contest/1328/problem/E E. Tree Queries You are given a rooted tree consisting of nn vertices numbered from 11 to nn. The root o ...
分类:其他好文   时间:2020-03-28 22:01:47    阅读次数:177
c++实现四舍五入
四舍五入的数学原理介绍:对正数a.x:如果0.x<0.5,即舍去。四舍五入结果为:a 如果0.x>=0.5,即进位。四舍五入结果为:a+1对负数,先转化为正数,四舍五入之后,转化结果再取负。调用C++自带函数round:写头文件#include<math.h>使用int round(double x ...
分类:编程语言   时间:2020-03-28 21:36:24    阅读次数:84
django3踩坑
1、创建django项目 $ django-admin startproject DailyFresh 2、进入项目目录 $ cd DailyFresh 3、启动项目 $ python manage.py runserver Watching for file changes with StatRe ...
分类:其他好文   时间:2020-03-28 21:35:42    阅读次数:100
Make k Equal from Codeforces Round #629 (Div. 3)
description you are given an array and you are asked to make $k$ elements of it equal after some operations. you can make one of the following operati ...
分类:其他好文   时间:2020-03-28 20:20:02    阅读次数:99
CF Round #629
CF Round 629 A.数学 给定a,b,现在问你最小让a加多少使得a能被b整除,可以为0 即算(b (a%b))%b B.数学 给定n和k 问以n 2个a和2个b组成的串中,以字典序升序排列,问第k个是几 这个有点类似康托展开,这个简化了很多 首先考虑第一个b,它处在从左往右数第p位,那么无 ...
分类:其他好文   时间:2020-03-28 16:09:31    阅读次数:65
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!