链接: https://codeforces.com/contest/1238/problem/D 题意: The string t1t2-tk is good if each letter of this string belongs to at least one palindrome of length greater than 1. A palindrome is a string that reads the same backward as forward. For example,…
链接: https://codeforces.com/contest/1238/problem/C 题意: You are playing a game where your character should overcome different obstacles. The current problem is to come down from a cliff. The cliff has height h, and there is a moving platform on each he…
链接: https://codeforces.com/contest/1238/problem/B 题意: Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters. The main part of the level is a large corridor (s…
链接: https://codeforces.com/contest/1238/problem/A 题意: You are given two integers x and y (it is guaranteed that x>y). You may choose any prime integer p and subtract it any number of times from x. Is it possible to make x equal to y? Recall that a pr…
传送门 A. Prime Subtraction 判断一下是否相差为\(1\)即可. B. Kill 'Em All 随便搞搞. C. Standard Free2play 题意: 现在有一个高度为\(h\)的悬崖,每一层有平台,但可能是隐藏状态. 高度为\(h\)的那层平台一定是在外面的,假设当前高度为\(x\),那么每次可以改变\(x\)和\(x-1\)层平台的状态. 规定一个人若从\(x\)掉到\(x-1\)或者\(x-2\)都没事,否则就出事了. 问最少改变多少平台的状态,能够使在\(h…
A. Prime Subtractiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two integers x and y (it is guaranteed that x>y). You may choose any prime integer p and subtract it any number of…
慢慢来. 题目册 题目 A B C D E F G 状态 √ √ √ √ × ∅ ∅ //√,×,∅ 想法 A. Prime Subtraction res tp A 题意:给定\(x,y(x>y)\),问能否将\(x-y\)拆成任意多个质数之和 1.任意大于\(1\)的整数\(k\)都可以用\(2\)与\(3\)的线性表示 证: 若\(k\)是偶数,显然: 若\(k\)是奇数,则\(k\)可以表示成\(k = 3 + 2*k'\),显然: 毕. #include<bits/stdc++.h&…
#define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;char s[100005];int pos[(1<<20)+5];//pos[i]表示i=1<<j时的jint cnt[35][35];//cnt[i][j]表示s[i]=i,s[i+1]=j的移动数量int g[25][(1<<20)+5];//g[i][S],i不属于S表示s[i]=i,s[i+1]∈S的移动数量…
D. Credit Card Recenlty Luba got a credit card and started to use it. Let's consider n consecutive days Luba uses the card. She starts with 0 money on her account. In the evening of i-th day a transaction ai occurs. If ai > 0, then ai bourles are dep…
这题二分下界是0,所以二分写法和以往略有不同,注意考虑所有区间,并且不要死循环... #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; int m,n,k,t; ]; ],y[],z[]; ]; int check(int v){ memset(sum,,sizeof(sum)); ;i<=k;++i) if(z[i]>v) ++sum[x[i]],--sum[y[i]+]; ; ;i…