【Codeforces 1006D】Two Strings Swaps】的更多相关文章

[链接] 我是链接,点我呀:) [题意] 题意 [题解] 注意只能改变a不能改变b 然后只要让a[i],b[i],a[n-i-1],b[n-i-1]这4个字符能凑成两对.全都一样就可以了 分类讨论下就好 [代码] #include <bits/stdc++.h> #define ll long long using namespace std; const int N = 300; int n; string s1,s2; map<char,int> dic,dic1; int m…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are called equivalen…
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=2000),问满足[数列长度是k && 数列中每一个元素arr[i]在1~n之间 && 数列中元素可以重复]的数列有多少个?结果对10^9+7取余 解题思路:dp[i][j]表示长度是j,最后一位是i的种数 if(kk%i==0) dp[kk][j+1]+=dp[i][j] #inc…
[题目链接]:http://codeforces.com/contest/798/problem/B [题意] 给你n个字符串; 每次操作,你可以把字符串的每个元素整体左移(最左边那个字符跑到最后面去了) 问你最少经过多少次操作可以使得所有字符串都相同; [题解] 枚举最后每个字符串都变成了哪一个字符串; 然后每个字符串都模拟一下左移的过程;直到相等记录总的移动次数; 或者左移超过了长度的次数;输出不可能能和目标串一样; 记录最小的移动次数就好; [Number Of WA] 0 [完整代码]…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones. Once he thought ab…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Professor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one. GukiZ has strings a, b, and c. H…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output PolandBall is playing a game with EnemyBall. The rules are simple. Players have to say words in turns. You cannot say a word which was already sa…
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output A string t is called nice if a string "2017" occurs in t as a subsequence but a string "2016" doesn't occur in t as a subsequence…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password is a string of length n whi…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password is a string of length n whi…