Three Equal Time limit: 1000 msMemory limit: 256 MB You are given an array AA of NN integers between 00 and 22. With cost 11 you can apply the following operation A_i = ((A_i + 1)\ \% \ 3)Ai=((Ai+1) % 3). Find the minimum cost to make all ele…
Rikka with Phi Accepts: 5 Submissions: 66 Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description Rikka and Yuta are interested in Phi function (which is known as Euler's totient function). Yuta giv…
Rikka with Graph Accepts: 123 Submissions: 525 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述 众所周知,萌萌哒六花不擅长数学,所以勇太给了她一些数学问题做练习,其中有一道是这样的: 给出一张 nn 个点 n+1n+1 条边的无向图,你可以选择一些边(至少一条)删除. 现在勇太想知道有多少种方案使得删除之后图依然联通.…
Rikka with Chess Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 177 Accepted Submission(s): 161 Problem Description Yuta gives Rikka a chess board of size n×m. As we all know, on a chess boa…
csa66 Risk Rolls Time limit: 1000 msMemory limit: 256 MB Alena and Boris are playing Risk today. We'll call an outcome the sum of values on the faces of 111 or more rolled dice. Alena has NNN possible outcomes whilst Boris has MMM. In turns, each o…
传送门 题意 给出一个排列,定义\(value为\sum_{i=1}^{n-1}abs(f[i+1]-f[i])\) \(swap(a[i],a[j])(i≠j)为一次交换\),询问最少的交换次数使得value最大 分析 如果f[i+1]>f[i],答案就+f[i+1]-f[i]; 如果f[i+1]<f[i],答案就+f[i]-f[i+1]; 那么我们可以找到一个pretty good solution 定义 L 为 f[i]<=n/2, R 为 f[i]>n/2, 得到L R L…