codeforces 644A Parliament of Berland】的更多相关文章

A. Parliament of Berland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n parliamentarians in Berland. They are numbered with integers from 1 to n. It happened that all parliamen…
A. Parliament of Berland time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There are n parliamentarians in Berland. They are numbered with integers from 1 to n. It happened that all parliamentari…
codeforces 808G Anthem of Berland 题面 给定\(s\)串和\(t\)串,字符集是小写字母.\(s\)串中有些位置的值不确定,要求你确定这些位置上的值,使得\(t\)在\(s\)中出现次数最多,输出最多出现次数. 参考博客 http://www.cnblogs.com/Oncle-Ha/p/7061929.html 题解 AC自动机预处理 \(ne[i][j]\):字符串 \(t[i]+j\) 的后缀最长匹配到 \(t[ne[i][j]]\). 状态\(f[i][…
[链接] 我是链接,点我呀:) [题意] 题意 [题解] https://blog.csdn.net/V5ZSQ/article/details/70873661 看这个人的吧. [代码] #include <bits/stdc++.h> #define ll long long using namespace std; const int N = 100; const long long M = 15e6; int n,a,b,ans[N+10][N+10]; int kk = 0; int…
B. Ancient Berland Hieroglyphs 题目连接: http://codeforces.com/problemset/problem/164/B Descriptionww.co Polycarpus enjoys studying Berland hieroglyphs. Once Polycarp got hold of two ancient Berland pictures, on each of which was drawn a circle of hierog…
题目链接: http://codeforces.com/problemset/problem/691/A 题目大意: n个数0或1,要求恰好n-1个1,如果n为1则那个数一定要是1 题目思路: [模拟] 水题一道.看错题目两次.. // //by coolxxx //#include<bits/stdc++.h> #include<iostream> #include<algorithm> #include<string> #include<ioman…
题目传送门 传送点I 传送点II 传送点III 题目大意 给定一个字符串$s$,和一个字符串$t$,$t$只包含小写字母,$s$包含小写字母和通配符'?'.询问$t$可能在$s$中出现最多多少次. 原来觉得挺神仙,现在觉得还好. 显然用$g_{i}$表示在匹配到第$i$个字符,最多能匹配$t$的次数. 现在讨论它的转移,需要考虑它和前一个匹配有没有重叠. 如果没有重叠,直接从$g_{i - |t|}$转移. 如果有重叠,上一个可能的匹配的结束位置显然是可以枚举的,通过跳$fail$就能找到.我们…
C. Ancient Berland Circus time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.…
Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different. In Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygon, the size and the number of angles could vary fro…
水题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #include<algorithm> #include<vector> #include<map> #include<set> #in…