🌱 Lời giải bài Tin học trẻ 2021 - Vòng khu vực - Bảng B - Tập Số
[color=pink] Nếu bạn cảm thấy Edit này chất lượng tiếc gì một upvote và giới thiệu team với mọi người nhé :heart:
🔗 Link: https://oj.vnoi.info/problem/tht21_kvb_fset
📌 Tags: Sieving ,Factorization ,Combinatorics.
🛠 Work: At least 3 hours
👤 Writer: @LeThanhMinh
👤 Editor: @Melonade, @SPyofgame
👥 Contributor: @Editorial-Slayers Team
Minh Lê Thanh changed 3 years agoView mode Like 10 Bookmark
https://oj.vnoi.info/problem/olp_ct20_reflective
tags: Math, Implementation
Hướng dẫn
Gọi hàm $f(l, r)$ là chi phí để sơn một đoạn $[l, r]$
Gọi hàm $[x = y]$ trả về $1$ khi $x = y$ và trả về $0$ khi $x \neq y$
Xét tại $x$, ta có phần diện tích bị phủ là $f(x, x) = max\Large\left(\normalsize k\ \ \Large|\ \ \normalsize \frac{x}{2^k} \in Z \wedge\ \normalsize \frac{x}{2^{k+1}} \notin Z \Large\right)$
SPyofgame changed 3 years agoView mode Like 1 Bookmark