组合数学 - 置换群的幂运算 --- poj CARDS (洗牌机)

该博客介绍了如何利用置换群和快速幂运算解决一道关于洗牌的ACM问题。当洗牌次数为奇数时,可以通过置换的平方运算来求解最初的牌序。博客作者提到潘震皓的文章对此问题有清晰的阐述,并提供了时间复杂度为O(n+logs)的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 CARDS
Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 1448   Accepted: 773

Description

Alice and Bob have a set of N cards labelled with numbers 1 ... N (so that no two cards have the same label) and a shuffle machine. We assume that N is an odd integer. 
The shuffle machine accepts the set of cards arranged in an arbitrary order and performs the following operation of double shuffle : for all positions i, 1 <= i <= N, if the card at the position i is j and the card at the position j is k, then after the completion of the operation of dou
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值