Logo
  • Home
  • Codeforces
  • Software
  • Home Page in Chinese
  • @xloypaypa
  • Search
Menu
Author 181 Posts
xloypaypa

xloypaypa

Twitter
Newer Posts Page 10 of 23 Older Posts

Codeforces Round #742 Non-Decreasing Dilemma Solution (Java/C++)

By xloypaypa in codeforces on 12 Sep 2021

Solution: This problem is a typical application of segment tree. As shown in the figure below, we maintain three attributes for each interval:…

Codeforces Round #741 ABCD Solutions (Java/C++)

By xloypaypa in codeforces on 04 Sep 2021

A. The Miracle and the Sleeper Solution: Obviously, when b=r/2+1, the value of a%b is the largest. Of course, note that the value of b cannot be less than l.…

Codeforces Round #741 Two Hundred Twenty One Solution (Java/C++)

By xloypaypa in codeforces on 04 Sep 2021

Solution: First, we define $b[i]=a[i]\cdot (-1)^{(i-1)}$, $sum(l,r)=\sum_{i=l}^r{b[ i]}$. So for any i, b[i] is either 1 or -1. Therefore, if the final sum is 0, then there must be the same number of 1 as the number of -1.…

Codeforces Round #741 Scenes From a Memory Solution (Java/C++)

By xloypaypa in codeforces on 04 Sep 2021

Solution: First of all, it is obvious that if the 1, 4, 6, 8, 9 appear in the original number. All other numbers can be deleted, and only one digit is left.…

Codeforces Round #740 Div 2 ABCDE Solutions (Java/C++)

By xloypaypa in codeforces on 28 Aug 2021

A. Simply Strange Sort Solution: This question can be simulated according to the requirements of the question. Code: Java C++…

Codeforces Round #739 ABCDEF Solutions (Java/C++)

By xloypaypa in codeforces on 21 Aug 2021

A. Dislike of Threes Solution: Just check each number in turn starting from 1. Code: Java C++…

Codeforces Round #738 ABCD Solutions (Java/C++)

By xloypaypa in codeforces on 20 Aug 2021

A. Mocha and Math Solution: Because $a\&b\leq a$. So, the answer is $a_1\&a_2\&a_3\&...\&a_n$. Code: Java C++…

Codeforces Round #738 Mocha and Diana (hard&easy) Solution (Java/C++)

By xloypaypa in codeforces on 19 Aug 2021

Solution: First, it is obvious that we will use "Disjoint-set data structure" to determine whether two points are in the same tree.…

Newer Posts Page 10 of 23 Older Posts
xloypaypa's Blog © 2025 Published with Ghost • Theme Attila • System theme
DigitalOcean Referral Badge 蜀ICP备19018968号