题意 3602 Counting Swaps 0x30「数学知识」例题 背景 https://ipsc.ksp.sk/2016/real/problems/c.html Just like yesterday (in problem U of the practice session), Bob is busy, so Alice keeps on playing some single-player games and puzzles. In her newest puzzle she has…
题解 #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> #define ll long long using namespace std; const int MOD = 1e9 + 9, MAXN = 100005; int T, n, num[MAXN], head[MAXN], nume, id[MAX…
分块\(yyds\) ----关于线段树合并的题我用分块过掉这件事 题目传送门 先说正解 正解当然是线段树合并等一类做法了 至于解析...出门右转题解区第一篇 (就是他让我看不懂,然后用分块打的\(QAQ\)) 给出 fengwu 的\(code\) #include<bits/stdc++.h> #include<iostream> using namespace std; #define re register int const int N=100005; int n; in…
Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains either water ('W') or dry land ('.'). Farmer…