template<class T> void out(T x) { if(x < 0) {x = -x;putchar('-');} if(x >= 10) { out(x / 10); } putchar('0' + x % 10); } struct node { int64 c[26],len; node() {memset(c,0,sizeof(c));len = 0;} friend node operato
res =0;T f =1;charc =getchar();while(c <'0'|| c >'9') {if(c =='-') f =-1; c =getchar(); }while(c >='0'&& c <='9') { res = res *10+c -'0'; c =getchar(); } res *= f; }template<classT>voidout(T x){if(x <0) {x = -x;putchar('-');}if(...
typedef double db; template<class T> void read(T &res) { res = 0;T f = 1;char c = getchar(); while(c < '0' || c > '9') { if(c == '-') f = -1; c = getchar(); } while(c >= '0' && c <= '9') { res = res * 10 +c - '0'; c = getchar(); } ...
c =getchar(); }while(c >='0'&& c <='9') { res = res *10+c -'0'; c =getchar(); } res *= f; }template<classT>voidout(T x){if(x <0) {x = -x;putchar('-');}if(x >=10) {out(x /10); }putchar('0'+ x %10); }constintMOD =1000000007;intN,M,s[2],l...
a,b,c is in GP only if b/a=c/b which can be written as b*b=a*c → Reply M_A_Noman 5 months ago, hide # ^ | 0 Surely I will try to avoid division operator from now on. But the code works with long double which I knew after the contest from the comment of ph22...
{Z ret = lhs; ret /= rhs; return ret;} }; template <class T> struct Fenwick { const int n; vector<T> a; Fenwick(int n) : n(n), a(n) {} void add(int x, T v) // 单点改 { for (int i = x + 1; i <= n; i += i & -i) a[i - 1] += v; } T sum(...
namespace atcoder { int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigned int)(n)) x++; return x; } template <class S, S(*op)(S, S), S(*e)()> struct segtree { public: segtree() : segtree(0) {} explicit segtree(int n) : segtree(std::vector<S>...
C代码 #include<bits/stdc++.h>usingnamespacestd; /*先读懂题:“More specifically, for every non-empty subsequence (not necessarily contiguous) of the string ABCDE, there is a participant named after that subsequence who solved the problems corresponding to the letters in their name and did not...
AGC035-B, C: Some clean up and use Data.ByteString.Builder Jul 15, 2019 agc035-c AGC035-B, C: Some clean up and use Data.ByteString.Builder Jul 15, 2019 agc036-a AGC036-A, B Jul 22, 2019 agc036-b AGC036-A, B Jul 22, 2019 ...
) 42 #endif using ll = long long; using ld = long double; using uint = unsigned int; using ull = unsigned long long; template<typename T> using pair2 = pair<T, T>; using pii = pair<int, int>; using pli = pair<ll, int>; using pll = pair<ll, ll>; mt19937_64 rng(...