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)…
Seven Deadly Sins: Gluttony, Greed, Sloth, Wrath, Pride, Lust, and Envy.七宗罪:暴食.贪婪.懒惰.暴怒.傲慢.色欲.妒忌.…
891B - Gluttony 题意 给出一个数字集合 \(a\),要求构造一个数组 \(b\) 为 \(a\) 的某个排列,且满足对于所有下标集合的子集 \(S=\{x_1,x_2,...,x_k\}(1\leq x_i \leq n, 0 < k < n)\),有 \(\sum_{i=1}^{k}a_{x_i}\neq\sum_{i=1}^{k}b_{x_i}\). 分析 不得不说,当我看到 \(n\) 只有 \(22\) 之后就跑偏了. 对于原数组中的每个数,可以直接确定它在新数组中对应…
题目链接:http://codeforces.com/problemset/problem/892/A 具体的Java 中 sort实现降序排序:https://www.cnblogs.com/youpeng/p/10546797.html Ac代码: import java.util.Comparator; import java.util.Scanner; import static java.util.Arrays.sort; public class Main { public stat…
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. 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…
题目出处:http://codeforces.com/problemset/problem/892/A 题目大意:有一些可乐(不一定装满),问能不能把所有可乐装进两个可乐瓶中 #include<iostream> #include<queue> #include<vector> using namespace std; int main(){ priority_queue< long long,vector<long long >,less<lo…
题目出处: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;//输…
A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just around the corner: Gogol is ready to release it's new tablet Lastus 3000. This new device is equipped wi…
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 adjacentelements from a, say…