- 博客(8)
- 收藏
- 关注
原创 蓝桥杯 Cowboys
问题描述 一个间不容发的时刻:n个牛仔站立于一个环中,并且每个牛仔都用左轮手枪指着他旁边的人!每个牛仔指着他顺时针或者逆时针方向上的相邻的人。正如很多西部片那样,在这一刻,绳命是入刺的不可惜……对峙的场景每秒都在变化。每秒钟牛仔们都会分析局势,当一对相邻的牛仔发现他们正在互指的时候,就会转过身。一秒内每对这样的牛仔都会转身。所有的转身都同时在一瞬间发生。我们用字母来表示牛仔所指的方向。“A”表示...
2018-03-06 21:31:17
684
原创 1025 - The Specials Menu
题目链接:点击打开链接题意:一个字符串中回文串的个数题解:动态规划,cont[i][j]存储从I到j的回文串个数,则当a[I] == a[j]时,就等于cont[I+1][j]+cont[I][j-1]+1(a[I]和a[j]这对单独算一个)否则 cont[I+1][j-1]+cont[I][j-1]还要减去重复计算的cont[I+1][j-1],此题关键在于dp
2017-11-21 20:25:47
154
原创 1023 - Discovering Permutations
题目链接:点击打开链接直接模拟代码#include #include #include #include #include #include #define ll long longusing namespace std;int n, k;int sum;bool visit[26];char s[30];bool solve(int cont){
2017-11-11 20:24:49
195
原创 1020 - A Childhood Game
题目链接:点击打开链接水题。。。代码:#include #include #include #include #include #include #define ll long longusing namespace std;int main(){ int test; scanf("%d", &test); int n; char name[1
2017-11-11 19:50:47
229
原创 loj1017 - Brush (III)
题目链接:点击打开链接题解:dp状态方程: dp[i][j] = max(dp[i-1][j-cont[j]]+cont[j],dp[i-1][j-1]);cont[j]:以第j个点为上沿时能刷到的点。代码#include #include #include #include #include #define ll long longusing na
2017-11-11 18:33:27
227
原创 loj1016 - Brush (II)
题目链接:点击打开链接水题,简单模拟...代码:#include #include #include #include #define ll long longusing namespace std;const int N = 50100;int n,w;int a[N];ll solve(){ ll ans = 1; ll h = a[
2017-11-11 17:39:42
157
原创 loj1014 - Ifter Party
题目链接:点击打开链接一道水题,竟然wra了好几次...附上代码:#include #include #include using namespace std;const int N = 1e6;int ans[N],anss[N];int k,t;int p, l;void solve(){ k = 0; t = 0; for (int
2017-11-11 17:12:58
217
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人