CF892.B. Wrath】的更多相关文章

---恢复内容开始--- 题意: 有n个犯人,手上都有个长度为Li的武器,当铃响时大家同时挥动武器,只能把前面攻击范围内的敌人杀死,问最后还剩几个人. 题目传送门: [http://codeforces.com/contest/892/problem/B] 思路: 从后面遍历能杀的人,一个一个杀,更新当前能杀的最大人数,用sum统计,最后输出n-sum即可. 代码: #include<bits/stdc++.h> using namespace std; int main(){ ios::sy…
B. Wrath time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Hands that shed innocent blood! There are n guilty people in a line, the i-th of them holds a claw with length Li. The bell rings a…
Seven Deadly Sins: Gluttony, Greed, Sloth, Wrath, Pride, Lust, and Envy.七宗罪:暴食.贪婪.懒惰.暴怒.傲慢.色欲.妒忌.…
B. Wrath time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Hands that shed innocent blood! There are n guilty people in a line, the i-th of them holds a claw with length Li. The bell rings a…
A  链接:http://codeforces.com/problemset/problem/892/A 签到 #include <iostream> #include <algorithm> using namespace std; ]; int main() { int n; ,sum2=; cin>>n; ; i<n; ++i) cin>>a,sum1+=a; ; i<n; ++i) cin>>b[i]; sort(b,b+n)…
题目传送门: [http://codeforces.com/contest/892/problem/C] 题意: 给你一个长度为n的数组,相邻两个元素的GCD(最大公约数)可以取代二者的任意一个,问你最少需要多少个操作数使得所有元素变为1. 如果不可以全化为1,输出0. 思路: GCD性质:gcd(gcd(a,b),gcd(b,c))=gcd(gcd(a,b),c)=gcd(a,gcd(b,c)).先特判一下初始数组有1这个元素,那么假设有sum1个,输出,n-sum1就好了,因为1可以扩展到其…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 倒着来,维护一个最小的点就可以了. [代码] #include <bits/stdc++.h> using namespace std; const int N = 1e6; int a[N+10],n; int isdead[N+10]; int main(){ #ifdef LOCAL_DEFINE freopen("F:\\c++source\\rush_in.txt", "r",…
题目出处:http://codeforces.com/problemset/problem/892/B 题目大意:一队人同时举刀捅死前面一些人后还活着几个 #include<iostream> #define IO ios::sync_with_stdio(false);\ cin.tie(0);\ cout.tie(0); using namespace std; typedef __int64 LL; ; int p[maxn]; //库中有max同名 int main(){ IO;//输…
转:http://www.cnblogs.com/linjiqin/archive/2011/07/17/2108896.html 简介:jQuery Mobile框架可以轻松的帮助我们实现非常好看的.可跨设备的Web应用程序.我们将后续的介绍中向大家介绍大量的代码及实例. jQuery一直以来都是非常流行的富客户端及Web应用程序开发中使用的JavaScript类库,然而一直以来它都是为桌面浏览器设计的,没有特别为移动应用程序设计. jQuery Mobile是一个新的项目用来添补在移动设备应…
001 Love your neighbor as yourself.         要爱人如己.--<旧·利>19:18      002 Resentment kills a fool, and envy slays the simple.         忿怒害死愚妄人,嫉妒杀死痴迷人.--<旧·伯>5:2 003 Does a wild donkey bray when it has grass, or an ox bellow when it has fodder?  …