# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28328 | /*Sn*/ (#68) | Alternative Mart (FXCUP2_mart) | C++11 | 1709 ms | 61808 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct Z { int x, y, c; } T[80003];
struct Q {
int x, st;
ll c;
Q(int _x, int _st, ll _c) { x = _x, st = _st, c = _c; }
bool operator < (const Q &A) const { return c == A.c ? st < A.st : c < A.c; }
bool operator > (const Q &A) const { return c == A.c ? st > A.st : c > A.c; }
};
int N, M, K, _Q;
vector<int> v[50003];
bool mart[50003];
ll D[50003][12];
int num[50003][12], idx[50003];
int q[13];
priority_queue<Q, vector<Q>, greater<Q>> pq;
int main() {
scanf("%d %d %d %d", &N, &M, &K, &_Q);
for(int i=0, x; i<K; i++) scanf("%d", &x), mart[x] = 1;
for(int i=0; i<M; i++) {
scanf("%d %d %d", &T[i].x, &T[i].y, &T[i].c);
v[T[i].x].push_back(i);
v[T[i].y].push_back(i);
}
for(int i=1; i<=N; i++) for(int j=1; j<=11; j++) D[i][j] = 1e15;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |