mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-26 05:32:03 +00:00
51 lines
988 B (Stored with Git LFS)
C++
51 lines
988 B (Stored with Git LFS)
C++
/**
|
|
* @file S2OJ/1974/val.cpp
|
|
* @author Baoshuo <i@baoshuo.ren>
|
|
* @url https://baoshuo.ren
|
|
* @date 2023-03-30
|
|
* @license GPL-3.0
|
|
*/
|
|
|
|
#include "testlib.h"
|
|
|
|
#include <limits>
|
|
#include <string>
|
|
|
|
int main() {
|
|
registerValidation();
|
|
|
|
int n = inf.readInt(1, 100000, "n");
|
|
inf.readSpace();
|
|
int m = inf.readInt(1, 100000, "m");
|
|
inf.readEoln();
|
|
|
|
for (int i = 1; i <= n; i++) {
|
|
inf.readInt(
|
|
std::numeric_limits<int>::min(),
|
|
std::numeric_limits<int>::max(),
|
|
std::string("a[") + std::to_string(i) + "]");
|
|
if (i < n) inf.readSpace();
|
|
}
|
|
|
|
inf.readEoln();
|
|
|
|
for (int i = 1; i <= m; i++) {
|
|
int op = inf.readInt(1, 2, "op");
|
|
inf.readSpace();
|
|
|
|
if (op == 1) {
|
|
inf.readInt(1, n, "x");
|
|
inf.readSpace();
|
|
inf.readInt(1, n, "y");
|
|
} else {
|
|
inf.readInt(1, n, "x");
|
|
}
|
|
|
|
inf.readEoln();
|
|
}
|
|
|
|
inf.readEof();
|
|
|
|
return 0;
|
|
}
|