/*
1. 读入优化 的 初识、
约瑟夫实现 vector模拟实现
过程: 先将每个元素放入 容器中 push_back();
for遍历将 n-1 个元素 在容器中删除 第t个元素 a.erase(a.begin()+t);
最后容器中的最后一个元素就是活下来的人
*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<cmath>
#include<iomanip>
using namespace std;
typedef int _____I;
const int N=1e6+10;
const int INF=0x3f3f3f3f;
#define ERX(___I,__I,_I) for(_____I ___I = __I;___I < _I; ___I++)
#define ERD(___I,__I,_I) for(_____I ___I = __I;___I <= _I; ___I++)
#define RED(___I,__I,_I) for(_____I ___I = __I;___I >= _I; ___I--)
/*
定义一个int型 x f
定义一个char型得到一个字符
如果该字符不是数字 则再判断该字符是不是-号 如果是 就让f变-1 得到ch
如果该字符是数字就进行累计 x=x*10+ch-'0';ch=getchar();
最后 返回总结果值
*/
int read(){
int x=0,f=1;char ch=getchar(
vector实现约瑟夫
最新推荐文章于 2023-03-01 12:58:54 发布
![](https://img-home.csdnimg.cn/images/20240709112858.png)