hiho week 28 register

Ended

Participants:703

Verdict:Accepted
Score:100 / 100
Submitted:2015-01-12 16:27:05

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int n;
int h[1000000],num;
void insert(int w)
{
    h[num]=w;
    
    int cur=num;
    int fa=cur>>1;
    while (fa)
    {
        if (h[cur] <= h[fa]) break;
        swap(h[cur],h[fa]);
        cur=fa;
        fa>>=1;
    }
    
    num++;
}
int out()
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX