best corder MG loves gold】的更多相关文章

MG loves gold  Accepts: 451  Submissions: 1382  Time Limit: 3000/1500 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others) Problem Description MG is a lucky boy. He is always be able to find gold from underground. It is known that the gold i…
MG loves gold Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 1607    Accepted Submission(s): 659     Problem Description MG is a lucky boy. He is always be able to find gold from underground…
[题目链接]:http://acm.hdu.edu.cn/showproblem.php?pid=6019 [题意] 每次选择一段连续的段,使得这一段里面没有重复的元素; 问你最少选多少次; [题解] 从第一个元素开始一直选就好; 不能选了就把之前的记忆清除掉; 然后重新开始选;重新记忆选过哪些元素; 写个map就好. [完整代码] #include <bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #defin…
http://acm.hdu.edu.cn/showproblem.php?pid=6019 题意:给出n个颜色的物品,你每次取只能取连续的不同颜色的物品,问最少要取多少次. 思路:从头往后扫,用set存之前取了什么物品,然后每次重复就clear,ans++. #include <bits/stdc++.h> using namespace std; #define N 100010 int c[N]; set<int> se; int main() { int t; scanf(…
题目链接:点击传送 MG loves apple Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Problem Description MG is a rich boy. He has n apples, each has a value of V(0<=V<=9). A valid number does not contain a leading zero, and…
MG loves string  Accepts: 30  Submissions: 67  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others) 问题描述 MG是一个很忙碌的男孩子.今天他沉迷于这样一个问题: 对于一个长度为N的由小写英文字母构成的随机字符串,当它进行一次变换,所有字符i都会变成a[i]. MG规定所有a[i]构成了26个字母组成的排列. MG现在需要知道这个随机串…
MG loves apple  Accepts: 20  Submissions: 693  Time Limit: 3000/1500 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others) 问题描述 MGMG是一个财富爆表的男孩子.他拥有N(1<=N<=100000)N(1<=N<=100000)个苹果,每个苹果上标有一个数字00~99,代表它的价值. 一个合法的数字是不含有前导零的,这nn个苹果恰好排成了一个…
MG loves string Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 131    Accepted Submission(s): 50 Problem Description MG is a busy boy. And today he's burying himself in such a problem: For a…
MG loves string Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Problem Description MG is a busy boy. And today he's burying himself in such a problem: For a length of N, a random string made of lowercase letters…
MG loves string    Accepts: 30    Submissions: 67  Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) 问题描述 MGMG是一个很忙碌的男孩子.今天他沉迷于这样一个问题: 对于一个长度为NN的由小写英文字母构成的随机字符串,当它进行一次变换,所有字符ii都会变成a[i]a[i]. MGMG规定所有a[i]a[i]构成了2626个…
题链: http://acm.hdu.edu.cn/showproblem.php?pid=6021 题解: 题意:对于一个长度为 N的由小写英文字母构成的随机字符串,当它进行一次变换,所有字符 i 都会变成a[i].同时变换数组:a[i]是26个字母组成的排列.现在需要知道这个随机串变换到自身的期望变换次数.请你输出期望答案乘上26^N以后模 1000000007的结果. 容斥,LCM 其实题目要求的就是每种串(共有 26^N种串)回到自身的变化次数之和. 暴力求法就是:看每种串的每个字符在循…
这场BC实在是有趣啊,T2是个没有什么算法但是细节坑的贪心+分类讨论乱搞,T3反而码起来很顺. 然后出现了T2过的人没有T3多的现象(T2:20人,T3:30人),而且T2的AC率是惨烈的不到3% (我T2读入写挂,思路想挂,推倒重码一次,交了7次才过QAQ) 最后狂码T3赶在结束之前调出来过了,3题最后都没有被叉也没有fst,捡了个rk9,人品好啊. 题意 给出26个字母的一个排列,对一个字符串进行一次变换表示将某个字母变成排列中对应的字母. 例如zabcdefg....wxy,1表示经过一次…
[题目链接]:http://acm.hdu.edu.cn/showproblem.php?pid=6020 [题意] 给你一个长度为n的数字,然后让你删掉k个数字,问你有没有删数方案使得剩下的N-K个数字是3的倍数; [题解] 这里我们枚举最后N-K个数字它的最高位是第几位; 这样我们就能在枚举最高位的时候直接判断这个数字是不是0;这样对合法性的处理就简单很多了; 我们枚举第i位是最高位,言外之意就是说前i-1个数字已经全部被删掉了; 则我们要在i+1..n这些数字里面再删掉k-i+1个数字才行…
[题目链接]:http://acm.hdu.edu.cn/showproblem.php?pid=6022 [题意] 让你求一个集合的子集数目; 这个子集有要求; 即: 它所有元素的平方的和小于它所有元素的和的平方. [题解] 假设一个集合大小为3元素为a1,a2,a3 则 a12+a22+a32<=(a1+a2+a3)2 化简一下可以得到 a1∗a2+a1∗a3+a2∗a3>=0 所以原限制条件其实可以转化为一个集合里面任意两个数的乘积的和大于等于0; 但是你不好直接去枚举这个集合的子集:…
题目链接 Problem Description MG is a rich boy. He has n apples, each has a value of V(0<=V<=9). A valid number does not contain a leading zero, and these apples have just made a valid N digit number. MG has the right to take away K apples in the sequenc…
微软新任CEO纳德拉提出的“Microsoft Loves Linux”,并且微软宣布.NET框架的开源,近期Microsoft不但宣布了Linux平台的SQL Server,还宣布了Microsoft将重新建立对开源软件的支持,包括对Xamarin的收购,以及加入Eclipse基金会. SQL Server将会在 Linux上提供核心关系型数据库功能,旨在让SQL Server成为横跨Windows服务器和Linux的数据平台.目前有很多使用Linux但希望使用MS SQL Server的企业…
传送门 NanoApe Loves Sequence Ⅱ Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 1585    Accepted Submission(s): 688 Description NanoApe, the Retired Dog, has returned back to prepare for for the…
传送门 NanoApe Loves Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others) Total Submission(s): 1323    Accepted Submission(s): 521 Description NanoApe, the Retired Dog, has returned back to prepare for the Natio…
C. DZY Loves Colors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output DZY loves colors, and he enjoys painting. On a colorful day, DZY gets a colorful ribbon, which consists of n units (they…
题目 Source http://codeforces.com/problemset/problem/444/C Description DZY loves colors, and he enjoys painting. On a colorful day, DZY gets a colorful ribbon, which consists of n units (they are numbered from 1 to n from left to right). The color of t…
A. DZY Loves Chessboard time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves chessboard, and he enjoys playing with it. He has a chessboard of n rows and m columns. Some cells of the c…
Problem Description You are given N baskets of gold coins. The baskets are numbered from 1 to N. In all except one of the baskets, each gold coin weighs w grams. In the one exceptional basket, each gold coin weighs w-d grams. A wizard appears on the…
A.Kblack loves flag [题目链接]A.Kblack loves flag [题目类型]水题 &题意: kblack喜欢旗帜(flag),他的口袋里有无穷无尽的旗帜. 某天,kblack得到了一个n*m的方格棋盘,他决定把kk面旗帜插到棋盘上. 每面旗帜的位置都由一个整数对(x,y)来描述,表示该旗帜被插在了第x行第y列. 插完旗帜后,kblack突然对那些没有插过旗帜的行和列很不满,于是他想知道,有多少行.列上所有格子都没有被插过旗帜. kblack还要把妹,于是就把这个问题丢…
Problem Introduction This problem is about implementing an algorithm for the knapsack without repetitions problem. Problem Description Task.In this problem, you are given a set of bars of gold and your goal is to take as much gold as possible into yo…
CA Loves GCD  Accepts: 135  Submissions: 586  Time Limit: 6000/3000 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others) 问题描述 CA喜欢是一个热爱党和人民的优秀同♂志,所以他也非常喜欢GCD(请在输入法中输入GCD得到CA喜欢GCD的原因). 现在他有N个不同的数,每次他会从中选出若干个(至少一个数),求出所有数的GCD然后放回去. 为了使自己不会无聊,C…
Dylans loves tree view code#pragma comment(linker, "/STACK:1024000000,1024000000") #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <vector> #include <queue> #include <…
NanoApe Loves Sequence Ⅱ  Accepts: 374  Submissions: 946  Time Limit: 4000/2000 MS (Java/Others)  Memory Limit: 262144/131072 K (Java/Others) 问题描述 退役狗 NanoApe 滚回去学文化课啦! 在数学课上,NanoApe 心痒痒又玩起了数列.他在纸上随便写了一个长度为 nn 的数列,他又根据心情写下了一个数 mm. 他想知道这个数列中有多少个区间里的第…
3309: DZY Loves Math Time Limit: 20 Sec  Memory Limit: 512 MBSubmit: 761  Solved: 401[Submit][Status][Discuss] Description 对于正整数n,定义f(n)为n所含质因子的最大幂指数.例如f(1960)=f(2^3 * 5^1 * 7^2)=3, f(10007)=1, f(1)=0.给定正整数a,b,求sigma(sigma(f(gcd(i,j)))) (i=1..a, j=1.…
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; #define PI pair<int,int> #define fi first #define se second #define mp(a,b) make_pair(a,b) #define maxn…
题目链接: 传送门 DZY Loves Chemistry time limit per test1 second     memory limit per test256 megabytes Description DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density of a non-directed gr…