# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1150095 | urosk | 한자 끝말잇기 (JOI14_kanji) | C++20 | 497 ms | 327680 KiB |
#include "Annalib.h"
#include "Anna.h"
#include "bits/stdc++.h"
#define fi first
#define sc second
#define pb push_back
#define llinf 1000000000000000LL
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
const ll maxn = 305;
ll n,m;
ll d[maxn][maxn];
ll d2[maxn][maxn];
ll b[2][6];
void Anna(int N, int M, int A[], int B[], long long C[], int Q, int S[], int T[], int K, int U[]) {
n = N,m = M;
for(ll i = 1;i<=n;i++) {
for(ll j = 1;j<=n;j++) d[i][j] = d2[i][j] = llinf;
}
for(ll i = 1;i<=n;i++) d[i][i] = d2[i][i] = 0;
for(ll i = 1;i<=m;i++) {
ll x = A[i-1]+1,y = B[i-1]+1;
d[x][y] = d[y][x] = C[i-1];
bool oke = 1;
for(ll j = 0;j<K;j++) if(U[j]==i-1) oke =0;
if(oke) {
d2[x][y] = d2[y][x] = C[i-1];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |