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.
Newer Posts Page 16 of 22 Older Posts

Codeforces Round #720 Nastia and a Hidden Permutation - Java/C++

By xloypaypa in codeforces on 08 May 2021

Solution: For first type of query, every time we take x as n-1. For second type of query, every time we take x as 1.…

Codeforces Round #719 Solutions

By xloypaypa in codeforces on 06 May 2021

A. Do Not Be Distracted! Solution: Scan the string. When we found a new letter, we skip the continually same letter. And mark this letter should not present…

Codeforces Round #719 Arranging The Sheep - Sort

By xloypaypa in codeforces on 06 May 2021

Solution: We define the data structure below: static class Sheep { int suppose_pos, pos; } suppose_pos represent the position of this su…

Codeforces Round #719 To Go Or Not To Go? - BFS

By xloypaypa in codeforces on 06 May 2021

Solution: This is a shortest paths problem. But do not use Dijkstra or SPFA to solve this problem. Because the time complex is $O(nm\cdot log(nm))$. Can get TLE with an extra $log$.…

Codeforces Round #719 Guess the K-th Zero (Hard version) - Segment tree

By xloypaypa in codeforces on 06 May 2021

Solution Base on the easy version, we still binary search in the hard version. So, we query the sum of $[1, mid]$.Now the problem is, after each time, we need change the element from 0 to 1.…

Codeforces Global Round 14 ABCD Solutions

By xloypaypa in codeforces on 03 May 2021

A. Phoenix and Gold Solution: If the sum of all numbers in w is x, then there is no solution. Because no matter what order, when $i=n$, the sum will be x.…

Codeforces Round #707 Going Home - Complexity Analysis

By xloypaypa in codeforces on 01 May 2021

Solution: First. We can change $a_x + a_y = a_z + a_w$ to $a_x - a_w = a_z - a_y$. So the problem becomes a problem of finding two pairs so that their differ of each pair are equal.…

Educational Codeforces Round #108 ABCD ​Solutions

By xloypaypa in codeforces on 30 Apr 2021

A. Red and Blue Beans Solution: Take the minimum value of $r$ and $b$ as $min$ and the maximum value as $max$.…

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