Codeforces 892 B.Wrath】的更多相关文章

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…
题目链接:https://cn.vjudge.net/problem/CodeForces-892A Jafar has n cans of cola. Each can is described by two integers: remaining volume of cola ai and can's capacity bi (ai  ≤  bi). Jafar has decided to pour all remaining cola into just 2 cans, determin…
C. Pride time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, sa…
D. Gluttony time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array a with n distinct integers. Construct an array b by permuting a such that for every non-empty subset of i…
A. Greed time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jafar has n cans of cola. Each can is described by two integers: remaining volume of cola ai and can's capacity bi (ai  ≤  bi). Jaf…
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)…
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…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 倒着来,维护一个最小的点就可以了. [代码] #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",…
Codeforces Round #446 (Div. 2) 总体:rating涨了好多,虽然有部分是靠和一些大佬(例如redbag和ShichengXiao)交流的--希望下次能自己做出来2333 A. Greed 题意:给你\(n\)个罐子,每个罐子都告诉了你它当前的饮料体积和它的总容积,问能否用两个罐子装下所有饮料(\(n\le 100000\)) 题解:简单模拟即可,用两个最大的算一下,注意累和会爆\(int\) int a[100100], b[100100]; long long s…
---恢复内容开始--- 题意: 有n个犯人,手上都有个长度为Li的武器,当铃响时大家同时挥动武器,只能把前面攻击范围内的敌人杀死,问最后还剩几个人. 题目传送门: [http://codeforces.com/contest/892/problem/B] 思路: 从后面遍历能杀的人,一个一个杀,更新当前能杀的最大人数,用sum统计,最后输出n-sum即可. 代码: #include<bits/stdc++.h> using namespace std; int main(){ ios::sy…