제출 #45123

#제출 시각아이디문제언어결과실행 시간메모리
45123tjd229저장 (Saveit) (IOI10_saveit)C++11
50 / 100
443 ms15656 KiB
#include "grader.h" #include "encoder.h" int p[1000]; int visit[1000]; int edge[1000][1000]; int tail[1000]; void bfs(int nv,int src){ visit[src] = src + 1; int i; int q[1000]; int front = 0; int back = 0; q[back++] = src; while (front != back){ int curr = q[front++]; for (i = 0; i < tail[curr]; i++){ int nxt = edge[curr][i]; if (visit[nxt] != src + 1){ visit[nxt] = src + 1; q[back++] = nxt; p[nxt] = curr; } } } } void encode(int nv, int nh, int ne, int *v1, int *v2){ int i,j; int u, v; while (ne--){ u = v1[ne]; v = v2[ne]; edge[u][tail[u]++] = v; edge[v][tail[v]++] = u; } for (i = 0; i < nh; i++){ bfs(nv, i); for (j = 0; j < nv; j++){ if (j == i) continue; u = p[j]; v = 10; while (v--){ encode_bit(u&1); u >>= 1; } } } return; }
#include "grader.h" #include "decoder.h" void dfs(int src,int ix, int depth, int *tail, int edge[1000][1000]){ hops(src, ix, depth); for (int i = 0; i < tail[ix]; i++) dfs(src,edge[ix][i],depth+1,tail,edge); } void decode(int nv, int nh) { int i, j, k; for (i = 0; i < nh; i++){ int edge[1000][1000]; int tail[1000] = { 0 }; for (j = 0; j < nv; j++){ if (i == j) continue; int p = 0; for (k = 0; k < 10;k++){ int b = decode_bit(); p += (b<<k); } edge[p][tail[p]++] = j; } dfs(i,i,0,tail,edge); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...