Translation credit to Kaz Nakao
You are ordering
You also have
use itertools::Itertools; | |
use std::collections::{HashMap, HashSet, VecDeque}; | |
use std::fs; | |
fn neighbors(r: usize, c: usize) -> Vec<(usize, usize)> { | |
let (ir, ic) = (r as i32, c as i32); | |
vec![(ir + 1, ic), (ir - 1, ic), (ir, ic + 1), (ir, ic - 1)] | |
.iter() | |
.filter(|(r, c)| *r >= 0 && *c >= 0) | |
.map(|(r, c)| (*r as usize, *c as usize)) |
" https://stackoverflow.com/a/234578/12128483 | |
filetype plugin indent on | |
" show existing tab with 4 spaces width | |
set tabstop=4 | |
" when indenting with '>', use 4 spaces width | |
set shiftwidth=4 | |
" On pressing tab, insert 4 spaces | |
set expandtab " set expandtab& to just indent w/ tabs | |
" https://vi.stackexchange.com/a/4250 | |
set softtabstop=4 |
#include <iostream> | |
#include <vector> | |
#include <deque> | |
#include <map> | |
#include <unordered_map> | |
#include <set> | |
#include <unordered_set> | |
template <typename T> | |
std::ostream& operator<<(std::ostream& out, const std::vector<T>& vec) { |
import json | |
import re | |
import os | |
import shutil | |
import requests | |
def load_twt_obj(file: str) -> list: | |
raw = open(file).read() | |
return json.loads(raw[raw.find("=") + 1:]) |
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
using std::cout; | |
using std::endl; | |
using std::vector; | |
using std::string; |
Translation credit to Kaz Nakao
You are ordering
You also have
Translation credit to Kaz Nakao
In the country of IOI, there was a railway mogul JOI that owned all of the railroads.
However, JOI has passed away and the railways he owns are to be distributed as a split inheritance.
In IOI, there are
The cities are numbered
A railroad
There may be several lines between the same two cities.
bro i could passed gold lmao
i actually knew how to solve 2 problems
but anyways, here's the gold p1 editorial on request (actual problem here, i won't bother explaining it myself, just read the darn thing)
so it would be absolute cancer to try and actually calculate if each tuple
can get to a level where all cows have the same hunger level
not only that, calculating all the possible tuples themselves...
for (int i = 0; i < 2; i++) {
so yknow i was on the dp grind when someone posted this problem on the github issues for the usaco guide (you can test here, but prepare google translate)
so we have a buncha circles, intervals really
and we wanna remove some so that none of them intersect (they can be tangent tho)
so let's define min_remove[s][e]
as the minimum amount of circles we have to
remove given that the only circles we consider are the ones that are completely