File tree Expand file tree Collapse file tree 1 file changed +31
-26
lines changed Expand file tree Collapse file tree 1 file changed +31
-26
lines changed Original file line number Diff line number Diff line change @@ -10,41 +10,46 @@ using ull = unsigned long long;
1010#define rep (i, n ) for (ll i = 0 ; i < (int )(n); i++)
1111#define all (a ) (a).begin(), (a).end()
1212
13+ template <typename T> bool chmin (T &a, T b) {
14+ if (a > b) {
15+ a = b;
16+ return true ;
17+ }
18+ return false ;
19+ }
20+ template <typename T> bool chmax (T &a, T b) {
21+ if (a < b) {
22+ a = b;
23+ return true ;
24+ }
25+ return false ;
26+ }
27+
1328void printbase () { cout << ' \n ' ; }
1429
15- template <typename T>
16- void printbase (const T &t)
17- {
18- cout << t << ' \n ' ;
19- }
30+ template <typename T> void printbase (const T &t) { cout << t << ' \n ' ; }
2031
21- template <typename T>
22- void printbase (const std::vector<T> &vec)
23- {
24- for (const auto &v : vec)
25- {
26- cout << v << ' ' ;
27- }
28- cout << ' \n ' ;
32+ template <typename T> void printbase (const std::vector<T> &vec) {
33+ for (const auto &v : vec) {
34+ cout << v << ' ' ;
35+ }
36+ cout << ' \n ' ;
2937}
3038
3139template <typename Head, typename ... Tail>
32- void printbase (const Head &head, const Tail &...tail)
33- {
34- cout << head << ' ' ;
35- printbase (tail...);
40+ void printbase (const Head &head, const Tail &...tail) {
41+ cout << head << ' ' ;
42+ printbase (tail...);
3643}
3744
38- #define print (...) \
39- { \
40- printbase (__VA_ARGS__); \
41- return 0 ; \
42- }
45+ #define print (...) \
46+ { \
47+ printbase (__VA_ARGS__); \
48+ return 0 ; \
49+ }
4350
44- const ll INF = pow( 10 , 18 ) ;
51+ const ll INF = (ll) 1 << 63 ;
4552const string upperlist = " ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
4653const string lowerlist = " abcdefghijklmnopqrstuvwxyz" ;
4754
48- int main ()
49- {
50- }
55+ int main () {}
You can’t perform that action at this time.
0 commit comments