This documentation is automatically generated by online-judge-tools/verification-helper
View the Project on GitHub HyunjaeLee/Algorithms
#define PROBLEM "https://judge.yosupo.jp/problem/many_aplusb" #include "../io/scanner.hpp" #include <iostream> scanner scan; int main() { std::cin.tie(0)->sync_with_stdio(0); int T; scan(T); while (T--) { long long A, B; scan(A, B); std::cout << A + B << '\n'; } }
#line 1 "test/scanner.test.cpp" #define PROBLEM "https://judge.yosupo.jp/problem/many_aplusb" #line 1 "io/scanner.hpp" #include <charconv> #include <string_view> #include <sys/mman.h> #include <sys/stat.h> #include <type_traits> struct scanner { scanner() { struct stat st; fstat(0, &st); data_ = p_ = static_cast<char *>( mmap(nullptr, st.st_size, PROT_READ, MAP_PRIVATE, 0, 0)); size_ = st.st_size; } template <typename... Args> void operator()(Args &...args) { (read(args), ...); } std::string_view getline() { skip(); auto first = p_; while (*p_ >= ' ') { ++p_; } return std::string_view(first, p_ - first); } private: template <typename T> std::enable_if_t<std::is_integral_v<T>, void> read(T &x) { skip(); x = 0; auto is_negative = false; if (*p_ == '-') { ++p_; is_negative = true; } for (; *p_ > ' '; ++p_) { x = (x << 1) + (x << 3) + (*p_ & 15); } if (is_negative) { x = -x; } } template <typename T> std::enable_if_t<std::is_floating_point_v<T>, void> read(T &x) { skip(); auto first = p_; while (*p_ > ' ') { ++p_; } std::from_chars(first, p_, x); } void read(char &x) { skip(); x = *p_++; } void skip() { while (*p_ <= ' ') { ++p_; } } char *data_; char *p_; size_t size_; }; #line 4 "test/scanner.test.cpp" #include <iostream> scanner scan; int main() { std::cin.tie(0)->sync_with_stdio(0); int T; scan(T); while (T--) { long long A, B; scan(A, B); std::cout << A + B << '\n'; } }