<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Codeforces 比賽記錄

      Codeforces Round 990 (Div2)

      E.Adventurers

      平面上有若干點。選擇一個劃分點 \((x_0, y_0)\)。然后,對于坐標為 \((x_i, y_i)\) 的城市:

      • 如果 \(x_0 \le x_i\)\(y_0 \le y_i\),第一個商人在此城市銷售商品;
      • 如果 \(x_0 > x_i\)\(y_0 \le y_i\),第二個商人在此城市銷售商品;
      • 如果 \(x_0 \le x_i\)\(y_0 > y_i\),第三個商人在此城市銷售商品;
      • 如果 \(x_0 > x_i\)\(y_0 > y_i\),第四個商人在此城市銷售商品。

      商人們希望選擇一個劃分點 \((x_0, y_0)\),使得他們中任何一個人得到的城市數量盡可能公平(即最小化得到的城市數量的最大值)。請為他們找到這樣一個點。

      hint

      binary search

      F.For the Emperor!

      在古羅馬,為了擊敗野蠻人,制定了一項計劃,但要實施該計劃,每個城市都必須得到通知。

      羅馬帝國的北部由 \(n\) 個城市組成,這些城市通過 \(m\) 條單向道路相連。起初,第 \(i\) 個城市有 \(a_i\) 名信使,每名信使可以沿著現有的道路自由地在城市間移動。一名信使可以攜帶一份計劃副本,并在他訪問的城市中傳達信息,并且可以在他當前所在的城市為其他信使制作無限多的副本。

      開始時,你需要制作一定數量的計劃,并將它們交給選定的信使。你的目標是確保每座城市都被攜帶計劃的信使訪問過。找出最初需要制作的計劃的最小數量,以確保信使能夠將計劃送到每一個城市,或者確定根本無法做到這一點。

      hint

      costflow

      sol

      考慮建立費用流模型,核心思想是讓最大流量總是 \(\sum a_i\),而經過一個點的費用是 \(-B\)\(B\) 是一個極大的數),在一個點發放計劃的費用是 1,這樣求出最小費用之后,可以根據其除以 B 的整數部分計算其最多能讓多少個點收到計劃,根據余數計算出該前提下最小發放計劃的數量。

      [VP] Educational Codeforces Round 176 (Rated for Div. 2)

      F. Beautiful Sequence Returns

      如果以下條件成立,我們就把一個整數序列稱為美麗

      • 除第一個元素外,每個元素的左邊都有一個比它小的元素;
      • 除最后一個元素外,每個元素的右邊都有一個比它大的元素;

      給你一個大小為 \(n\) 的整數數組 \(a\) 。請求出最長優美子序列的長度。\(n \leq 5 \times 10^5\)

      sol

      一個子序列合法,當且僅當第一個元素是嚴格最小值,最后一個元素是嚴格最大值。

      \((i,a_i)\) 表示在二維平面,只有一些點能成為左下角,一些點能成為右上角。求出來。

      對于某個點,會將它統計進去的左下角,一定是一段區間,預先求出。

      枚舉右上角,線段樹動態維護貢獻。

      Neowise Labs Contest 1 (Codeforces Round 1018, Div. 1 + Div. 2)

      F. Wonderful Impostors

      Today, you will play a game with \(n\) viewers numbered \(1\) to \(n\).Each player is either a crewmate or an impostor. You don't know the role of each viewer.

      There are \(m\) statements numbered \(1\) to \(m\), which are either true or false. For each \(i\) from \(1\) to \(m\), statement \(i\) is one of two types:

      • \(0\:a_i\:b_i\) (\(1 \leq a_i \leq b_i \leq n\)) — there are no impostors among viewers \(a_i, a_i + 1, \ldots, b_i\);
      • \(1\:a_i\:b_i\) (\(1 \leq a_i \leq b_i \leq n\)) — there is at least one impostor among viewers \(a_i, a_i + 1, \ldots, b_i\).

      Answer \(q\) questions of the following form:

      • \(l\:r\) (\(1 \leq l \leq r \leq m\)) — is it possible that statements \(l, l + 1, \ldots, r\) are all true?

      \(n,m,q \leq 200000\).

      sol

      We'll use the two pointers method. To answer a question \(s_l\,s_r\), we just check that \(s_l \geq low(s_r)\).

      1. When we add a \(1\)-segment \([b_l, b_r]\), we can use a segment tree to check if it will be fully covered by a \(0\)-component.
      2. When we add a \(0\)-segment \([a_l, a_r]\), it might merge several \(0\)-components. So first we need to find the \(0\)-component \([c_l, c_r]\) that contains \([a_l, a_r]\).
      • \(c_l\) is the smallest value such that \(\min(count(c_l), count(c_l + 1), \ldots, count(a_l)) > 0\).
      • \(c_r\) is the largest value such that \(\min(count(a_r), count(a_r + 1), \ldots, count(c_r)) > 0\).
      • Both of these values can be found by performing a walk on the segment tree.
      • Now we only need to check if there's a \(1\)-segment that's fully covered by \([c_l, c_r]\).

      G. Wonderful Guessing Game

      This is an interactive problem.

      Alice is thinking of an integer from \(1\) to \(n\), and you must guess it by asking her some queries.To make things harder, she says you must ask all the queries first, and she will ignore exactly \(1\) query.

      For each query, you choose an array of \(k\) distinct integers from \(1\) to \(n\), where \(k\) is even. Then, Alice will respond with one of the following:

      • \(\texttt{L}\): the number is one of the first \(\frac{k}{2}\) elements of the array;
      • \(\texttt{R}\): the number is one of the last \(\frac{k}{2}\) elements of the array;
      • \(\texttt{N}\): the number is not in the array;
      • \(\texttt{?}\): this query is ignored.

      You must find a strategy that minimizes the number of queries. Can you do it? We can show that \(f(n) \leq 20\) for all \(n\) such that \(2 \le n \le 2 \cdot 10^5\).

      sol

      考慮如果 Alice 老老實實回答每個問題怎么做。

      \(L\) 視作 \(-1\),將 \(R\) 視作 \(1\),將 \(N\) 視作 \(0\)。每次詢問和必須等于 \(0\)

      只要對于任意兩個數都滿足,存在一組詢問使得這兩個數對應的值不同,就可以根據回答的序列唯一確定每個數。

      如果 Alice 忽略了某次詢問呢?想想怎么還原被忽略的詢問。

      再添加一個詢問,使得對于任意權值,詢問的和模 \(3\) 都等于 \(0\),這樣我們可以根據和求出被忽略的詢問,就可以做了。

      posted @ 2025-02-21 15:31  wanggk  閱讀(118)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 国产v亚洲v天堂a无码| 成人午夜视频在线| 日本一区二区三区专线| 久久久www免费人成精品| 精品人妻中文字幕有码在线| 艳妇乳肉豪妇荡乳在线观看| 性按摩玩人妻hd中文字幕| 亚洲成人四虎在线播放| 国产亚洲精品第一综合另类无码无遮挡又大又爽又黄的视频 | 亚洲人成色77777| 亚洲av成人一区二区三区| 野花社区www视频日本| 国产精品美女一区二三区| 丰满无码人妻热妇无码区| 99RE8这里有精品热视频| 大尺度国产一区二区视频| 亚洲日韩在线中文字幕第一页| 国产一区二区三区不卡观| 躁躁躁日日躁| 国产剧情福利一区二区麻豆| 永年县| 成人免费无遮挡在线播放| 夜夜添狠狠添高潮出水| 久久久这里只有精品10| 亚洲精品成人区在线观看| 欧美日韩国产图片区一区| 亚洲精品久荜中文字幕| 无码人妻精品一区二区三区免费| 熟女系列丰满熟妇AV| 在线播放亚洲成人av| 国产综合有码无码中文字幕 | 成人无码视频97免费| 99久久亚洲综合精品成人| 18无码粉嫩小泬无套在线观看| 国产精品久久久久久亚洲色| 洱源县| 亚洲精品二区在线播放| 国产91小视频在线观看| 一本大道无码av天堂| 亚洲精品国产熟女久久久| 亚洲18禁私人影院|