Codeforces Round #563 (Div. 2)/CF1174 CF1174A Ehab Fails to Be Thanos 其实就是要\(\sum\limits_{i=1}^n a_i\)与\(\sum\limits_{n+1}^{2n}a_i\)差值最大,排一下序就好了 CF1174B Ehab Is an Odd Person 一个显然的结论就是如果至少有一个奇数和一个偶数,那么是可以随意调整的,也就是升序排序 否则不可以进行任何操作 code CF1174C Ehab an…
链接:https://codeforces.com/contest/1174/problem/C 题意: You're given an integer nn. For every integer ii from 22 to nn, assign a positive integer aiai such that the following conditions hold: For any pair of integers (i,j)(i,j), if ii and jj are coprime…
链接:https://codeforces.com/contest/1174/problem/B 题意: You're given an array aa of length nn. You can perform the following operation on it as many times as you want: Pick two integers ii and jj (1≤i,j≤n)(1≤i,j≤n) such that ai+ajai+aj is odd, then swap…
链接:https://codeforces.com/contest/1174/problem/A 题意: You're given an array aa of length 2n2n. Is it possible to reorder it in such way so that the sum of the first nn elements isn't equal to the sum of the last nn elements? 思路: 排序后求前一半和后一半的和比较. 代码: #…
C. Ehab and a Special Coloring Problem 题目链接:http://codeforces.com/contest/1174/problem/C 题目 You're given an integer n. For every integer i from 2 to n, assign a positive integer ai such that the following conditions hold: For any pair of integers (i,…
B.Ehab Is an Odd Person 题目链接:http://codeforces.com/contest/1174/problem/B 题目 You’re given an array a of length n. You can perform the following operation on it as many times as you want: Pick two integers i and j (1≤i,j≤n) such that ai+aj is odd, the…
A. Ehab Fails to Be Thanos 题目链接:http://codeforces.com/contest/1174/problem/A 题目 You’re given an array a of length 2n. Is it possible to reorder it in such way so that the sum of the first n elements isn’t equal to the sum of the last n elements? Inpu…