Например, этот код:
Код: Выделить всё
#include
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; if(!(cin>>t)) return 0;
const int L=31623;
vector p;
vector isp(L+1,1);
for(int i=2;ia[i];
unordered_map mp;
mp.reserve(n*2);
int ans=0;
vector
> pf;
vector divs;
function gen = [&](int i,long long cur){
if(i==(int)pf.size()){ divs.push_back(cur); return; }
long long pr=pf[i].first; int c=pf[i].second;
for(int e=0;e1) pf.emplace_back(y,1);
divs.clear();
gen(0,1);
int mx=0;
for(long long d:divs){
auto it=mp.find(d);
if(it!=mp.end()) mx=max(mx,it->second);
}
int cur=mx+1;
auto it=mp.find(x);
if(it==mp.end()) mp[x]=cur; else if(it->secondsecond=cur;
ans=max(ans,cur );
}
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79894066/i-use-vscode-in-mac-why-it-gives-random-not-real-errors-while-it-same-code-work[/url]
Мобильная версия