qb resist
来源:互联网 发布:已翻拍的网络耽美小说 编辑:程序博客网 时间:2024/05/16 00:49
约瑟夫环,暴力模拟。。。。。。。。
弄一个链表,把之前的联向删掉的下一个,以后就不回跳到删过的了
#include<cstdio>#include<iostream>#include<cmath>using namespace std;int n,t,a[199999],p;int main(){ scanf("%d%d",&n,&t);p=n; for(int i=1;i<n;i++) a[i]=i+1;a[n]=1; while(n--){ int j=1; while(j<t){ p=a[p]; j++; } if(!n) printf("%d",a[p]); a[p]=a[a[p]]; }}
阅读全文
0 0
- qb resist
- 卖qb
- QB源码
- qb购买
- qb day6
- qb day5
- qb standing
- qb neighbor
- qb gcd
- QB实现Matrix字幕
- QB无缘无故丢失!
- 轻松拿QB喽
- 谁会刷QB
- QB评级 - NFC排名
- qb模拟题
- qb mjy题
- Resist the Temptation of the Singleton Pattern
- Resist the Temptation of the Singleton Pattern
- Try Redis tutorial
- 慕丝妮邀你“约个酸菜”
- Java实现PDF的生成
- DES加解密例子
- redis使用教程
- qb resist
- 怎样查外键建在哪个表上
- intelli idea激活码
- 辨别大小端
- 文本处理三剑客之AWK
- Saltstack批量编译部署nginx(多模块)
- 分布式与集群的区别
- 不可重复读和幻读的区别(悲观锁和乐观锁)
- jquery使用总结