Codeforces Round #459 (Div. 2)】的更多相关文章

A. Eleven time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Eleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to choose a name for her. El…
D. MADMAX time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As we all know, Max is the best video game player among her friends. Her friends were so jealous of hers, that they created an actu…
D. MADMAX time limit per test1 second memory limit per test256 megabytes Problem Description As we all know, Max is the best video game player among her friends. Her friends were so jealous of hers, that they created an actual game just to prove that…
B. Radio Station time limit per test2 seconds memory limit per test256 megabytes Problem Dsecription As the guys fried the radio station facilities, the school principal gave them tasks as a punishment. Dustin's task was to add comments to nginx conf…
C:显然可以设f[i][S]为当前考虑到第i位,[i,i+k)的状态为S的最小能量消耗,这样直接dp是O(nC(k,x))的.考虑矩阵快速幂,构造min+转移矩阵即可,每次转移到下一个特殊点然后暴力处理掉该点的贡献.可以预处理2p次转移矩阵进一步加速. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include&l…
A. Eleven time limit per test1 second memory limit per test256 megabytes Problem Description Eleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to choose a name for her. Eleven wants her name to hav…
题意 在一个有向无环图上,两个人分别从一个点出发,两人轮流从当前点沿着某条边移动,要求经过的边权不小于上一轮对方经过的边权(ASCII码),如果一方不能移动,则判负.两人都采取最优策略,求两人分别从每个点出发的胜负关系表. 分析 记忆化搜索. f[x][y][v]表示现在两人分别在x,y,上一轮经过的边权为v时x是否能胜利(胜利为1,失败为0). 考虑如何转移: 对于一条从x到u的边权为val的边,如果val>=v,则可以走这条边,算出f[y][u][val], 如果f[y][u][val]为0…
题意 给一个序列,包含(,),?,?可以被当做(或者),问你这个序列有多少合法的子序列. 分析 n^2枚举每一个子序列,暂时将每个?都当做右括号,在枚举右端点的时候同时记录两个信息:当前左括号多余多少个(top),已经将多少个?变成了右括号(cnt). 如果当前是(,top++. 如果当前是),top--. 如果当前是?,top--,cnt++; 如果top<0,我们需要判断一下当前还有没有之前被当做右括号的?,如果有的话,我们将其变为左括号,如果没有的话,意味着可以跳出循环了,之后都不会再合法…
C. The Monster time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As Will is stuck in the Upside Down, he can still communicate with his mom, Joyce, through the Christmas lights (he can turn t…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用map模拟一下映射就好了. [代码] #include <bits/stdc++.h> using namespace std; int n,m; map<string,string> dic; int main(){ #ifdef LOCAL_DEFINE freopen("rush_in.txt", "r", stdin); #endif ios::sync_with_…