Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- const int maxn = 100 + 100;
- int SG[maxn];
- int main() {
- #ifdef ExRoc
- freopen("test.txt", "r", stdin);
- #endif // ExRoc
- ios::sync_with_stdio(false);
- int l, r;
- while (cin >> l >> r) {
- for (int i = l; i <= 20; ++i) {
- set<int> st;
- for (int j = max(0, i - r); j <= i - l; ++j) {
- st.insert(SG[j]);
- }
- for (int j = 0; j <= 100; ++j) {
- if (st.find(j) == st.end()) {
- SG[i] = j;
- break;
- }
- }
- }
- for (int i = 0; i <= 20; ++i) {
- cout << "SG[" << i << "] = " << SG[i] << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement