#include <bits/stdc++.h>
// fast_io
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;
#ifdef LOCAL
class IO {
public:
inline int operator()() {
int x;
std::cin >> x;
return x;
}
inline void operator()(int x, char c = ' ') {
std::cout << x << c << std::flush;
}
} io;
#else
class IO {
private:
char bufI[1 << 15], *ptrI = bufI, *endI = bufI + sizeof(bufI);
char bufO[1 << 15], *ptrO = bufO, *endO = bufO + sizeof(bufO);
public:
void load() {
memcpy(bufI, ptrI, endI - ptrI);
fread(endI - ptrI + bufI, 1, ptrI - bufI, stdin);
ptrI = bufI;
};
void flush() {
fwrite(bufO, 1, ptrO - bufO, stdout);
ptrO = bufO;
};
inline int operator()() {
if (endI - ptrI < 32) load();
int x{};
int n{};
for (; *ptrI < 48; ++ptrI) n = *ptrI == 45;
for (; *ptrI > 47; ++ptrI) x = x * 10 + *ptrI - 48;
return n ? -x : +x;
};
inline void operator()(int x, char c = ' ') {
if (endO - ptrO < 32) flush();
if (x < 0) x = -x, *ptrO++ = '-';
static char buf[21];
char *end = buf + 21;
char *ptr = buf + 21;
*--ptr = c;
for (; x >= 10; x /= 10)
*--ptr = char(48 + x % 10);
*--ptr = char(48 + x);
memcpy(ptrO, ptr, end - ptr);
ptrO += end - ptr;
};
IO() { fread(bufI, 1, sizeof(bufI), stdin); }
~IO() { flush(); }
} io;
#endif
int main() {
for (auto i = io(); i > 0; --i) io(io() + io(),10);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 39.45 us | 44 KB | Accepted | Score: 100 | 显示更多 |