Submission #424964

#TimeUsernameProblemLanguageResultExecution timeMemory
424964MarcoMeijerRail (IOI14_rail)C++14
0 / 100
102 ms20736 KiB
#include "rail.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<ii> vii;

#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define RE(a,b) REP(a,0,b)
#define RE1(a,b) REP(a,1,b+1)
#define FOR(a,b) for(auto& a : b)
#define pb push_back
#define fi first
#define se second
#define all(a) a.begin(), e.end()

const int MX = 6000;

void findLocation(int n, int first, int location[], int stype[]) {
  auto getD = [](int u, int v) {
    static int mem[MX][MX];
    if(u == v) return 0;
    if(mem[u][v] != 0)
      return mem[u][v];
    return mem[u][v] = mem[v][u] = getDistance(u,v);
  };

  stype[0] = 1;
  location[0] = first;
  REP(i,1,n) stype[i] = 2;
  REP(i,1,n) location[i] = getD(0,i) + first;
  REP(i,1,n) cout << location[i] << endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...