URAL - 1098 Questions——约瑟夫环
2018-03-27 16:36
441 查看
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int maxn = 1e5; char s[maxn]; int dp[maxn]; int main() { int n = 0; while (gets(s + n)) n = strlen(s); s = '\0'; dp[0] = 0; for (int i = 1; i <= n; i++) dp[i] = (dp[i-1]+1999)%i; if (s[dp ] == '?') printf("Yes\n"); else if (s[dp ] == ' ') printf("No\n"); else printf("No comments\n"); return 0; }
相关文章推荐
- URAL 1098 Questions 约瑟夫环
- URAL 1098 Questions 约瑟夫环
- poj 2359 || ural 1098 Questions
- URAL 1026 — Questions and Answers
- URAL 1026 - Questions and Answers(计数排序)
- ural 1521. War Games 2 约瑟夫环 SBT实现
- URAL 1521 War Games 2 树状数组解决约瑟夫环,输出离队顺序
- POJ 2359 Questions(约瑟夫环——数学解法)
- ural 1026 Questions and Answers
- URAL 1026 Questions and Answers
- 约瑟夫问题 URAL 1098
- 1098. Questions
- Poj 2359 Questions (约瑟夫环)
- SBT解决约瑟夫环问题(URAL1521)
- ural 1026. Questions and Answers 查询
- URAL 1026. Questions and answers
- POJ 2359 Questions(约瑟夫环)
- hdu1098 -数论
- 【数论】ural1091
- ural1989(字符串hash+线段树)