2015 Changchun Regional】的更多相关文章

弱没机会去长春,但拿了题来做了,加上请教各路大牛,理论AC了一发,但没实现~(感谢各路有形无形的大牛的指导) A题~Too Rich 给你1,5,10,20,50,100,200,500,1000,2000这几个数的个数,用最多的数组成和为p. 解:一眼看上去像个贪心题,其实,如果没有20,50,200,500这样怪的数,确实只是一个 简单的贪心题.转换一下题目,求p用最多的数组成,设S是所有数的和,即要求s-p用最少的 数组成.对于60,如果贪心的话,对20,20,20,50而言,很明显会造成…
Conquer a New Region Time Limit: 5 Seconds      Memory Limit: 32768 KB The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several road…
比赛链接 :点击这里 大概会写 F G J L 吧 F 给你一个序列 最多删除一个数使他构成 最长不上升或者不下降子序列 这题不会不会on的算法只能 t*n*logn 了 还是压常过 求两次 LIS #include<bits/stdc++.h> using namespace std; #define maxn 300005 #define ll int int a[maxn],b[maxn],c[maxn]; int n; inline ll read() { ll x=,f=;char…
Alisha’s Party Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 7971    Accepted Submission(s): 1833 Description Princess Alisha invites her friends to come to her birthday party. Each of her f…
题目链接:https://nanti.jisuanke.com/t/A1842 题目大意:给定整数n,m,k,其中1≤m≤n≤1018,k≤10, 然后给出k个素数,保证M=p[1]*p[2]……*p[k]≤1018,p[i]≤105 求C(n,m)%(p[1]*p[2]……*p[k]) 解题思路:因为模数太大,所以我们先用卢卡斯定理求出对每个素数的模,然后再通过中国剩余定理就可以求得对它们的乘积的模. 代码: #include<bits/stdc++.h> using namespace s…
Bit Magic Problem Description Yesterday, my teacher taught me about bit operators: and (&), or (|), xor (^). I generated a number table a[N], and wrote a program to calculate the matrix table b[N][N] using three kinds of bit operator. I thought my ac…
Problem Description It's yet another festival season in Gensokyo. Little girl Alice planned to pick mushrooms in five mountains. She brought five bags with her and used different bags to collect mushrooms from different mountains. Each bag has a capa…
Conquer a New Region Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 657 Accepted Submission(s): 179 Problem Description The wheel of the history rolling forward, our king conquered a new region i…
Yukari's Birthday Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4934    Accepted Submission(s): 1163 Problem Description Today is Yukari's n-th birthday. Ran and Chen hold a celebration party…
并检查集合 侧降序,每增加一个侧面应该推断,其中基本建设方..... Conquer a New Region Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1169    Accepted Submission(s): 373 Problem Description The wheel of the history rolling…