POJ 3128】的更多相关文章

http://poj.org/problem?id=3128 大致题意:输入一串含26个大写字母的字符串,能够把它看做一个置换.推断这个置换是否是某个置换的平方. 思路:具体解释可參考url=ihxGpxX7x7ba4dROfWpQ0wlucC03fhDtKuEETsQjYUePKN41PnCBqm0lKrAeDfPXddo8i_1l3834K7iGivkTD-bsu1lAFYS6W55CKqvr13_" style="color:rgb(255,153,0); text-decora…
题目:http://poj.org/problem?id=3128 从环的角度考虑. 原来有奇数个点的环,现在点数不变: 原来有偶数个点的环(设有 k 个点),现在变成两个大小为 k/2 的环. 所以判断一下现在的有偶数个点的环是不是成双成对的就行了. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; int n,c…
题意:给你一个置换P,问是否存在一个置换M,使M^2=P 思路:资料参考 <置换群快速幂运算研究与探讨> https://wenku.baidu.com/view/0bff6b1c6bd97f192279e9fb.html 结论一: 一个长度为 l 的循环 T,l 是 k 的倍数,则 T^k 是 k 个循环的乘积,每个循环分别是循环 T 中下标 i mod k=0,1,2- 的元素按顺序的连接. 结论二:一个长度为 l 的循环 T,gcd(l,k)=1,则 T^k 是一个循环,与循环 T 不一…
传送门 题意:26个大写字母的置换$B$,是否存在置换$A$满足$A^2=B$ $A^2$,就是在循环中一下子走两步 容易发现,长度$n$为奇数的循环走两步还是$n$次回到原点 $n$为偶数的话是$\frac{n}{2}$次,也就是说分裂成了两个循环 综上$B$中长度为偶数的循环有奇数个就是不存在啦 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #inclu…
置换的开方. 看看Pan的那篇集训论文.此处,可以想到,开方时,由于gcd(l,2),则必然有若是循环长度为偶数,必定是成对出现的.若是奇数,既可以是偶数也可以是奇数,因为,通过二次方后,循环长度为偶数的可以分裂成偶数的两个也可以是奇数的两个. #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; char str[…
Leonardo's Notebook Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2324   Accepted: 988 Description — I just bought Leonardo's secret notebook! Rare object collector Stan Ucker was really agitated but his friend, special investigator Sa…
Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798   Special Judge Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets…
Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   Special Judge Description The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286   Accepted: 8603   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the…