Штуки
Some checks failed
Build and Push Docker Images / build (src/LiquidCode.Tester.Gateway/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-gateway-roman, gateway) (push) Successful in 1m12s
Build and Push Docker Images / build (src/LiquidCode.Tester.Worker/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-worker-roman, worker) (push) Has been cancelled

This commit is contained in:
2025-11-02 19:31:34 +03:00
parent 50a94ae2be
commit e154890897
103 changed files with 11185 additions and 155 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,318 @@
.problem-statement {
margin: 0.5em auto 2em auto;
font-family: verdana,serif;
line-height: 1.5em;
font-size: 14px;
max-width: 1024px;
}
.problem-statement .epigraph {
margin-left: 67%;
width: 33%;
}
.problem-statement .epigraph-text {
}
.problem-statement .epigraph-source {
border-top: 1px solid #888;
text-align: right;
}
.problem-statement .lstlisting {
padding: 0.5em;
background-color: #f2f2f2;
}
.problem-statement .tex-tabular {
margin: 1em 0;
border-collapse: collapse;
border-spacing: 0;
}
.problem-statement .tex-tabular td {
padding: 0.15em 0.7em;
}
.problem-statement .tex-tabular .tex-tabular-border-left {
border-left: 1px solid;
}
.problem-statement .tex-tabular .tex-tabular-border-right {
border-right: 1px solid;
}
.problem-statement .tex-tabular .tex-tabular-border-top {
border-top: 1px solid;
}
.problem-statement .tex-tabular .tex-tabular-border-bottom {
border-bottom: 1px solid;
}
.problem-statement .tex-tabular .tex-tabular-text-align-left {
text-align: left;
}
.problem-statement .tex-tabular .tex-tabular-text-align-center {
text-align: center;
}
.problem-statement .tex-tabular .tex-tabular-text-align-right {
text-align: right;
}
.problem-statement p {
margin: 0 0 1em 0;
}
.problem-statement p a, .problem-statement ul a, .problem-statement ol a, .problem-statement td a {
margin: 0;
}
.problem-statement .header {
margin-bottom: 1em;
text-align: center;
}
.problem-statement .header .title {
font-size: 150%;
margin-bottom: 0.25em;
}
.problem-statement .header .title {
font-size: 150%;
font-family: arial, serif;
}
.problem-statement ul {
list-style: disc outside;
margin: 0 0 1em 0;
}
.problem-statement ol {
list-style: decimal outside;
margin: 0 0 1em 0;
}
.problem-statement li {
line-height: 1.5em;
margin-left: 3em;
}
.problem-statement .property-title {
display: inline;
}
.problem-statement .property-title:after {
content: ": ";
}
.problem-statement .time-limit, .problem-statement .memory-limit, .problem-statement .input-file, .problem-statement .output-file {
margin: 0 auto;
}
.problem-statement .legend {
margin-bottom: 1em;
}
.problem-statement .tutorial {
margin-bottom: 1em;
}
.problem-statement .section-title {
font-family: arial, serif;
font-size: 115%;
font-weight: bold;
}
.problem-statement .input-specification,
.problem-statement .output-specification,
.problem-statement .sample-tests,
.problem-statement .author,
.problem-statement .resource,
.problem-statement .date {
/*margin-bottom: 1em;*/
}
.problem-statement .output-specification {
margin-bottom: 1em;
}
.problem-statement .sample-tests .sample-test {
}
.problem-statement .sample-tests .input, .problem-statement .sample-tests .output {
border: 1px solid #888;
}
.problem-statement .sample-tests .output {
margin-bottom: 1em;
position: relative;
top: -1px;
}
.problem-statement .sample-tests pre {
line-height: 1.25em;
padding: 0.25em;
margin: 0;
background-color: #efefef;
}
.problem-statement .sample-tests .title {
font-family: arial, serif;
padding: 0.25em;
border-bottom: 1px solid #888;
text-transform: lowercase;
font-weight: bold;
}
.problem-statement .tex-formula {
vertical-align: middle;
margin: 0;
border:medium none;
position: relative;
bottom: 2px;
}
.problem-statement .tex-span {
font-size: 125%;
font-family: times new roman, serif;
white-space: nowrap;
}
.problem-statement .tex-font-size-tiny {
font-size: 70%;
}
.problem-statement .tex-font-size-script {
font-size: 75%;
}
.problem-statement .tex-font-size-footnotes {
font-size: 85%;
}
.problem-statement .tex-font-size-small {
font-size: 85%;
}
.problem-statement .tex-font-size-normal {
font-size: 100%;
}
.problem-statement .tex-font-size-large-1 {
font-size: 115%;
}
.problem-statement .tex-font-size-large-2 {
font-size: 130%;
}
.problem-statement .tex-font-size-large-3 {
font-size: 145%;
}
.problem-statement .tex-font-size-huge-1 {
font-size: 175%;
}
.problem-statement .tex-font-size-huge-2 {
font-size: 200%;
}
.problem-statement .tex-font-style-rm {
}
.problem-statement .tex-font-style-striked {
text-decoration: line-through;
}
.problem-statement .tex-font-style-underline {
text-decoration: underline;
}
.problem-statement .tex-font-style-sf {
font-family: arial, serif;
}
.problem-statement .tex-font-style-tt {
font-size: 110%;
font-family: courier new, serif;
}
.problem-statement .tex-font-style-md {
}
.problem-statement .tex-font-style-bf {
font-weight: bold;
}
.problem-statement .tex-font-style-up {
}
.problem-statement .tex-font-style-it {
font-style: italic;
}
.problem-statement .tex-font-style-sl {
font-style: italic;
}
.problem-statement .tex-font-style-sc {
text-transform: uppercase;
}
.problem-statement .tex-graphics {
max-width: 95%;
display: block;
}
.problem-statement .tex-tabular .tex-graphics {
max-width: 100%;
}
.problem-statement .input-output-copier {
font-size: 0.75rem;
float: right;
color: #888;
padding: 3px;
cursor: pointer;
border: 1px solid rgb(185, 185, 185);
line-height: 0.8rem;
text-transform: none;
}
.problem-statement .input-output-copier:hover {
background-color: #def;
}
.problem-statement .test-example-line-even {
background-color: #E0E0E0;
}
.statement-footnote {
font-size: 85%;
position: relative;
}
.statement-footnote::before {
content: "";
position: absolute;
top: -2px;
width: 25%;
border-top: 1px solid #888;
}
.statement-footnote p {
margin-bottom: 0.5em;
}
.statement-footnote p:last-child {
margin-bottom: 1em;
}
.problem-statement .header .input-standard,
.problem-statement .header .output-standard {
display: none;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META content="no-cache" http-equiv="pragma">
<META content="-1" http-equiv="expires">
<META content="text/html;charset=UTF-8" http-equiv="content-type">
<LINK href="problem-statement.css" rel="stylesheet" type="text/css">
<TITLE>Очередь за кексами</TITLE>
<SCRIPT type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$$$','$$$']], displayMath: [['$$$$$$','$$$$$$']]}
});
</SCRIPT>
<SCRIPT async="" src="https://polygon.codeforces.com/lib/MathJax/MathJax.js?config=TeX-MML-AM_CHTML" type="text/javascript">
</SCRIPT>
</HEAD><BODY>
<DIV class="problem-statement"><DIV class="header"><DIV class="title">Очередь за кексами</DIV></DIV><DIV class="tutorial"><P>Давайте просто промоделируем все действия.</P><P>Заведем список элементов, а также сохраним по ключу $$$x$$$ указатель на элемент списка. Мы можем это сделать, так как все элементы различны. Например, в С++ можно просто завести коллекцию list&lt;int&gt;, а также map&lt;int, list&lt;int&gt;::iterator&gt; или реализовать свой список.</P><P>Теперь мы можем легко обрабатывать все запросы, а в конце просто выведем весь список.</P><P>Запрос 1-го типа можно обработать так: просто берем по ключу указатель на нужный элемент и вставляем перед ним другой элемент, останется только по ключу $$$x$$$ записать указатель на новый элемент.</P><P>Запрос 2-го типа&nbsp;&mdash; просто добавить в список элемент в конец и сохранить на него указатель.</P><P>Запрос 3-го типа&nbsp;&mdash; удаляем из списка элемент по его указателю.</P><P>В конце просто выводим массив.</P><P>Итоговая сложность $$$O(mlog(n))$$$</P></DIV></DIV>
</BODY></HTML>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,8 @@
7 6
1 2 3 4 5 6 7
1 8 3
2 9
3 3
1 3 9
2 10
3 1

View File

@@ -0,0 +1,2 @@
9
2 8 4 5 6 7 3 9 10

View File

@@ -0,0 +1,8 @@
MU<EFBFBD>7 6
1 2 3 4 5 6 7
1 8 3
2 9
3 3
1 3 9
2 10
3 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,81 @@
\begin{problem}{Очередь за кексами}{стандартный ввод}{стандартный вывод}{1 секунда}{256 мегабайт}
В честь юбилея ректорат ЮФУ решил запустить акцию <<Сто и десять кексов>>. В каждом корпусе университета открылась лавка с кексами, в которой каждый студент может получить бесплатные кексы.
Не прошло и пары минут после открытия, как к лавкам набежали студенты и образовалось много очередей. Но самая большая очередь образовалась в главном корпусе ЮФУ. Изначально в этой очереди стояло $n$ студентов, но потом в течение следующих $m$ минут какие-то студенты приходили и вставали в очередь, а какие-то уходили.
За каждым студентом закреплен номер его зачетной книжки, будем называть это число номером студента. У каждого студента будет уникальный номер, по которому можно однозначно его идентифицировать. Будем считать, что каждую минуту происходило одно из следующих событий:
\begin{enumerate}
\item Студент с номером $x$ пришел и встал перед студентом с номером $y$;
\item Студент с номером $x$ пришел и встал в конец очереди;
\item Студент с номером $x$ ушел из очереди; возможно, он потом вернется.
\end{enumerate}
Аналитикам стало интересно, а какой будет очередь после $m$ минут?
Помогите им и сообщите конечное состояние очереди.
\InputFile
В первой строке заданы два целых числа $n$ и $m$ $(1 \le n, m \le 10^5)$~--- текущее число студентов в очереди и количество изменений.
В следующей строке задается $n$ целых \textbf{различных} чисел $a_1, a_2, \cdots , a_n$ $(1 \le a_i \le 10^9)$, где $a_i$~--- номер студента, который стоит на $i$-й позиции в очереди.
В следующих $m$ строках идет описание запросов изменения очереди.
В каждой строке в зависимости от типа запроса задается два или три числа. Первое число $t_j$ $(1 \le t_j \le 3)$~--- тип события, которое произошло в $j$-ю минуту.
Если $t_j = \textbf{1}$, то в строке задается еще 2 числа $x$ $(1 \le x_j \le 10^9)$ и $y$ $(1 \le y_j \le 10^9)$~--- номер студента, который пришел, и номер студента, перед которым он встанет в очереди. Гарантируется, что студент с номером $x$ ещё не занял очередь, а студент с номером $y$ уже стоит в ней.
Если $t_j = \textbf{2}$, то в строке задается еще 1 число $x$ $(1 \le x_j \le 10^9)$~--- номер студента, который пришел и встал в конец очереди. Гарантируется, что студент с номером $x$ ещё не занял очередь.
Если $t_j = \textbf{3}$, то в строке задается еще 1 число $x$ $(1 \le x_j \le 10^9)$~--- номер студента, который ушел из очереди. Гарантируется, что студент с номером $x$ стоит в очереди.
\OutputFile
В первой строке выведите одно число $|a|$~--- длину очереди после выполнения всех запросов изменения.
В следующей строке выведите $|a|$ чисел $a_1, a_2, \cdots , a_{|a|}$, где $a_i$~--- номер студента, который стоит на $i$-й позиции в очереди.
\Example
\begin{example}
\exmpfile{example.01}{example.01.a}%
\end{example}
\Note
Изначально очередь выглядит следующим образом:
\includegraphics{o1.png}
В первую минуту приходит студент с номером 8 и встает перед студентом с номером 3.
\includegraphics{o2.png}
Потом студент с номером 9 встает в конец очереди.
\includegraphics{o3.png}
Студент с номером 3 уходит из очереди.
\includegraphics{o4.png}
Потом он возвращается и становится перед студентом с номером 9.
\includegraphics{o5.png}
После в конец очереди становится студент с номером 10.
\includegraphics{o6.png}
И студент с номером 1 уходит из очереди.
\includegraphics{o7.png}
После $m$ событий очередь имеет следующий вид:
\includegraphics{o8.png}
\end{problem}

View File

@@ -0,0 +1,19 @@
\begin{tutorial}{Очередь за кексами}
Давайте просто промоделируем все действия.
Заведем список элементов, а также сохраним по ключу $x$ указатель на элемент списка. Мы можем это сделать, так как все элементы различны. Например, в С++ можно просто завести коллекцию list<int>, а также map<int, list<int>::iterator> или реализовать свой список.
Теперь мы можем легко обрабатывать все запросы, а в конце просто выведем весь список.
Запрос 1-го типа можно обработать так: просто берем по ключу указатель на нужный элемент и вставляем перед ним другой элемент, останется только по ключу $x$ записать указатель на новый элемент.
Запрос 2-го типа~--- просто добавить в список элемент в конец и сохранить на него указатель.
Запрос 3-го типа~--- удаляем из списка элемент по его указателю.
В конце просто выводим массив.
Итоговая сложность $O(mlog(n))$
\end{tutorial}