256*1024*1024/4 = 67,108,864

answer 3181
/* Simulate it and the results come out */ #include <iostream> #include <cstdio> #include <cstring> #
include <algorithm> using namespace std; int a[10]; int main() { for(int i=0;i<
10;i++) a[i] = 2021; int res = 1; bool flag = true; int num; while(flag) { int r
= res; while(r) { num = r % 10; if(!a[num]) // There are no numbers { flag = false; break; } a[
num]--; r /= 10; } if(flag) res++; } cout<<res-1<<endl; return 0; }

/* It's a straight line y = kx + b The mark that distinguishes a straight line is the slope k And intercept b Let's set two points (x1,y1),(x2,y2) k = (y2 - y1) /
(x2 - x1) b = -k*x1 + y1 My idea is one k Corresponding to a b Of set aggregate k It's easy to ask , The point is b The accuracy of the method
Finally, the slope does not exist and the slope is zero 0 Add up all the lines */ #include <iostream> #include <cstdio> #include
<algorithm> #include <set> #include <vector> #include <map> using namespace std;
map<double,set<double> >mp; int main() { int xx = 19,yy = 20; for(int i=0;i<=xx
;i++) { for(int j=0;j<=yy;j++) // The first point { for(int k=0;k<=xx;k++) { for(int l=0;l<=
yy;l++) // Second point { if(i == k || j == l) continue; double x = (double)(i - k);
double y = (double)(j - l); double z = y * 1.0 / x; // double b = (double)(j -
z*i); // Record like this b The result is 47753, I play with this , Maybe it's wrong ! // k = (y2 - y1) / (x2 - x1) Substitute this expression into the b =
-k*x1 + y1 In the process of simplification double b = ((double)(k*j) - (double)(i*l)) / (i-k); // The result is 40257
It seems that this is more right mp[z].insert(b); } } } } int res = 0; map<double,set<double> >::iterator
it= mp.begin(); for(;it!=mp.end();it++) { res += it->second.size(); } cout<<res
+ xx + 1 + yy + 1<<endl; return 0; }

The answer is 2430
/* I didn't write it ... My idea is to decompose qualitative factors , Then arrange and combine , But there's a more violent way to find the factor directly , And then the triple loop ergodic factor comes out */ // This is the quality factor #include
<iostream> #include <cstdio> #include <algorithm> #include <map> #include
<cmath> using namespace std; map<int,int>mp; typedef long long ll; int main() {
ll num= 2021041820210418; for(int i=2;i<100000;i++) { if(num % i == 0) { while(
num% i == 0) { num /= i; mp[i]++; } } } if(num != 0) mp[num]++; map<int,int>::
iterator it= mp.begin(); for(;it != mp.end();it++) { cout<<it->first<< " " <<it-
>second<<endl; } return 0; }

/* Two cycles come out ...... It's too violent */ #include <iostream> #include <algorithm> #include
<cstring> #include <cmath> using namespace std; typedef long long ll; ll num =
2021041820210418; ll arr[100000]; int main() { int index = 0; for(int i=1;i<=
sqrt(num);i++) { if(num % i == 0) { arr[index++] = i; arr[index++] = num / i; }
} int res = 0; for(int i=0;i<index;i++){ for(int j=0;j<index;j++) if(num % (arr[
i] * arr[j]) == 0) res++; } cout<<res<<endl; return 0; }

answer 10266837
/* Go straight up Dijkstra*/ #include <iostream> #include <cstdio> #include <algorithm> #
include <queue> #include <vector> using namespace std; const int maxn = 2022;
int vel[maxn][maxn]; vector<int>g[maxn]; bool sign[maxn]; int dis[maxn]; struct
node{ int n_dis; int id; bool operator < (const node &a) const{ return a.n_dis <
n_dis; } }; int gcd(int a,int b) { if(b == 0) return a; return gcd(b,a%b); }
void dijkstra(int s) { for(int i=1;i<maxn;i++) dis[i] = 1000000000,sign[i] =
false; dis[s] = 0; priority_queue<node>q; node h; h.id = 1,h.n_dis = 0; q.push(h
); while(!q.empty()) { node u = q.top(); q.pop(); if(sign[u.id]) continue; sign[
u.id] = true; for(int i=0;i<g[u.id].size();i++) { int j = g[u.id][i]; if(sign[j]
) continue; if(vel[u.id][j] + u.n_dis < dis[j]) { dis[j] = h.n_dis = vel[u.id][j
] + u.n_dis; h.id = j; q.push(h); } } } } int main() { // Mapping for(int i=1;i<maxn;i
++) { for(int j=1+i;j<maxn;j++) { if(abs(i-j) <= 21) { int num = gcd(i,j); g[i].
push_back(j),g[j].push_back(i); vel[i][j] = vel[j][i] = i*j/num; } } } /*
for(int i=1;i<maxn;i++) cout<<g[i].size()<<endl; */ dijkstra(1); for(int i=1;i<
maxn;i++) cout<<dis[i]<<endl; cout<<"2021 = "<<dis[2021]<<endl; return 0; }

Technology
©2019-2020 Toolsou All rights reserved,
Solve in servlet The Chinese output in is a question mark C String function and character function in language MySQL management 35 A small coup optimization Java performance —— Concise article Seven sorting algorithms (java code ) use Ansible Batch deployment SSH Password free login to remote host according to excel generate create Build table SQL sentence Spring Source code series ( sixteen )Spring merge BeanDefinition Principle of Virtual machine installation Linux course What are the common exception classes ?