poj 1012 约瑟夫
来源:互联网 发布:java开发erp系统 编辑:程序博客网 时间:2024/06/06 22:21
http://poj.org/problem?id=1012
#include <stdio.h>#include <string.h>int main (){ int a[30],i,j,n,b[15],min,m; for(i=1;i<=13;i++) { n=2*i;min=i+1; memset(a,0,sizeof(a)); for(j=1;j<=i;j++) { a[j]=(a[j-1]+min-1)%(n-j+1); if(a[j]<i) { j=0; min++; } } b[i]=min; } while (~scanf("%d",&m),m) { printf("%d\n",b[m]); } return 0;}
- POJ 1012 约瑟夫问题
- poj 1012 约瑟夫
- poj 1012(约瑟夫问题。。。)
- POJ 1012 约瑟夫问题
- poj 1012 约瑟夫
- POJ 1012 约瑟夫环
- POJ 1012(约瑟夫问题)
- POJ 1012 约瑟夫环
- poj 1012 约瑟夫问题
- poj 1012 约瑟夫置换
- POJ 1012 约瑟夫问题
- poj 1012 Joseph(约瑟夫环)
- Poj 1012 Joseph (约瑟夫环)
- POJ 1012 Joseph 约瑟夫问题
- POJ 1012 Joseph 约瑟夫问题
- poj 1012 约瑟夫环问题
- POJ-1012经典的约瑟夫
- 约瑟夫环问题 poj 1012 && poj 2244
- 17-php计算器
- Linux下的source、export
- 不要试图和下属做朋友
- python as lambda fiter的使用
- java.util.jar.JarFile cause native heap memory leak
- poj 1012 约瑟夫
- The content of the adapter has changed but ListView did not receive a notification
- 用户sa登陆失败 microsoft sql server 错误18456
- UITableView cell自定义视图中插入UITableView
- 黑马程序员 交通灯管理系统的学习
- IntPtr与自定义结构互转
- Maven打包,并设置main方法启动
- 开通一个博客,还没有想好要写什么
- hdu1181 变形课(Floyd算法)