Submission #6155

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
61552014-06-21 07:38:22gs12117한자 끝말잇기 (JOI14_kanji)C++98
100 / 100
872 ms92972 KiB
#include "Annalib.h"
#define ull unsigned long long
#define INF 4000000000000000000LL
#include<stdio.h>
static ull w[301][301];
static bool v[90010];
static int R[61], cnt[5];
static int hc[62][6];
void Anna(int N, int M, int A[], int B[], long long C[], int Q, int S[], int T[], int K, int U[]) {
int i, j, k, x, y, xx, yy;
ull g;
for (i = 0; i < K; i++){
v[U[i]] = true;
}
for (i = 0; i < Q; i++)R[i] = -1;
for (i = 0; i < N; i++){
for (j = 0; j < N; j++){
if (i != j)w[i][j] = INF;
else w[i][j] = 0;
}
}
for (i = 0; i < M; i++){
if (!v[i])w[A[i]][B[i]] = C[i];
}
for (k = 0; k < N; k++){
for (i = 0; i < N; i++){
for (j = 0; j < N; j++){
if (w[i][j]>w[i][k] + w[k][j])w[i][j] = w[i][k] + w[k][j];
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Bruno.cpp: In function 'void Bruno(int, int, int*, int*, long long int*, int, int*, int*, int, int*, int, int*)':
Bruno.cpp:89:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (j = 0; j < G[K]; j++)par[i][j] = -1;
                       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...