// compile: g++ -o data data.cpp -O3 -std=gnu++20 -Wall -Wextra -Wshadow -D_GLIBCXX_ASSERTIONS -ggdb3 -fmax-errors=2 -DLOCAL
// run: ./data < in/01_random_02.txt
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#ifdef LOCAL
#include <debug/codeforces.h>
#define debug(x...) _debug_print(#x, x);
#else
#define debug(x...)
#endif
template<typename...Args> void print_(Args...args){((cout<<args<<" "),...)<<endl;}
#define rep(i,a,b) for(int i=(a);i<(int)(b);++i)
#define sz(v) ((int)(v).size())
#define print(...) print_(__VA_ARGS__);
#define INTMAX (int)(9223372036854775807)
#define INF (int)(1152921504606846976)
#define double long double
#define int long long
#define MAXN 200010
int n;
struct graph {
struct node {
int u, v;
double w;
};
vector<vector<node>> e;
int n, m;
bool directed;
vector<int> vis;
graph(int V, bool D = 0) {
n = V;
e.resize(n);
vis.resize(n);
directed = D;
}
void add_edge(int u, int v, double w = 1) {
e[u].push_back(node{u, v, w});
++m;
}
void graphviz_dump(string filename = "graph.dot") {
ofstream gf;
gf.open(filename);
gf << (directed ? "digraph" : "graph") << " {\n";
gf << " "; rep(i, 0, n) gf << i << " ;"[i==n-1]; gf << endl;
string notation = directed ? " -> " : " -- ";
for (auto es: e) {
for (auto edge: es) {
gf << " " << edge.u << notation << edge.v << (directed ? " ;\n" : ";\n");
}
}
gf << "}\n";
}
int cnt = 0;
void dfs(int u, double th) {
vis[u] = 1;
++cnt;
for (auto ed: e[u]) {
if (ed.w > th) continue;
if (!vis[ed.v]) dfs(ed.v, th);
}
}
bool solve(double th) {
rep(i, 0, n) {
cnt = 0;
fill(vis.begin(), vis.end(), 0);
dfs(i, th);
if (cnt == n) return 1;
}
return 0;
}
};
int32_t main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
cin >> n;
vector<int> x(n), y(n), p(n);
rep(i, 0, n) cin >> x[i] >> y[i] >> p[i];
graph g(n);
rep(i, 0, n) rep(j, 0, n) {
if (i == j) continue;
g.add_edge(i, j, (abs(x[i] - x[j]) + abs(y[i] - y[j])) * 1.0 / p[i]);
}
double l = 0, r = 1e10, mid = (l + r) / 2;
while (r-l > 0.01) {
mid = (l + r) / 2;
if (g.solve(mid)) r = mid;
else l = mid;
}
cout << (int)ceil(mid - 0.01) << endl;
return 0;
}
Getting the game was simple with y444gamedownload. Straightforward and quick. Zero hassle. Get it downloaded from y444gamedownload
Yo peeps, 88clbgame is where it’s at! Loads of different games to keep you busy. I especially liked the selection they got. Hit them up here 88clbgame!
Gave 11betorg a whirl. It’s… okay. It’s got the basics covered, I guess, but there’s nothing that really makes it stand out. If you’re not too picky, it’s fine. Decide for yourself: 11betorg