当前位置:网站首页>【6.15】Codeforces Round #798 (Div. 2)
【6.15】Codeforces Round #798 (Div. 2)
2022-07-19 13:40:00 【ZhgDgE】
ALL:7
I AC+ Teammate AC:7
With your teammates AK div3
F. Equate Multisets
The question : Given two sizes n ( 1 ≤ n ≤ 2 × 1 0 5 ) n(1\leq n\leq 2\times 10^5) n(1≤n≤2×105) Multiple sets of a , b a,b a,b . You can do the following several times :
- b i = 2 × b i b_i=2\times b_i bi=2×bi
- b i = ⌊ b i 2 ⌋ b_i=\left\lfloor\frac{b_i}{2}\right\rfloor bi=⌊2bi⌋
ask , Can multiple operations be carried out , bring a = b a=b a=b
Answer key :Codeforces Round #805 (Div. 3) E( dyeing ) F( greedy ) G(lca)
Ideas : Yes b i b_i bi multiply 2 It is equivalent to a i a_i ai Divide 2 , Then it turns into a i = ⌊ a i 2 ⌋ ( When a i % 2 = 0 ) a_i=\left\lfloor\frac{a_i}{2}\right\rfloor( When a_i\%2=0) ai=⌊2ai⌋( When ai%2=0) and b i = ⌊ b i 2 ⌋ b_i=\left\lfloor\frac{b_i}{2}\right\rfloor bi=⌊2bi⌋ Two kinds of operations , Use the priority queue to maintain the maximum value and get the match .
AC Code :https://codeforces.com/contest/1702/submission/163767144
G2. Passable Paths (hard version)
The question : Given a tree n ( 1 ≤ n ≤ 2 × 1 0 5 ) n(1\leq n\leq 2\times 10^5) n(1≤n≤2×105) Rootless tree with nodes .
Now there is q q q Time to ask , Give out... Every time you ask k k k A little bit , Ask whether these points can be connected by a simple path . ( ∑ k ≤ 2 × 1 0 5 ) (\sum k \leq 2\times 10^5) (∑k≤2×105)
Ideas : Virtual tree for game + Change one DP. Virtual tree will not say , Shortening the path does not affect the answer . How many subtrees contain special points when changing the root to maintain each point as the root , If there is a point g g g A value greater than or equal to 3 , Then it must not be a chain .
AC Code :https://codeforces.com/contest/1702/submission/163566226
边栏推荐
猜你喜欢

Onvif protocol related: 3.1.2 get the token list in digest mode

565. Array nesting

El table column drag and drop (no need to introduce other plug-ins)

【考研词汇训练营】Day 7 —— second,attract,current,collect,simple,communicate,vocation

Onvif protocol related: 4.1.1 WS username token method to obtain wsusernametokenbean

Weekly summary (*65): planned output

onvif協議相關:4.1.3 WS-Username token方式獲取截圖url

codeforce:A. Doremy‘s IQ【反向贪心】

torch.utils.data.DataLoader说明

onvif协议相关:2.1.1 none方式获取token
随机推荐
健康防猝指南3:健康保健
Principle of voice communication network
每周小结(*65):有计划的输出
AcWing第 60 场周赛
(pc+wap) dream weaving template clothing dress website
onvif协议相关:4.1.4 WS-Username token方式获取流地址
Onvif protocol related: 4.1.1 WS username token method to obtain wsusernametokenbean
「技术播客月」Day 10: Meta Podcast: 聊聊播客这件事
弹性负载均衡将访问流量自动分发到多台云服务器,扩展应用系统对外的服务能力,提高应用程序安全性。
大家好,问一下数据库没开始binlog如何实时同步么,有没有好的方案
Framework construction of business card management
力扣第 302 场周赛
[code hoof set novice village question 600] formatted input and output, using 0 to replace the completed space
云审计服务CTS是一项付费服务,付费项目包括开通追踪器、事件跟踪以及7天内事件的存储和检索等相关费用
[postgraduate entrance examination vocabulary training camp] day 7 - second, attract, current, collect, simple, communicate, vocation
About XML file (VII) - XML DTD
[Yugong series] July 2022 go teaching course 012 forced type conversion
【码蹄集新手村 600 题】计算一个整数有多少位数
[code hoof set novice village 600 question] calculate the number of digits of an integer
Code after annotation of hands-on deep learning (Second Edition) [continuous update]