Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <cstdio>using namespace std;inline int getint(){char c;while ((c = getchar()) < '0' || c > '9');int res = c - '0';while ((c = getchar()) >= '0' && c <= '9')res = res * 10 + c - '0';return res;}inline void tense(int &a, const int &b){if (b < a)a = b;}inline void relax(int &a, const int &b){if (b > a)a = b;}const int MaxN = 20005;const int MaxM = 100005;int n, m;int w[MaxN], newW[MaxN];