【题目链接】click here~~
【题目大意】给你n个玩具,规定只能小的玩具套在大的上面,而且是规格依次递增的,比如:1->2->3,求所有玩具套完需要的最小时间花费
【解题思路】:只能怪CF时间太晚了,本来前一天熬夜,精神有点疲劳,这次第一题还是赛后补做的,哎~~只能说太虚~~
我的做法:找到序列为1 的,然后依次判断后面的
代码:
#include
using namespac...
分类:
其他好文 时间:
2015-06-28 17:12:06
阅读次数:
125
思路:对于每个点而言、只与它相邻的两个点有关系、所以可以用set或者线段树来找到它的相邻点、
#include
#include
#include
using namespace std;
const int N = 200000 + 1;
int x[N], y[N], t[N];
int main() {
int n, q;
scanf("%d%d", &...
分类:
其他好文 时间:
2015-06-28 17:10:09
阅读次数:
106
这篇距离上次更新已经过去很久了。所幸阅读的人并不多,因为该教程还未更完,估计只看了之前那个粗糙案例的人要沮丧了。这里使用一个完整的实例来弥补之前留下的坑。首先创建一个窗体程序TTSApp,界面布局如下:相应的素材可以在对应的源码中找到。这里就不具体介绍了。下面看程序的详细代码:using Syst....
分类:
其他好文 时间:
2015-06-28 17:02:25
阅读次数:
204
/*
Name: Hash
Copyright:
Author: huowolf
Date: 27/06/15 20:57
Description: HashTable的简单实现
*/
#include
using namespace std;
#define MAXSIZE 17 //该值最好采用某个4n+3形式的素数
#define NULLKEY -1
#def...
分类:
其他好文 时间:
2015-06-28 15:42:06
阅读次数:
135
甲说前两位相同,乙说后两位相同,丙说四位的车牌号刚好是一个数的平方,这个车牌号是多少?
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int k, c;
...
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Configuration;using System...
分类:
数据库 时间:
2015-06-28 14:08:18
阅读次数:
208
#include
#include
using namespace std;
int a[10000]={-1,4,5,2,1,3,7};
int n=5;
void Is(){
for(int i=2;i<=n;i++){
if(a[i]<a[i-1]){
a[0]=a[i];
int l=1,h=i-1;
...
分类:
其他好文 时间:
2015-06-28 12:47:02
阅读次数:
108
JavaScript is inserted into HTML pages by using the element. This element can be used
to embed JavaScript into an HTML page, leaving it inline with the rest of the markup, or to include
JavaScrip...
分类:
编程语言 时间:
2015-06-28 12:46:48
阅读次数:
128
题目链接:https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1732
hint:素因子分解#include
#include
#include
using namespace std;
typedef long long LL;...
分类:
其他好文 时间:
2015-06-28 12:46:34
阅读次数:
89
求两个整型数组的异集,即A+B-(A与B的交集)。
例如a[]={1,2,3,4,5}, b[]={2,3},则a,b的异集为{1,4,5}。#include
#include
using namespace std;
int main(int argc,char *argv[])
{
int ma,mb;
cout << "请输入数组a的...
分类:
编程语言 时间:
2015-06-28 12:44:02
阅读次数:
110