Welcome, Guest! Sign Up RSS

Clever Space

Friday, 11.22.2024
Main » 2013 » September » 25

用堆来解(套个set)

复杂度为O(mnlgn)

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<set>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<iostream>
#include<string>
#define N 100010
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
typedef long long LL;
using namespace std;
struct node
{
  int x,y;
  long long d;
  bool operator<(const node A)const
  {
    if (d<A.d) return 1;
    if (d>A.d) return 0;
    if (d==A.d)
    {
      if (x<A.x) return 1;
      return 0;
&nbs ... Read more »
Views: 463 | Added by: dhy0077 | Date: 09.25.2013

coding

Views: 341 | Added by: dhy0077 | Date: 09.25.2013