约瑟夫环
Input 7 5(有几组数据) 10 4 11 4 1(从一开始去除谁) Output 4 2 5 6 1 Input 3 2 2 5 Output 3 2#include#include #include using namespace std;#include #include deque str;int main(){ int m,n,i,a[102],b[102],j,g; scanf("%d%d",&m,&n); for(i=0;i
本文共 419 字,大约阅读时间需要 1 分钟。
约瑟夫环
Input 7 5(有几组数据) 10 4 11 4 1(从一开始去除谁) Output 4 2 5 6 1 Input 3 2 2 5 Output 3 2#include#include #include using namespace std;#include #include deque str;int main(){ int m,n,i,a[102],b[102],j,g; scanf("%d%d",&m,&n); for(i=0;i
转载于:https://www.cnblogs.com/zcy19990813/p/9702841.html