This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| template<typename T> | |
| inline T in(){ T x; cin >> x; return x; } | |
| int main(){ | |
| const int x = in<int>(); | |
| const double y = in<double>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(global){ | |
| var $comment_form, $chat_form, $user_id, $token, $comment, $text, $comment_submit, $chat_submit, $section; | |
| var doc = global["document"]; | |
| function create_input(type, name, value){ | |
| var $dom = doc.createElement("input"); | |
| $dom.type = type; | |
| $dom.name = name; | |
| $dom.value = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdint> | |
| #include <cstdio> | |
| #include <cstring> | |
| namespace rh { | |
| namespace consts { | |
| const char *RISE_SAN = "rise-san"; | |
| const int RISE_SAN_LEN = std::strlen(RISE_SAN); | |
| const char *COCOA_SAN = "cocoa-san"; | |
| const int COCOA_SAN_LEN = std::strlen(COCOA_SAN); | |
| const char *CHINO_CHAN = "chino-chan"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // {{{ orliv::misc::PostScript | |
| #ifndef INCLUDE_POST_SCRIPT_HPP | |
| #define INCLUDE_POST_SCRIPT_HPP | |
| #include <algorithm> | |
| #include <cassert> | |
| #include <complex> | |
| #include <fstream> | |
| #include <string> | |
| #include <vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // {{{ orliv::math::AD<T> | |
| #ifndef INCLUDE_AD_HPP | |
| #define INCLUDE_AD_HPP | |
| #include <cmath> | |
| #include <type_traits> | |
| namespace orliv { | |
| namespace math { | |
| template <typename T> | |
| struct AD { | |
| static_assert(std::is_arithmetic<T>::value, "template arguments must be arithmetic type"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef INCLUDE_BENCHMARK_HPP | |
| #define INCLUDE_BENCHMARK_HPP | |
| #include <chrono> | |
| #include <cstdarg> | |
| #include <cstdio> | |
| #include <iostream> | |
| struct __bench__ { | |
| typedef std::chrono::time_point<std::chrono::system_clock> time_type; | |
| time_type start; | |
| char msg[128]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdint> | |
| static inline std::uint64_t rdtsc() { | |
| std::uint32_t eax = 0, edx; | |
| __asm__ __volatile__("cpuid;" | |
| "rdtsc;" | |
| : "+a"(eax), "=d"(edx) | |
| : | |
| : "%rcx", "%rbx", "memory"); | |
| __asm__ __volatile__("xorl %%eax, %%eax;" | |
| "cpuid;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| Language: Cpp | |
| # BasedOnStyle: LLVM | |
| AccessModifierOffset: -2 | |
| AlignAfterOpenBracket: true | |
| AlignConsecutiveAssignments: false | |
| AlignEscapedNewlinesLeft: true | |
| AlignOperands: true | |
| AlignTrailingComments: true | |
| AllowAllParametersOfDeclarationOnNextLine: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 入力 | |
| line = input() #=> str | |
| tokens = input().split() #=> [str] | |
| num = int(input()) #=> int | |
| nums = [int(x) for x in input().split()] #=> [int] | |
| A, B, C = [int(x) for x in input().split()] #=> int, int, int | |
| # 出力 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <iostream> | |
| #include <sstream> | |
| #include <vector> | |
| using Tree = std::vector<std::vector<int>>; | |
| struct RootedTree { | |
| const Tree& tree; | |
| const int root; | |
| RootedTree(const Tree& tree, int root) : tree(tree), root(root) {} |