
杂乱
李自行h
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #656 (Div. 3)C. Make It Good【找规律】
题目传送门You are given an array a consisting of n integers. You have to find the length of the smallest (shortest) prefix of elements you need to erase from a to make it a good array. Recall that the prefix of the array a=[a1,a2,…,an] is a subarray consistin原创 2020-10-20 19:27:09 · 134 阅读 · 0 评论 -
Codeforces Round #666 (Div. 2)B. Power Sequence【暴力】
题目传送门Let’s call a list of positive integers a0,a1,…,an−1 a power sequence if there is a positive integer c, so that for every 0≤i≤n−1 then ai=ci.Given a list of n positive integers a0,a1,…,an−1, you are allowed to:Reorder the list (i.e. pick a permutat原创 2020-10-19 13:47:13 · 145 阅读 · 0 评论 -
Codeforces Round #672 (Div. 2)B. Rock and Lever【找规律】
题目传送门input551 4 3 7 1031 1 146 2 5 322 411output13200题意:T组输入,每次先输入一个n,下面是n个数,问:有几对数字满足 ai & aj≥ai⊕aj,打表之后我们可以发现如果ai的二进制长度等于aj就能满足AC code#include<iostream>#include<algorithm>#include<cstring>#include<原创 2020-10-05 21:46:24 · 153 阅读 · 0 评论 -
Gym - 102394K Keeping Rabbits【简单题】
题目传送门Input31 122 21 33 21 1 1Output3.000000001.50000000 4.500000001.66666667 1.66666667 1.66666667题意:多组输入,首先一个t,t个样例,后面两个数n,m,n只兔子,求m天后兔子的期望重量,每天给一磅胡萝卜,兔子增重的概率由其体重在所有兔子体重占的比例决定思路:兔子每天增重的期望就是体重占比一直不变,我们直接求m天就可以了AC code#include<ios原创 2020-10-03 23:26:39 · 321 阅读 · 0 评论 -
Gym - 102394Justifying the Conjecture【找规律】
题目传送门Input3467Output-12 43 4题意:给出一个数判断是否能拆成一个素数和合数,可以的话输出素数和合数,否则输出-1思路:模拟之后发现这个数减去2或3后剩下的数如果能整除2那么这个数就是符合条件的,否则输出-1,具体上代码AC code#include<iostream>#include<algorithm>#include<cstring>#include<cmath>#include&原创 2020-10-03 23:15:22 · 145 阅读 · 0 评论 -
Codeforces Round #671 (Div. 2)D2. Sage‘s Birthday (hard version)【队列】
传送门input71 3 2 2 4 5 4output33 1 4 2 4 2 5题意:给n个数排列之后使两边的数大于中间的数的情况最多并且要最优序列思路:我们可以先找出有几个可以插入的数,然后按顺序插入就可以了AC code#include<iostream>#include<algorithm>#include<cstring>#include<cmath>#include<map>#include原创 2020-09-22 19:55:18 · 100 阅读 · 0 评论