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…
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…
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(…
推理可得终于结果为2的(n-可分组合数)次方. 问题是怎么求出可分组合数,深搜就可以,当然并查集也能够. AC代码例如以下: 深搜代码!!! #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #define M 100005 #define ll long long using namespace std; int a…
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个苹果恰好排成了一个…