-
int128 setup232's competitive-programming templates. 2024. 8. 31. 13:35
using int128 = __int128; std::istream& operator >> (std::istream& stream, int128& x) { long long t; stream >> t; x = t; return stream; } std::ostream& operator << (std::ostream& stream, int128 x) { if (x < 0) { stream << "-"; x = -x; } std::string s; while (x != 0) { s += char('0' + x % 10); x /= 10; } if (s.empty()) { s += '0'; } std::reverse(s.begin(), s.end()); return stream << s; }
'232's competitive-programming templates.' 카테고리의 다른 글
knuth_x (0) 2024.09.12 Fenwick2D (0) 2024.09.01 CompressedSparseRow (0) 2024.08.27 Rmq (0) 2024.08.26 radix (0) 2024.08.26