牛客多校第五场 J:Plan】的更多相关文章

链接:https://www.nowcoder.com/acm/contest/143/J 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 There are n students going to travel. And hotel has two types room:double room and triple room. The price of a double…
牛客多校第3场 J 思维+树状数组+二分 传送门:https://ac.nowcoder.com/acm/contest/883/J 题意: 给你q个询问,和一个队列容量f 询问有两种操作: 0.访问操作,如果询问的name在队列中存在的话,那么就输出队列中name对应的val值,然后将队列中name对应的元素扔到队列的尾部去,否则就直接将该元素插入到队列的尾部去 1.插入操作,得到队列中对应的name元素的v值为k,查询第k+v个元素的v值是多少 题解: 已知,对于插入操作,我们需要很快的查询…
链接:https://www.nowcoder.com/acm/contest/144/J来源:牛客网 skywalkert, the new legend of Beihang University ACM-ICPC Team, retired this year leaving a group of newbies again. Rumor has it that he left a heritage when he left, and only the one who has at lea…
链接:https://www.nowcoder.com/acm/contest/143/E来源:牛客网 Nowcoder University has 4n students and n dormitories ( Four students per dormitory). Students numbered from 1 to 4n. And in the first year, the i-th dormitory 's students are (x1[i],x2[i],x3[i],x4[…
链接:https://www.nowcoder.com/acm/contest/143/F来源:牛客网 题目描述 Kanade has n boxes , the i-th box has p[i] probability to have an diamond of d[i] size. At the beginning , Kanade has a diamond of 0 size. She will open the boxes from 1-st to n-th. When she op…
链接:https://www.nowcoder.com/acm/contest/143/D来源:牛客网 题目描述 Kanade has an even number n and a permutation b of all of the even numbers in [1,n] Let a denote an array [1,3,5....n-1] , now you need to find a permutation of [1,n] satisfy both a and b are s…
链接:https://www.nowcoder.com/acm/contest/143/F来源:牛客网 Kanade has n boxes , the i-th box has p[i] probability to have an diamond of d[i] size. At the beginning , Kanade has a diamond of 0 size. She will open the boxes from 1-st to n-th. When she open a…
比赛的时候脑瘫了没想出来..打多校以来最自闭的一场 显然从s中选择大于m个数组成的数必然比t大,所以只要dp求出从s中选择m个数大于t的方案数 官方题解是反着往前推,想了下反着推的确简单,因为高位的数优先级高,如果高位满足条件,那么低位只要用组合数求一下就行 #include<bits/stdc++.h> using namespace std; #define maxn 3005 #define ll long long #define mod 998244353 int n,m; char…
https://www.nowcoder.com/acm/contest/143/I vc-dimension 题解:分三种情况,组合数学算一下,其中一种要用树状数组维护 技巧(来自UESTC):1.循环技巧i主j滑 2.树状数组:一个数列从左到右分别维护某个元素左边比它大num的与右边比他大的num时,从上往下扫, 对每个点的x坐标离散化累加1到X轴上,然后就会发现sum(p[i].x-1)就是左边比它大的,i-1-sum(p[i])就是右边比它大的. 注意y相同的点,需要一起更新(我已开始一…
题目传送门:https://www.nowcoder.com/acm/contest/142/J 题意:给一个hash table,求出字典序最小的插入序列,或者判断不合法. 分析: eg.对于序列{7,8,16},插入后为{16, -1, -1, -1, -1, -1, -1, 7, 8}.(即,依次插入7,8,16.而插入16时发现7已经被占,所以依次考虑(h(x)+1)%n ,因此16放在0的位置上.)这是正向插入,问题是给一个最终序列,问插入序列. 通过对hash表的观察可以得到: 一个…