AtCoder Grand Contest 033 Darker and Darker 怎么 AGC 还有这种垃圾题啊。 const int N = 1e3 + 7; const int dx[] = {1,-1,0,0}; const int dy[] = {0,0,1,-1}; int n, m, d[N][N], ans; queue<pi&g...
AtCoder Grand Contest 034 题解
AtCoder Grand Contest 034 Kenken Race 分 $c < d$ 和 $c>d$ 讨论一下,后者合法多一个限制:存在 $i \in [b,d]$ 满足 $i-1,i,i+1$ 都是空的。 const int N = 2e5 + 7; int n, a, b, c, d; char s[N];...
AtCoder Grand Contest 035 题解
AtCoder Grand Contest 035 XOR Circle 随便判一下。 const int N = 1e5 + 7; int n, a[N]; int main() { rd(n), rda(a, n); map<int, int> c; for (int i = 1; i <= n; i++) ++c[a...
AtCoder Grand Contest 036 题解
AtCoder Grand Contest 036 Triangle 考虑 $\triangle (0,0)(x,n)(n,y)$ 的面积为 $n^2 - xy$,找到最小的 $n$ 满足 $n^2 \ge S$,设 $k = n^2 - S$,有 $0 \le k \le 2n-1$。 若 $k < n$,则 $\triang...
AtCoder Grand Contest 040 题解
AtCoder Grand Contest 040 >< 对于每个 <<...<>>...> 必然是两端 $0$,往中间 $+1$。 头尾特判一下。 const int N = 5e5 + 7; int n; char s[N]; ll ans; vector<pair<char,...
AtCoder Grand Contest 041 题解
AtCoder Grand Contest 041 Table Tennis Training 如果 $a,b$ 奇偶性相同,那么一起往中间走即可。 否则,走到某一端,浪费一次步数之后再一起往中间走。 int main() { ll n, a, b; rd(n, a, b)...
AtCoder Grand Contest 046 题解
AtCoder Grand Contest 046 Takahashikun, The Strider 相当于要找到最小的正整数 $t$ 满足 $tx \equiv 0 \pmod {360}$,暴力即可。 int main() { int x; rd(x); int t = 1; while (1) { ...
HBSX2020 游记
奇奇怪怪的比赛 Day 0 早上八点起了床,然后开始颓。 颓到十点去吃了顿早饭 + 午饭,然后买了个大西瓜冰着。 然后打点模板,忘了打的啥了。 下午两点跑去把大西瓜切了一半,夏天吃冰西瓜真的爽。 然后...
LOJ3298 「BJOI2020」封印 题解
LOJ3298 「BJOI2020」封印 新鲜出炉的 2020 省选题嗷。 首先对于每个 $s$ 的后缀 $i$ 找到其与 $t$ 的最长公共子串长度 $f_i$,这个把 $s$ 和 $t$ 隔一个字符并起来做 SA,然后从前往后从后往前扫一遍即可...
AtCoder Grand Contest 045 题解
AtCoder Grand Contest 045 Xor Battle 倒序考虑,如果在一个 $1$ 处能够成功加入线性基,则说明无论 $1$ 之前的数是什么情况,都可以使 $1$ 之后的数不在线性基内,因此 $1$ 赢,否则 $0$ 赢。 const int...