码迷,mamicode.com
首页 >  
搜索关键字:1090. in the army no    ( 211个结果
Saruman's Army
#include<cstdio> #include<iostream> #include<set> #include<algorithm> using namespace std; set<int> s; int main(void) { int R, n; while (cin >> R >> n ...
分类:其他好文   时间:2021-02-08 12:52:08    阅读次数:0
2Ants(独立,一个个判,弹性碰撞,想象)
AntsDescriptionAn army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of th ...
分类:其他好文   时间:2020-07-21 01:11:57    阅读次数:78
Codeforces Round #326 (Div. 1) C - Duff in the Army
树上主席树。 题意要求求u-v的路径上,前k小个数字是多少。转换一下,每次求1-k小的数字。故我们想到了树上主席树。 基于树上点前缀和的特点有:$sum[u]+sum[v]-sum[lca]-sum[fa[lca]]$是u-v路径的和。我们基于此,使用主席树,每个子树是权值线段树。就可以使用前缀和的 ...
分类:其他好文   时间:2020-07-07 17:35:54    阅读次数:57
贪心法-------Saruman's army
此题的策略是选取可用范围最右边的点,一般来说该点辐射两边,左侧辐射,右侧辐射,所以用两个循环,第一个循环找出该点,第二个循环求出最右边的点 源代码: #include<iostream>#include<algorithm>using namespace std;#define maxn 1100i ...
分类:其他好文   时间:2020-05-29 21:33:35    阅读次数:70
POJ1852 Ants 题解
题目 An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it i ...
分类:其他好文   时间:2020-04-14 15:20:24    阅读次数:89
[poj1852] Ants
题目 An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it i ...
分类:其他好文   时间:2020-04-14 12:25:13    阅读次数:52
题解 SP2727 【ARMY - Army Strength】
这是蒟蒻的第一篇题解,下面记录一下我做道题的真实思路过程。 首先看题,两个军队互怼,一个人一个人的打,战斗力高的获胜。 那我们可以考虑一下直接模拟,开两个数组,或者 vector 也行,然后输入每个人的战斗值,开两个指针,哪一方军队实力较差,就让它的指针向后一个位置。 我们又看到 1.46GB 的限 ...
分类:其他好文   时间:2020-02-22 21:58:50    阅读次数:73
029. Python多态介绍
多态:不同的子类对象,调用相同的父类方法,产生不同的结果 继承 重写 在不改变原有代码的前提下,实现了不同的效果 class Soldier(): # 攻击 def attack(self): pass # 后退 def back(self): pass # 陆军 class Army(Soldie ...
分类:编程语言   时间:2020-02-16 16:10:08    阅读次数:61
零基础入门python爬虫(一)
?写在前面 : 欢迎加入纯干货技术交流群Disaster Army:317784952 接到5月25日之前要交稿的任务我就一门心思想写一篇爬虫入门的文章,可是我并不会。还好有将近一个月的时间去学习,于是我每天钻在书和视频教程里。其实并不难的,我只是想做到能够很好的理解它并用自己的语言较好的表达出来, ...
分类:编程语言   时间:2020-02-11 23:08:22    阅读次数:130
POJ 3069 Saruman's Army
1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<queue> 5 #include<map> 6 #include<vector> 7 #include<set> 8 #include<string> ...
分类:其他好文   时间:2020-01-31 18:49:43    阅读次数:71
211条   1 2 3 4 ... 22 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!