Logo
  • Home
  • Codeforces
  • Software
  • Home Page in Chinese
  • @xloypaypa
  • Search
Menu
Topic 175 Posts

codeforces

Solutions for Codeforce。Include Div2 and Div3. Include Div1 ABC(<2500) also.
Page 1 of 22 Older Posts

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

By xloypaypa in codeforces on 06 Oct 2023

A. Make It Zero Solution: If we XOR all the numbers together, for each bit, if there were originally an odd number of 1s in that bit, the result will be 1; otherwise, it will be 0.…

Codeforces Round #896 Travel Plan Solution (Java/C++)

By xloypaypa in codeforces on 05 Oct 2023

Solution: For convenience, let's first define some functions and variables: $len(i,j)$ represents the number of nodes visited from node $i$ to node $j$ along the entire path. For example, in Sample 1, $len(2,3)=3$, $len(1,2)=1$.…

Codeforces Round #891 (Div. 3) ABCDEFG Solutions (Java/C++)

By xloypaypa in codeforces on 03 Oct 2023

A. Array Coloring Solution: It is only possible to divide the array into two groups with the same parity if the total sum is even. Code: Java…

Codeforces Round 893 (Div. 2) ABCD Solutions (Java/C++)

By xloypaypa in codeforces on 29 Sep 2023

A. Buttons Solution: Both players will prioritize button $c$. So, Anna can win an additional point if and only if $c$ is odd. Then, it only matters if $a-b$ is greater than zero.…

Codeforces Round #894 (Div. 3) ABCDEFG Solutions (Java/C++)

By xloypaypa in codeforces on 27 Sep 2023

A. Gift Carpet Solution: Simply match column by column. Code: Java…

Codeforces: Why You Should Avoid Using comparingX or thenComparingX in Java's Comparator Class

By xloypaypa in codeforces on 27 Sep 2023

Background Suppose you need to sort an array or have a TreeSet that requires a specific order. Let's take the following class as an example:…

Codeforces Round #895 (Div. 3) ABCDEFG Solutions (Java/C++)

By xloypaypa in codeforces on 22 Sep 2023

A. Two Vessels Solution: The data size is very small, all within 100. So, you can simply simulate pouring water from the larger vessel to the smaller one step by step. Code: Java C++…

Codeforces Round #828 (Div. 3) ABCDEF Solutions (Java/C++)

By xloypaypa in codeforces on 30 Dec 2022

A. Number Replacement Solution: Obviously each number can only be replaced by the same letter, so we only need to open a Map to check whether any number has been replaced by two different letters.…

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