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(); } res *= f; } template<class T> void out(T x) { if(x ...
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(); } res *= f; } template<class T> void out(T x) { if(x ...
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...
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(...
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. Ideal Sheet 给定一个 HA×WA 的二维矩阵 A ,一个 HB×WB 的二维矩阵 B ,一个 HC×WC 的二维矩阵 C ,每个矩阵上都由黑色方块和透明方块组成。现在在一个无限大的二维平面上,请你随意放置 A,B (不能翻,转),问是否存在一个 HC∗WC 的区域,他们和 C 中的图案一样,并且区域外不存在黑色方块。
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(...
CF思维联系– Codeforces-988C Equal Sums (哈希) hash集合 这个题,无论怎么循环都是超时的,所以必须想到一种不需要循环的方法,这里我用的是hash,因为是每个序列删掉一个之后相等,那我们就保存删掉一个数之后的值,用hash存起来,如果再遇到而且不是同一个序列的话,那就是可以构造出提要求的两个序列。 风骨散人...