Submission #476470

#TimeUsernameProblemLanguageResultExecution timeMemory
476470AdamGS저장 (Saveit) (IOI10_saveit)C++14
25 / 100
324 ms16564 KiB
#include "grader.h" #include "encoder.h" #include<bits/stdc++.h> using namespace std; typedef long double ld; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() void encode(int n, int h, int m, int *a, int *b) { vector<pair<int,int>>V[n]; int uzyte[m], odl[n]; rep(i, m) { uzyte[i]=0; V[a[i]].pb({b[i], i}); V[b[i]].pb({a[i], i}); } rep(i, h) { rep(j, n) odl[j]=1000000007; queue<int>q; q.push(i); odl[i]=0; while(!q.empty()) { int p=q.front(); q.pop(); for(auto j : V[p]) if(odl[j.st]>odl[p]+1) { odl[j.st]=odl[p]+1; q.push(j.st); uzyte[j.nd]=1; } } } vector<int>T[n]; rep(i, m) if(uzyte[i]) { T[a[i]].pb(b[i]); T[b[i]].pb(a[i]); } rep(i, n) { rep(j, 10) encode_bit((T[i].size()&(1<<j))>0); for(auto j : T[i]) { rep(l, 10) encode_bit((j&(1<<l))>0); } } }
#include "grader.h" #include "decoder.h" #include<bits/stdc++.h> using namespace std; typedef long double ld; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() void decode(int n, int h) { vector<int>V[n]; rep(i, n) { int a=0; rep(j, 10) a+=decode_bit()*(1<<j); rep(j, a) { int x=0; rep(l, 10) x+=decode_bit()*(1<<l); V[i].pb(x); } } rep(i, h) { int odl[n]; rep(j, n) odl[j]=1000000007; queue<int>q; q.push(i); odl[i]=0; while(!q.empty()) { int p=q.front(); q.pop(); for(auto j : V[p]) if(odl[j]>odl[p]+1) { odl[j]=odl[p]+1; q.push(j); } } rep(j, n) hops(i, j, odl[j]); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...