#include<iostream>usingnamespace std;int a[10];boolcheck(int x){while(x){if(--a[x %10]<0)returnfalse;
x /=10;}returntrue;}intmain(){// 请在此输入您的代码int i;for(i =0; i <=9; i ++) a[i]=2021;for(i =1; i; i ++){if(!check(i))break;}
cout << i -1<< endl;return0;}
直线
#include<iostream>#include<cstring>#include<algorithm>#include<cmath>usingnamespace std;typedeflonglong LL;constint N =200010;constdouble eps =1e-8;struct Line
{double k, b;booloperator<(const Line &t)const{if(fabs(k - t.k)> eps)return k < t.k;elsereturn b < t.b;}}l[N];int cnt, ans;intmain(){for(int x1 =0; x1 <20; x1 ++)for(int y1 =0; y1 <21; y1 ++){for(int x2 =0; x2 <20; x2 ++){if(x2 == x1)continue;for(int y2 =0; y2 <21; y2 ++){double k =(double)(y2 - y1)/(x2 - x1);double b = y1 - k * x1;
l[cnt ++]={k, b};}}}sort(l, l + cnt);
ans =1;for(int i =0; i < cnt -1; i ++){if(fabs(l[i].k - l[i +1].k)> eps ||(fabs(l[i].b - l[i +1].b)> eps))
ans ++;}
cout << ans +20<< endl;return0;}
货物摆放
#include<iostream>#include<vector>usingnamespace std;typedeflonglong LL;constint N =200010;
vector<LL> d;
LL ans;intmain(){
LL n =2021041820210418;for(int i =1; i <= n / i; i ++)if(n % i ==0){
d.push_back(i);if(i != n / i) d.push_back(n / i);}for(auto& a : d)for(auto b : d)for(auto c : d)if(a * b * c == n)
ans ++;
cout << ans << endl;return0;}
B组
乘积尾零
#include<iostream>usingnamespace std;typedeflonglong LL;constint N =200010;int c1, c2;
LL ans;intmain(){int n =100;for(int i =0; i < n; i ++){int x;
cin >> x;while(x %2==0){
c1 ++;
x /=2;}while(x %5==0){
c2 ++;
x /=5;}}
cout <<min(c1, c2)<< endl;return0;}
#include<iostream>#include<cstring>#include<algorithm>usingnamespace std;typedeflonglong LL;intmain(){int n =2019;
string ans;while(n){
ans +=('A'+ n %26-1);
n /=26;}reverse(ans.begin(), ans.end());
cout << ans << endl;return0;}
矩形切割
#include<iostream>#include<cstring>#include<algorithm>usingnamespace std;typedeflonglong LL;intmain(){int n =2019, m =324;int ans =0;while(n && m){if(n < m)swap(n, m);
n -= m;
ans ++;}
cout << ans << endl;return0;}
求和
#include<iostream>#include<cstring>#include<algorithm>usingnamespace std;typedeflonglong LL;
LL ans;boolcheck(int x){while(x){int t = x %10;if(t ==2|| t ==0|| t ==1|| t ==9)returntrue;
x /=10;}returnfalse;}intmain(){int n =2019;for(int i =1; i <= n; i ++)if(check(i))
ans += i;
cout << ans << endl;return0;}