传送门 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define re register using namespace std; const int maxn = 1000005; inline long long read() { char ch = getchar(); long long f…
题面 题目背景 John的农场缺水了!!! 题目描述 Farmer John has decided to bring water to his N (1 <= N <= 300) pastures which are conveniently numbered 1..N. He may bring water to a pasture either by building a well in that pasture or connecting the pasture via a pipe…