BZOJ3351 [ioi2009]Regions

<div class="post_brief"><p> ioi的数据结构题,果然还是比较BT的。</p>   做法是对颜色分开,大的颜色预处理,小的颜色直接暴力。   然后一个小错又坑了好久。我真的没救了。 #include <cstdio> #include <cstdlib> #include <cctype> #include <cstring> #include <algorithm> using namespace std; const int buf_len = 4000; const size_t buf_size = buf_len * sizeof(char); char buf[buf_len], *bufb(buf), *bufe(buf + 1); #define readBuf() { if (++ bufb == bufe) bufe = (bufb = buf) + fread(buf, 1, buf_size, stdin); } #define readInt(x) { register int s(0); do { readBuf(); } while (!isdigit(*bufb)); do { s = s * 10 + *bufb - 48; readBuf(); } while (isdigit(*bufb)); x = s; }...

January 28, 2015 · 3 min · laekov