Code来自 OMG_wc
有改动
#include <deque>
#include <cstdio>
#include <utility>
#define IL inline
#define RE register
#define INF int(1e6 + 10)
namespace {
using std::deque;
using std::pair;
using std::make_pair;
}
int T, n, m;
int ans;
int a[INF];
IL int read()
{
RE int s = 0;
RE int w = 1;
RE char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') {
w = -1;
}
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
s = (s << 3) + (s << 1) + ch - '0';
ch = getchar();
}