标签:des style blog class code java
2 2 1 2 2 2
Yes No
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include<algorithm> const int inf = 100001; using namespace std; int main() { int n, m, s = 0,x; while(~scanf("%d%d%d", &n, &m,&x)) { int i; s = 0; for (i = 2; i <= n; i++) { s = (s + m) % i; } s++; (s==x)?puts("Yes"):puts("No"); } return 0; }
标签:des style blog class code java
原文地址:http://blog.csdn.net/wjw0130/article/details/25840967