// Przykładowe niepoprawne rozwiązanie do zadania Dzielniki. #include "dzilib.h" #ifdef DLOCAL #include "dzilib.cpp" #endif #include <bits/stdc++.h> #define all(x) (x).begin(),(x).end() using namespace std; using ll = long long; using ld = long double; //#define int ll #define sz(x) ((int)(x).size()) using pii = pair<int,int>; using tii = tuple<int,int,int>; map<vector<int>, int> atr; const int nmax = 1e6 + 105; int ciur[nmax]; int main() { for(int i = 1; i < nmax; i++) { for(int j = i; j < nmax; j += i) ciur[j]++; } for(int i = 1; i < nmax - 100; i++) { vector<int> T; for(int j = 0; j < 100; j++) T.emplace_back(ciur[i + j]); atr[T] = i; } assert(sz(atr) == nmax - 100 - 1); int t = GetT(); int q = GetQ(); long long c = GetC(); long long n = GetN(); while(t--) { vector<int> A; for(int j = 0; j < 100; j++) A.emplace_back(Ask(j)); Answer(atr[A]); } 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 45 46 47 48 49 50 51 52 53 54 55 56 | // Przykładowe niepoprawne rozwiązanie do zadania Dzielniki. #include "dzilib.h" #ifdef DLOCAL #include "dzilib.cpp" #endif #include <bits/stdc++.h> #define all(x) (x).begin(),(x).end() using namespace std; using ll = long long; using ld = long double; //#define int ll #define sz(x) ((int)(x).size()) using pii = pair<int,int>; using tii = tuple<int,int,int>; map<vector<int>, int> atr; const int nmax = 1e6 + 105; int ciur[nmax]; int main() { for(int i = 1; i < nmax; i++) { for(int j = i; j < nmax; j += i) ciur[j]++; } for(int i = 1; i < nmax - 100; i++) { vector<int> T; for(int j = 0; j < 100; j++) T.emplace_back(ciur[i + j]); atr[T] = i; } assert(sz(atr) == nmax - 100 - 1); int t = GetT(); int q = GetQ(); long long c = GetC(); long long n = GetN(); while(t--) { vector<int> A; for(int j = 0; j < 100; j++) A.emplace_back(Ask(j)); Answer(atr[A]); } return 0; } |