Řešení KSP úlohy 33-3-4 Obsazování území https://ksp.mff.cuni.cz/h/ulohy/33/zadani3.html#task-33-3-4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
693 B

use db::{SqliteLayoutDB, SavedLayout};
use city::{City, House};
use itertools::Itertools;
use crate::combine::transpose_layout;
mod city;
mod db;
mod combine;
fn main() {
let mut db = SqliteLayoutDB::from_file("layouts.sqlite").expect("Failed to load the DB");
eprintln!("Loaded the DB, {} stored layouts", db.layouts().len());
let city = City::read_from_file("01.in", city::INPUT_CITY_WIDTH, city::INPUT_CITY_HEIGHT);
eprintln!("Loaded the city file, {} houses", city.get_house_count());
const TOP_LAYOUT_COUNT: usize = 1500;
let mut cache = combine::CompatibilityCache::new();
combine::iterate_combines(&mut db, TOP_LAYOUT_COUNT, &city, &mut cache, true)
}