MSBOP 2015 Round3 register

Ended

Participants:978

Verdict:AC | WA
Submitted:2015-05-09 15:51:30

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<vector>
#include<cstring>
using namespace std;
#define pb push_back
const int maxn=100010;
const int maxk=17;
int n,k,ans;
int c[maxn];
vector<int> a[maxk];
int dis[maxk][maxk];
int f[(1<<16)+100];
int st[maxk][maxn];
void add(int *st,int x,int inc)
{
  while (x<n+1)
  {
    st[x]+=inc;
    x|=x+1;
  }
}
int sum(int *st,int x)
{
  int s=0;
  while (x>=0)
  {
    s+=st[x];
    x=(x&(x+1))-1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX