链接: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…
E. Ehab and a component choosing problem 题目链接:https://codeforces.com/contest/1088/problem/E 题意: 给出一个数,找出k个连通块,使得连通块里面点的和除以k最大.当选择不同数量的连通块有相同的最大值时,要求输出k最大的情况. 题解: 由于这个不等式average(x1,x2,x3...xn)<=max(x1,x2,...xn)成立(当且仅当x1=x2=...xn时,等号成立),而题目所求正好是连通块里面点和…
D. Ehab and another another xor problem 题目链接:https://codeforces.com/contest/1088/problem/D Description: This is an interactive problem! Ehab plays a game with Laggy. Ehab has 2 hidden integers (a,b)(a,b). Laggy can ask a pair of integers (c,d)(c,d) a…
链接: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? 思路: 排序后求前一半和后一半的和比较. 代码: #…