Submission #6131

# Submission time Handle Problem Language Result Execution time Memory
6131 2014-06-20T08:22:05 Z gs13068 한자 끝말잇기 (JOI14_kanji) C++
0 / 100
208 ms 11724 KB
#include "Annalib.h"

static long long D[300][300];

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;
  for(i=0;i<N;i++)for(j=0;j<N;j++)D[i][j]=1e18;
  for(i=0;i<M;i++)D[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(D[i][j]>D[i][k]+D[k][j])D[i][j]=D[i][k]+D[k][j];
  for(i=0;i<Q;i++)
  {
    for(j=0;j<K;j++)if(D[S[i]][A[U[j]]]+C[U[j]]+D[B[U[j]]][T[i]]==D[S[i]][T[i]])break;
    Tap((j>>2)&1);
    Tap((j>>1)&1);
    Tap(j&1);
  }
}
#include "Brunolib.h"

static long long D[300][300];
static int V[300][300];

static void answer(int i,int j)
{
  if(V[i][j]>0)Answer(V[i][j]-1);
  if(V[i][j]<0)
  {
    answer(i,-V[i][j]-1);
    answer(-V[i][j]-1,j);
  }
}

void Bruno(int N,int M,int A[],int B[],long long C[],int Q,int S[],int T[],int K,int U[],int L,int X[])
{
  int i,j,k;
  for(i=0;i<N;i++)for(j=0;j<N;j++)D[i][j]=1e18;
  for(i=0;i<M;i++)if(C[i]>0)
  {
    D[A[i]][B[i]]=C[i];
    V[A[i]][B[i]]=i+1;
  }
  for(k=0;k<N;k++)for(i=0;i<N;i++)for(j=0;j<N;j++)if(D[i][j]>D[i][k]+D[k][j])
  {
    D[i][j]=D[i][k]+D[k][j];
    V[i][j]=-k-1;
  }
  for(i=0;i<Q;i++)
  {
    j=(X[i*3]<<2)|(X[i*3+1]<<1)|X[i*3+2];
    if(j<K)
    {
      answer(S[i],A[U[j]]);
      Answer(U[j]);
      answer(B[U[j]],T[i]);
    }
    else answer(S[i],T[i]);
    Answer(-1);
  }
}
# Verdict Execution time Memory Grader output
1 Incorrect 65 ms 11724 KB Output isn't correct - Wrong Answer [9]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 11724 KB Output isn't correct - Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 11724 KB Output isn't correct - Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 11724 KB Output isn't correct - Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 78 ms 11724 KB Output isn't correct - Wrong Answer [6]
2 Incorrect 58 ms 11724 KB Output isn't correct - Wrong Answer [6]
3 Incorrect 58 ms 11724 KB Output isn't correct - Wrong Answer [6]
4 Incorrect 58 ms 11724 KB Output isn't correct - Wrong Answer [6]
5 Incorrect 62 ms 11724 KB Output isn't correct - Wrong Answer [9]
6 Incorrect 62 ms 11724 KB Output isn't correct - Wrong Answer [6]
7 Incorrect 69 ms 11724 KB Output isn't correct - L = 180
8 Incorrect 62 ms 11724 KB Output isn't correct - L = 180
9 Incorrect 65 ms 11724 KB Output isn't correct - L = 180
10 Incorrect 55 ms 11724 KB Output isn't correct - L = 180
11 Incorrect 59 ms 11724 KB Output isn't correct - L = 180
12 Incorrect 62 ms 11724 KB Output isn't correct - L = 180
13 Incorrect 208 ms 11724 KB Output isn't correct - L = 180
14 Incorrect 62 ms 11724 KB Output isn't correct - Wrong Answer [6]
15 Incorrect 68 ms 11724 KB Output isn't correct - Wrong Answer [6]
16 Incorrect 78 ms 11724 KB Output isn't correct - L = 180
17 Incorrect 92 ms 11724 KB Output isn't correct - L = 180
18 Incorrect 89 ms 11724 KB Output isn't correct - L = 180
19 Incorrect 72 ms 11724 KB Output isn't correct - Wrong Answer [6]
20 Incorrect 75 ms 11724 KB Output isn't correct - L = 180
21 Incorrect 105 ms 11724 KB Output isn't correct - L = 180
22 Incorrect 58 ms 11724 KB Output isn't correct - L = 180
23 Incorrect 59 ms 11724 KB Output isn't correct - L = 180
24 Incorrect 55 ms 11724 KB Output isn't correct - L = 180