0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-14 16:58:48 +00:00
OI-codes/S2OJ/1602/data/val.cpp

52 lines
1.2 KiB (Stored with Git LFS)
C++

// val.cpp by Baoshuo <i@baoshuo.ren>
#include "testlib.h"
int main() {
registerValidation();
int n = inf.readInt(1, 10, "n");
inf.readSpace();
int m = inf.readInt(1, 100000, "m");
inf.readEoln();
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
inf.readInt(-1000000000, 1000000000, "a[" + std::to_string(i) + "][" + std::to_string(j) + "]");
if (j == m) inf.readEoln();
else inf.readSpace();
}
}
int q = inf.readInt(1, 5000, "q");
inf.readEoln();
for (int i = 1; i <= q; i++) {
int op = inf.readInt(1, 2, "op");
inf.readSpace();
if (op == 1) {
inf.readInt(1, n, "x");
inf.readSpace();
inf.readInt(1, m, "y");
inf.readSpace();
inf.readInt(-1000000000, 1000000000, "v");
inf.readEoln();
} else { // op == 2
inf.readInt(1, n, "x1");
inf.readSpace();
inf.readInt(1, m, "y1");
inf.readSpace();
inf.readInt(1, n, "x2");
inf.readSpace();
inf.readInt(1, m, "y2");
inf.readEoln();
}
}
inf.readEof();
return 0;
}