Aimeeeeeeeeeeeeeeeeeeeeeeeeee 很简单的东西 就是用tarjan缩个点,然后对于这个新图,考虑入读和出度为1的点就行了 #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> #i ...
分类:
Web程序 时间:
2020-11-06 02:38:38
阅读次数:
30
给定一棵树,树上每个结点刚开始有一个人,现在每个人需要走到一个不同于原来的结点,并且必须保证每个结点上仍然有且仅有一个人,在树上走一条边的代价为 $1$,求最小代价。 ...
分类:
其他好文 时间:
2020-11-06 02:09:44
阅读次数:
23
强联通分量及缩点 #include<bits/stdc++.h> #define re register #define v e[i].to using namespace std; const int lzw=1e4+3; int n,m,head[lzw],tot,h[lzw],cnt,dfn[ ...
分类:
其他好文 时间:
2020-11-06 01:55:25
阅读次数:
17
` #include <string.h> #include <iconv.h> #include using namespace std; int code_convert(char *from_charset, char *to_charset, char *inbuf,int inlen, c ...
分类:
编程语言 时间:
2020-11-06 01:53:34
阅读次数:
28
链接 : http://codeforces.com/problemset/problem/1443/C 标签 : binary search greedy sorting *1400 二分答案 AC代码 #include <bits/stdc++.h> using namespace std; # ...
分类:
其他好文 时间:
2020-11-06 01:18:03
阅读次数:
19
题目描述 https://loj.ac/problem/3177 题解 假设某个合法的矩形只有一行,是 \(a_{1,l}\sim a_{1,r}\),那么显然有这样一个结论成立:\(a_{1,l-1}\) 是 \(a_{1,r+1}\) 左侧第一个大于它的 或者 \(a_{1,r+1}\) 是 \ ...
分类:
其他好文 时间:
2020-11-04 19:01:35
阅读次数:
18
最短路 SPFA #include <bits/stdc++.h> using namespace std; #define N 10001 #define M 500001 struct node{ int to,w,next; }edge[M]; int cut=0; int head[N]; ...
分类:
编程语言 时间:
2020-11-04 18:47:58
阅读次数:
18
1 #include <bits/stdc++.h> 2 using namespace std; 3 const int mac=4e5+50; 4 int head[mac],vis[mac],dis[mac]; 5 int n,m,num,i,j,t; 6 struct edge{ 7 int ...
分类:
其他好文 时间:
2020-11-04 17:45:08
阅读次数:
15
7-8 稳赢 (15分) 现要求你编写一个稳赢不输的程序,根据对方的出招,给出对应的赢招。但是!为了不让对方输得太惨,你需要每隔K次就让一个平局。 输入格式: 输入首先在第一行给出正整数K(≤),即平局间隔的次数。随后每行给出对方的一次出招:ChuiZi代表“锤子”、JianDao代表“剪刀”、Bu ...
分类:
其他好文 时间:
2020-11-02 10:45:09
阅读次数:
39
b题:b其实不难题意就是不让k个连续字符成为一个周期。这提给我的教训就是中文翻译应该结合英文题目一起看, #include<bits/stdc++.h>#include<algorithm>#define ll long longusing namespace std;const ll nl=1e5 ...
分类:
其他好文 时间:
2020-11-02 10:12:11
阅读次数:
22