#include <stdio.h> #include <string.h> ][]; ]; ]; int main(){ scanf(]); scanf(]); scanf("%s",t); ;i<strlen(ch[]);i++){ num[ch[][i]-'a']=i; } ;i<strlen(t);i++){ <=t[i]-){ printf("%c",t[i]); }else if('a'<=t[i]&…
http://codeforces.com/contest/831 A. Unimodal Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Array of integers is unimodal, if: it is strictly increasing in the beginning; after that…
Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is constant; after that it is strictly decreasing. The first block (increasing) and the last block (decreasing) may be absent. It is allowed that both of thi…
A. Unimodal Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is constant; after that it is…
[Link]:http://codeforces.com/contest/831/problem/B [Description] 两个键盘的字母的位置不一样; 数字键的位置一样; 告诉你第一个键盘按某个键,在第二个键盘上对应哪个键(大写.小写字母) 然后给你一段由第一个键盘输入的文本,问如果用第二个键盘输入,会输出什么. [Solution] 用map一一对应就好; [NumberOf WA] 0 [Reviw] 这种对应关系的题,map无敌; [Code] #include <bits/std…
A. Mike and palindrome time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Mike has a string s consisting of only lowercase English letters. He wants to change exactly one character from the s…
https://codeforces.com/contest/1139/problem/E 题意 有n个学生,m个社团,每个学生有一个\(p_i\)值,然后每个学生属于\(c_i\)社团, 有d天,每天首先随机去除一个人,然后再从每个社团挑选一个学生(假如社团没有学生就跳过这个社团),使得这些学生组成的集合的mex值最大,输入每天的mex值 题解 假如这道题发现是二分图匹配就很好做 左边用\(p_i\)建点,右边用\(c_i\)建点,\(p_i\)从小到达和源点连边,然后跑个二分图匹配or最大流…
A:链接:http://codeforces.com/contest/831/problem/A 解题思路: 从前往后分别统计递增,相等,递减序列的长度,如果最后长度和原序列长度相等那么就输出yes: 实现代码: #include<bits/stdc++.h> using namespace std; int main() { ,a[]; cin>>m; ;i<m;i++){ cin>>a[i]; } ;i<m-;i++){ ]) ans++; else b…
There are n people and k keys on a straight line. Every person wants to get to the office which is located on the line as well. To do that, he needs to reach some point with a key, take the key and then go to the office. Once a key is taken by somebo…
https://codeforces.com/contest/1131/problem/D 题意 给你n个字符串,字符串长度总和加起来不会超过1e5,定义字符串相乘为\(s*s1=s1+s[0]+s1+s[1]+s1+...+s1+s[size-1]+s1+s[size]+s1\),求n个字符串依次相乘后最长连续字符相同的子序列长度 题解 鬼畜的题意 or 难以优化的复杂度,都需要观察性质才能做,第二串要插入第一个串每个字符之间,可以看出字符数增长的速度很快,所以并不能把整个字符存下来 只看一种…