While Grisha was celebrating New Year with Ded Moroz, Misha gifted Sasha a small rectangular pond of size n × m, divided into cells of size 1 × 1, inhabited by tiny evil fishes (no more than one fish per cell, otherwise they'll strife!). The gift bun…
题目链接:http://codeforces.com/problemset/problem/446/B #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e3+3; int matrix[N][N]; ll row[N],col[N]; ll dpr[N*N],dpc[N*N]; priority_queue <ll> q; int main() { ll n,m,k,p;…
Helen works in Metropolis airport. She is responsible for creating a departure schedule. There are n flights that must depart today, the i-th of them is planned to depart at the i-th minute of the day. Metropolis airport is the main transport hub of…