A. Harmonic Matrix Counter (3/19) B. Binary Tree (1/14) C. Asa's Chess Problem (21/65) [ Problem ] 给出一个棋盘格,里面的格子两两分为一组,组内的格子可以交换位置, 同一组格子一定在同一行或者同一列,每个格子为白色或者黑色, 现在要求每行中黑色的格子数量在rL到rR之间,每列中黑色的格子数量在cL到cR之间, 现在要求求出最少的交换次数使得要求被满足,不能满足则输出-1 [ Solution ] 我…
ACM-ICPC Asia Beijing Regional Contest 2018 Reproduction hihocoder1870~1879 A 签到,dfs 或者 floyd 都行. #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef long double LD; typedef pair<int,int> pii; typedef pair<LL,int>…
A - Relic Discovery 签到 #include <cstdio> using namespace std; int T,n; long long ans=0; int main() { scanf("%d",&T); for(int t=1; t<=T; t++) { scanf("%d",&n); ans=0; for(int i=1; i<=n; i++) { int a,b; scanf("%d…
P2 : Heshen's Account Book Time Limit:1000ms Case Time Limit:1000ms Memory Limit:512MB Description Heshen was an official of the Qing dynasty. He made a fortune which could be comparable to a whole country's wealth by corruption. So he was known as t…
P1 : Jin Yong’s Wukong Ranking List Time Limit:1000ms Case Time Limit:1000ms Memory Limit:512MB Description Jin Yong was the most famous and popular Chinese wuxia (The one who fight bad people by his Wukong i.e. Wushu and Kongfu) novelist who lived i…