题目来源:http://codeforces.com/contest/158/problem/B After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrat ...
分类:
其他好文 时间:
2020-07-27 16:07:20
阅读次数:
89
基础:FFT与NTT 多项式求乘法逆元 【模板】多项式乘法逆 \(Code:\) int n; ll A[N], B[N], C[N], r[N]; ll limi, l; inline ll quickpow(ll x, ll k)... inline void ntt(ll *a, int ty ...
分类:
其他好文 时间:
2020-07-27 16:01:58
阅读次数:
76
题目来源: http://codeforces.com/problemset/problem/122/A Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal ...
分类:
其他好文 时间:
2020-07-27 13:40:27
阅读次数:
64
题意:一个人有两个字符串A和B,两个字符串具有相同的长度n$(|A| = |B| = n)$,包含前20个小写字符('a'到't')。每一次操作,这个人可以选择A字符串中字符相同的字母,然后从中选择一些位置,并把这些位置的字母变大。求字符串A变到字符串B的最少操作次数。 分析:我们可以贪心地进行操作 ...
分类:
其他好文 时间:
2020-07-26 23:12:06
阅读次数:
78
Codeforces Round #655 (Div. 2) 1. 题目分析 A: 思维题,构造性题目 B: 打表发现规律 C: 思维 D: 思维+dp E: F: 2. 题解 A. Omkar and Completion 题意: 给定t个测试样例,每个测试样例给定一个n,要求构造一个长度为n的数 ...
分类:
其他好文 时间:
2020-07-26 19:06:12
阅读次数:
64
题目大意 给你$n$个定点$m$条边,这$m$条边中有有向边也有无向边。 当$t=0$时,输入边代表的是无向边。 当$t=1$时,输入的边代表的是$x-y$的有向边。 要你将所有的无向边变为有向边后整个图是无环的(有向无环图)。 思路 有向边时建边而且更新入度,无向边时只存边不更新入度。 然后在拓扑 ...
分类:
编程语言 时间:
2020-07-26 01:40:23
阅读次数:
69
A.Common Subsequence 题意 给你两组数,问你有没有相同 的书,有的话,输出最短的那组(大家都知道,1是最小的) AC ?#include<bits/stdc++.h> using namespace std; const int N = 1005; int a[N], x, n, ...
分类:
其他好文 时间:
2020-07-26 00:42:50
阅读次数:
59
https://codeforces.com/contest/1372 A 众所周知,$1+1\neq 1$。 所以输出 \(n\) 个 $1$ 即可。 时间复杂度 \(O(tn)\)。 #include <bits/stdc++.h> using namespace std; int t; int ...
分类:
其他好文 时间:
2020-07-26 00:22:51
阅读次数:
52
##题面 he length of the longest common prefix of two strings s=s1s2…sn and t=t1t2…tm is defined as the maximum integer k (0≤k≤min(n,m)) such that s1s2…s ...
分类:
其他好文 时间:
2020-07-26 00:15:56
阅读次数:
106
地址:http://codeforces.com/contest/1384/problem/A 题意: 输出n+1个字符串,si和si+1的公共前缀长为ai 解析: 一个一个补的话,会很麻烦。 看范围:ai<=50,就是说前缀最长为50,那么考虑把所有字符串长度都构造为长度>50,那么对于每一个ai ...
分类:
其他好文 时间:
2020-07-26 00:02:58
阅读次数:
54