首页 > 其他 > 详细

【LA3882】And then there was one

时间:2017-06-13 12:13:00      阅读:428      评论:0      收藏:0      [点我收藏+]

做sb题也是一种乐趣,是吧……

#include<bits/stdc++.h>
#define N 10005
using namespace std;
int f[N],m,n,k;
int main(){
    while(scanf("%d%d%d",&n,&k,&m)&&n){
        int a=0;
        for(int i=2;i<=n;i++)a=(a+k)%i;
        a=(m-k+1+a)%n;if(a<=0)a+=n;
        printf("%d\n",a);
    }
}

 

【LA3882】And then there was one

原文:http://www.cnblogs.com/zcysky/p/7000247.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!