[Offer收割]编程练习赛32 register

Ended

Participants:237

Verdict:Accepted
Score:100 / 100
Submitted:2017-10-22 14:14:09

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
#define __USE_MINGW_ANSI_STDIO 0
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1001;
vector<vector<int>> graph(maxn, vector<int>(maxn, 0));
int N, K;
struct Pos{
    int x;
    int y;
    int g;
    Pos(int x, int y, int g): x(x), y(y), g(g) {};
};
bool operator<(const Pos& a, const Pos& b){
    return a.g < b.g;
}
int main(){
    priority_queue<Pos, vector<Pos>, less<Pos>> pq;
    int x, y, g;
    vector<int> xx = {-1, 1, 0, 0};
    vector<int> yy = {0, 0, -1, 1};
    cin >> N >> K;
    for(int i = 0;i < K;i++){
        cin>>x >> y >> g;
        pq.push(Pos(x, y, g));
    }
    while(!pq.empty()){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX