#include "dzilib.h" #include <bits/stdc++.h> using namespace std; #define rep(a, b) for (int a = 0; a < (b); a++) #define rep1(a, b) for (int a = 1; a <= (b); a++) #define all(x) (x).begin(), (x).end() using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int MOD = 1e9 + 7; #define LOCAL false const int MAX_N = 1000107; int divcnt[MAX_N]; int seq[107]; bool issame(int x) { rep(i, 100) if (seq[i] != divcnt[x+i]) { return false; } return true; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); if (LOCAL) { ignore=freopen("io/in", "r", stdin); ignore=freopen("io/out", "w", stdout); } for (int i = 1; i < MAX_N; i++) for (int j = i; j < MAX_N; j += i) divcnt[j]++; int t = GetT(); rep(ti, t) { rep(i, 100) seq[i] = Ask(i); rep1(x, 1000000) if (issame(x)) { Answer(x); break; } } return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #include "dzilib.h" #include <bits/stdc++.h> using namespace std; #define rep(a, b) for (int a = 0; a < (b); a++) #define rep1(a, b) for (int a = 1; a <= (b); a++) #define all(x) (x).begin(), (x).end() using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int MOD = 1e9 + 7; #define LOCAL false const int MAX_N = 1000107; int divcnt[MAX_N]; int seq[107]; bool issame(int x) { rep(i, 100) if (seq[i] != divcnt[x+i]) { return false; } return true; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); if (LOCAL) { ignore=freopen("io/in", "r", stdin); ignore=freopen("io/out", "w", stdout); } for (int i = 1; i < MAX_N; i++) for (int j = i; j < MAX_N; j += i) divcnt[j]++; int t = GetT(); rep(ti, t) { rep(i, 100) seq[i] = Ask(i); rep1(x, 1000000) if (issame(x)) { Answer(x); break; } } return 0; } |