- 2024-11-10ffmpeg Code of Conduct
Befriendlyandrespectfultowardsothersandthirdparties.Treatothersthewayyouyourselfwanttobetreated.Beconsiderate.Noteveryonesharesthesameviewpointandprioritiesasyoudo.Differentopinionsandinterpretationshelptheproject.Lo
- 2024-01-1815 Friendly Arrays
FriendlyArrays打表#include<bits/stdc++.h>#defineintlonglongusingnamespacestd;voidsolve(){ intn,m; cin>>n>>m; vector<int>a(n+1); vector<int>b(m+1); for(inti=1;i<=n;i++)cin>>a[i]; for(inti=1;i<
- 2023-12-20CF1870B-Friendly-Arrays-题解
title:CF1870BFriendlyArrays题解date:2023-09-2010:32:12categories:-题解翻译给出长度为\(n\)的序列\(a\)和长度为\(m\)的序列\(b\),选出\(b\)中的任意个数(可以不选),让\(a\)的每个数都或上它们,求\(a_1\oplusa_2\oplus\dots\oplusa_n\)的最大值
- 2023-10-22B. Friendly Arrays
B.FriendlyArrays依据异或特性,如果n为偶数,单调递减:与b[i]|越多越小反之递增点击查看代码#include<bits/stdc++.h>usingnamespacestd;constintN=2e5+10;#defineLLlonglonginta[N],b[N];voidsolve(){ intn,m; cin>>n>>m; if(n%2==0){ int
- 2023-09-20Friendly Arrays题解
2023-09-18题目FriendlyArrays难度&重要性(1~10):5题目来源luogu题目算法贪心解题思路一道大水题。这道题解法非常的套路,我们需要对于处理按位或和按位异或时,首先就要把数拆成二进制的形式去考虑。首先我们需要简单了解一下按位或和按位异或的运算规则:按位或,对于两
- 2023-07-17题解 Friendly Spiders
FriendlySpiders带有技巧的最短路。如果\(u\)能到\(v\),说明\(\gcd(u,v)>1\),也就是有相同因子。所以我们考虑对于每个数\(u\),向他的所有质因子连一条长度为\(1\)的边,这样我们从\(u\)到\(v\)需要走两步,最终答案除以\(2\)即可。每次遇到一个新的因子,都要新建节点。