Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: TypeError
Message: Couldn't cast array of type string to null
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1871, in _prepare_split_single
writer.write_table(table)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 623, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2293, in table_cast
return cast_table_to_schema(table, schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2246, in cast_table_to_schema
arrays = [
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2247, in <listcomp>
cast_array_to_feature(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1796, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1796, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2103, in cast_array_to_feature
return array_cast(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1798, in wrapper
return func(array, *args, **kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1949, in array_cast
raise TypeError(f"Couldn't cast array of type {_short_str(array.type)} to {_short_str(pa_type)}")
TypeError: Couldn't cast array of type string to null
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1438, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1050, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 925, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1001, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1742, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1898, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
id
string | aliases
sequence | contest_id
string | contest_name
string | contest_type
string | contest_start
int64 | contest_start_year
int64 | index
string | time_limit
float64 | memory_limit
int64 | title
string | description
string | input_format
string | output_format
string | interaction_format
null | note
string | examples
list | editorial
string | rating
int64 | tags
sequence | testset_size
int64 | official_tests
list | official_tests_complete
bool | input_mode
string | generated_checker
null | executable
bool |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
465/A
| null |
465
|
Codeforces Round 265 (Div. 2)
|
CF
| 1,410,103,800
| 2,014
|
A
| 1
| 256
|
inc ARG
|
Sergey is testing a next-generation processor. Instead of bytes the processor works with memory cells consisting of n bits. These bits are numbered from 1 to n. An integer is stored in the cell in the following way: the least significant bit is stored in the first bit of the cell, the next significant bit is stored in the second bit, and so on; the most significant bit is stored in the n-th bit.
Now Sergey wants to test the following instruction: "add 1 to the value of the cell". As a result of the instruction, the integer that is written in the cell must be increased by one; if some of the most significant bits of the resulting number do not fit into the cell, they must be discarded.
Sergey wrote certain values ββof the bits in the cell and is going to add one to its value. How many bits of the cell will change after the operation?
|
The first line contains a single integer n (1 β€ n β€ 100) β the number of bits in the cell.
The second line contains a string consisting of n characters β the initial state of the cell. The first character denotes the state of the first bit of the cell. The second character denotes the second least significant bit and so on. The last character denotes the state of the most significant bit.
|
Print a single integer β the number of bits in the cell which change their state after we add 1 to the cell.
| null |
In the first sample the cell ends up with value 0010, in the second sample β with 0000.
|
[
{
"input": "4\n1100",
"output": "3"
},
{
"input": "4\n1111",
"output": "4"
}
] | null | 900
|
[
"implementation"
] | 33
|
[
{
"input": "4\r\n1100\r\n",
"output": "3\r\n"
},
{
"input": "4\r\n1111\r\n",
"output": "4\r\n"
},
{
"input": "1\r\n0\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n1\r\n",
"output": "1\r\n"
},
{
"input": "2\r\n00\r\n",
"output": "1\r\n"
},
{
"input": "2\r\n01\r\n",
"output": "1\r\n"
},
{
"input": "2\r\n10\r\n",
"output": "2\r\n"
},
{
"input": "2\r\n11\r\n",
"output": "2\r\n"
},
{
"input": "10\r\n0000000000\r\n",
"output": "1\r\n"
},
{
"input": "20\r\n11111111110110001100\r\n",
"output": "11\r\n"
},
{
"input": "50\r\n01011110100010000001010000100001001101001101101011\r\n",
"output": "1\r\n"
},
{
"input": "60\r\n111111111101111111111111111111111111111111111111111111111111\r\n",
"output": "11\r\n"
},
{
"input": "60\r\n111111111111111111111111111111111111111111111111111111111111\r\n",
"output": "60\r\n"
},
{
"input": "66\r\n111111010010011001110011000111000100011110011001111110011111111101\r\n",
"output": "7\r\n"
},
{
"input": "90\r\n000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\r\n",
"output": "1\r\n"
},
{
"input": "91\r\n1011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\r\n",
"output": "2\r\n"
},
{
"input": "92\r\n11111111101011111011111111111111111111111011101111111111011111111111111101111111101011111101\r\n",
"output": "10\r\n"
},
{
"input": "100\r\n0001011110100011001100100010111001000001111101101001001001001011110100101101010000000110100101110010\r\n",
"output": "1\r\n"
},
{
"input": "100\r\n0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\r\n",
"output": "1\r\n"
},
{
"input": "100\r\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\r\n",
"output": "1\r\n"
},
{
"input": "100\r\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\r\n",
"output": "1\r\n"
},
{
"input": "100\r\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\r\n",
"output": "100\r\n"
},
{
"input": "100\r\n1011001110001000011111110011000100001110010110111101110110011011011000010100110001111100000010110010\r\n",
"output": "2\r\n"
},
{
"input": "100\r\n1101111011001111111111110011110111101110111111111111111111111111111111011111111111110111111111111111\r\n",
"output": "3\r\n"
},
{
"input": "100\r\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\r\n",
"output": "100\r\n"
},
{
"input": "100\r\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110\r\n",
"output": "100\r\n"
},
{
"input": "100\r\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101\r\n",
"output": "99\r\n"
},
{
"input": "100\r\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000\r\n",
"output": "96\r\n"
},
{
"input": "100\r\n1111111111111111111111111111111110011000110110001010101100100100001000010010010010000100110000010101\r\n",
"output": "34\r\n"
},
{
"input": "55\r\n1111111111111111111111111111111111111111111110111111111\r\n",
"output": "46\r\n"
},
{
"input": "100\r\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\r\n",
"output": "100\r\n"
},
{
"input": "100\r\n0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101\r\n",
"output": "1\r\n"
},
{
"input": "91\r\n0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\r\n",
"output": "1\r\n"
}
] | true
|
stdio
| null | true
|
465/B
| null |
465
|
Codeforces Round 265 (Div. 2)
|
CF
| 1,410,103,800
| 2,014
|
B
| 1
| 256
|
Inbox (100500)
|
Over time, Alexey's mail box got littered with too many letters. Some of them are read, while others are unread.
Alexey's mail program can either show a list of all letters or show the content of a single letter. As soon as the program shows the content of an unread letter, it becomes read letter (if the program shows the content of a read letter nothing happens). In one click he can do any of the following operations:
- Move from the list of letters to the content of any single letter.
- Return to the list of letters from single letter viewing mode.
- In single letter viewing mode, move to the next or to the previous letter in the list. You cannot move from the first letter to the previous one or from the last letter to the next one.
The program cannot delete the letters from the list or rearrange them.
Alexey wants to read all the unread letters and go watch football. Now he is viewing the list of all letters and for each letter he can see if it is read or unread. What minimum number of operations does Alexey need to perform to read all unread letters?
|
The first line contains a single integer n (1 β€ n β€ 1000) β the number of letters in the mailbox.
The second line contains n space-separated integers (zeros and ones) β the state of the letter list. The i-th number equals either 1, if the i-th number is unread, or 0, if the i-th letter is read.
|
Print a single number β the minimum number of operations needed to make all the letters read.
| null |
In the first sample Alexey needs three operations to cope with the task: open the second letter, move to the third one, move to the fourth one.
In the second sample the action plan: open the first letter, move to the second letter, return to the list, open the fifth letter.
In the third sample all letters are already read.
|
[
{
"input": "5\n0 1 0 1 0",
"output": "3"
},
{
"input": "5\n1 1 0 0 1",
"output": "4"
},
{
"input": "2\n0 0",
"output": "0"
}
] | null | 1,000
|
[
"implementation"
] | 44
|
[
{
"input": "5\r\n0 1 0 1 0\r\n",
"output": "3\r\n"
},
{
"input": "5\r\n1 1 0 0 1\r\n",
"output": "4\r\n"
},
{
"input": "2\r\n0 0\r\n",
"output": "0\r\n"
},
{
"input": "9\r\n1 0 1 0 1 0 1 0 1\r\n",
"output": "9\r\n"
},
{
"input": "5\r\n1 1 1 1 1\r\n",
"output": "5\r\n"
},
{
"input": "14\r\n0 0 1 1 1 0 1 1 1 0 1 1 1 0\r\n",
"output": "11\r\n"
},
{
"input": "23\r\n1 1 1 0 1 1 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1\r\n",
"output": "23\r\n"
},
{
"input": "27\r\n0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0\r\n",
"output": "25\r\n"
},
{
"input": "10\r\n1 0 0 0 0 1 0 0 0 1\r\n",
"output": "5\r\n"
},
{
"input": "10\r\n1 0 0 1 0 0 1 1 0 1\r\n",
"output": "8\r\n"
},
{
"input": "27\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n",
"output": "0\r\n"
},
{
"input": "39\r\n1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1\r\n",
"output": "39\r\n"
},
{
"input": "48\r\n1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1\r\n",
"output": "39\r\n"
},
{
"input": "71\r\n0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0\r\n",
"output": "59\r\n"
},
{
"input": "99\r\n1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1\r\n",
"output": "99\r\n"
},
{
"input": "99\r\n1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1\r\n",
"output": "99\r\n"
},
{
"input": "100\r\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\r\n",
"output": "100\r\n"
},
{
"input": "100\r\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\r\n",
"output": "99\r\n"
},
{
"input": "193\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n",
"output": "1\r\n"
},
{
"input": "213\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n",
"output": "5\r\n"
},
{
"input": "2\r\n1 0\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n1\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n0\r\n",
"output": "0\r\n"
},
{
"input": "5\r\n0 0 0 0 1\r\n",
"output": "1\r\n"
},
{
"input": "12\r\n0 1 1 0 1 1 0 1 1 0 0 0\r\n",
"output": "8\r\n"
},
{
"input": "3\r\n1 0 0\r\n",
"output": "1\r\n"
},
{
"input": "5\r\n0 0 1 0 0\r\n",
"output": "1\r\n"
},
{
"input": "3\r\n0 1 0\r\n",
"output": "1\r\n"
},
{
"input": "6\r\n1 1 0 0 0 0\r\n",
"output": "2\r\n"
},
{
"input": "4\r\n0 1 0 0\r\n",
"output": "1\r\n"
},
{
"input": "5\r\n1 1 1 0 0\r\n",
"output": "3\r\n"
},
{
"input": "4\r\n1 0 0 0\r\n",
"output": "1\r\n"
},
{
"input": "6\r\n1 1 1 1 0 0\r\n",
"output": "4\r\n"
}
] | false
|
stdio
| null | true
|
1347/B
|
[
"1351/B"
] |
1347
|
Kotlin Heroes: Practice 4
|
ICPC
| 1,590,154,500
| 2,020
|
B
| 1
| 256
|
Square?
|
Vasya claims that he had a paper square. He cut it into two rectangular parts using one vertical or horizontal cut. Then Vasya informed you the dimensions of these two rectangular parts. You need to check whether Vasya originally had a square. In other words, check if it is possible to make a square using two given rectangles.
|
The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases in the input. Then $$$t$$$ test cases follow.
Each test case is given in two lines.
The first line contains two integers $$$a_1$$$ and $$$b_1$$$ ($$$1 \le a_1, b_1 \le 100$$$) β the dimensions of the first one obtained after cutting rectangle. The sizes are given in random order (that is, it is not known which of the numbers is the width, and which of the numbers is the length).
The second line contains two integers $$$a_2$$$ and $$$b_2$$$ ($$$1 \le a_2, b_2 \le 100$$$) β the dimensions of the second obtained after cutting rectangle. The sizes are given in random order (that is, it is not known which of the numbers is the width, and which of the numbers is the length).
|
Print $$$t$$$ answers, each of which is a string "YES" (in the case of a positive answer) or "NO" (in the case of a negative answer). The letters in words can be printed in any case (upper or lower).
| null | null |
[
{
"input": "3\n2 3\n3 1\n3 2\n1 3\n3 3\n1 3",
"output": "Yes\nYes\nNo"
}
] | null | 900
|
[
"*special",
"implementation",
"math"
] | 6
|
[
{
"input": "3\r\n2 3\r\n3 1\r\n3 2\r\n1 3\r\n3 3\r\n1 3\r\n",
"output": "Yes\r\nYes\r\nNo\r\n"
},
{
"input": "1\r\n64 9\r\n41 36\r\n",
"output": "No\r\n"
}
] | false
|
stdio
| null | true
|
1223/B
|
[
"1241/B"
] |
1223
|
Technocup 2020 - Elimination Round 1
|
CF
| 1,570,374,300
| 2,019
|
B
| 1
| 256
|
Strings Equalization
|
You are given two strings of equal length $$$s$$$ and $$$t$$$ consisting of lowercase Latin letters. You may perform any number (possibly, zero) operations on these strings.
During each operation you choose two adjacent characters in any string and assign the value of the first character to the value of the second or vice versa.
For example, if $$$s$$$ is "acbc" you can get the following strings in one operation:
- "aabc" (if you perform $$$s_2 = s_1$$$);
- "ccbc" (if you perform $$$s_1 = s_2$$$);
- "accc" (if you perform $$$s_3 = s_2$$$ or $$$s_3 = s_4$$$);
- "abbc" (if you perform $$$s_2 = s_3$$$);
- "acbb" (if you perform $$$s_4 = s_3$$$);
Note that you can also apply this operation to the string $$$t$$$.
Please determine whether it is possible to transform $$$s$$$ into $$$t$$$, applying the operation above any number of times.
Note that you have to answer $$$q$$$ independent queries.
|
The first line contains one integer $$$q$$$ ($$$1 \le q \le 100$$$)Β β the number of queries. Each query is represented by two consecutive lines.
The first line of each query contains the string $$$s$$$ ($$$1 \le |s| \le 100$$$) consisting of lowercase Latin letters.
The second line of each query contains the string $$$t$$$ ($$$1 \le |t| \leq 100$$$, $$$|t| = |s|$$$) consisting of lowercase Latin letters.
|
For each query, print "YES" if it is possible to make $$$s$$$ equal to $$$t$$$, and "NO" otherwise.
You may print every letter in any case you want (so, for example, the strings "yEs", "yes", "Yes", and "YES" will all be recognized as positive answer).
| null |
In the first query, you can perform two operations $$$s_1 = s_2$$$ (after it $$$s$$$ turns into "aabb") and $$$t_4 = t_3$$$ (after it $$$t$$$ turns into "aabb").
In the second query, the strings are equal initially, so the answer is "YES".
In the third query, you can not make strings $$$s$$$ and $$$t$$$ equal. Therefore, the answer is "NO".
|
[
{
"input": "3\nxabb\naabx\ntechnocup\ntechnocup\na\nz",
"output": "YES\nYES\nNO"
}
] |
If there is a character which is contained in string $$$s$$$ and $$$t$$$ (let's denote it as $$$c$$$), then we answer is "YES" because we can turn these string into string consisting only of this character $$$c$$$.
Otherwise the answer is "NO", because if initially strings have not a common character, then after performing operation they also have not a common character.
| 1,000
|
[
"strings"
] | 33
|
[
{
"input": "3\r\nxabb\r\naabx\r\ntechnocup\r\ntechnocup\r\na\r\nz\r\n",
"output": "YES\r\nYES\r\nNO\r\n"
}
] | false
|
stdio
| null | true
|
501/A
| null |
501
|
Codeforces Round 285 (Div. 2)
|
CF
| 1,421,053,200
| 2,015
|
A
| 1
| 256
|
Contest
|
Misha and Vasya participated in a Codeforces contest. Unfortunately, each of them solved only one problem, though successfully submitted it at the first attempt. Misha solved the problem that costs a points and Vasya solved the problem that costs b points. Besides, Misha submitted the problem c minutes after the contest started and Vasya submitted the problem d minutes after the contest started. As you know, on Codeforces the cost of a problem reduces as a round continues. That is, if you submit a problem that costs p points t minutes after the contest started, you get $$\max \left( \frac{3p}{10}, p - \frac{p}{250} \times t \right)$$ points.
Misha and Vasya are having an argument trying to find out who got more points. Help them to find out the truth.
|
The first line contains four integers a, b, c, d (250 β€ a, b β€ 3500, 0 β€ c, d β€ 180).
It is guaranteed that numbers a and b are divisible by 250 (just like on any real Codeforces round).
|
Output on a single line:
"Misha" (without the quotes), if Misha got more points than Vasya.
"Vasya" (without the quotes), if Vasya got more points than Misha.
"Tie" (without the quotes), if both of them got the same number of points.
| null | null |
[
{
"input": "500 1000 20 30",
"output": "Vasya"
},
{
"input": "1000 1000 1 1",
"output": "Tie"
},
{
"input": "1500 1000 176 177",
"output": "Misha"
}
] | null | 900
|
[
"implementation"
] | 40
|
[
{
"input": "500 1000 20 30\r\n",
"output": "Vasya\r\n"
},
{
"input": "1000 1000 1 1\r\n",
"output": "Tie\r\n"
},
{
"input": "1500 1000 176 177\r\n",
"output": "Misha\r\n"
},
{
"input": "1500 1000 74 177\r\n",
"output": "Misha\r\n"
},
{
"input": "750 2500 175 178\r\n",
"output": "Vasya\r\n"
},
{
"input": "750 1000 54 103\r\n",
"output": "Tie\r\n"
},
{
"input": "2000 1250 176 130\r\n",
"output": "Tie\r\n"
},
{
"input": "1250 1750 145 179\r\n",
"output": "Tie\r\n"
},
{
"input": "2000 2000 176 179\r\n",
"output": "Tie\r\n"
},
{
"input": "1500 1500 148 148\r\n",
"output": "Tie\r\n"
},
{
"input": "2750 1750 134 147\r\n",
"output": "Misha\r\n"
},
{
"input": "3250 250 175 173\r\n",
"output": "Misha\r\n"
},
{
"input": "500 500 170 176\r\n",
"output": "Misha\r\n"
},
{
"input": "250 1000 179 178\r\n",
"output": "Vasya\r\n"
},
{
"input": "3250 1000 160 138\r\n",
"output": "Misha\r\n"
},
{
"input": "3000 2000 162 118\r\n",
"output": "Tie\r\n"
},
{
"input": "1500 1250 180 160\r\n",
"output": "Tie\r\n"
},
{
"input": "1250 2500 100 176\r\n",
"output": "Tie\r\n"
},
{
"input": "3500 3500 177 178\r\n",
"output": "Tie\r\n"
},
{
"input": "3000 3250 16 34\r\n",
"output": "Tie\r\n"
},
{
"input": "1750 3000 137 49\r\n",
"output": "Vasya\r\n"
},
{
"input": "500 1500 179 71\r\n",
"output": "Vasya\r\n"
},
{
"input": "1250 2000 101 180\r\n",
"output": "Misha\r\n"
},
{
"input": "250 750 180 176\r\n",
"output": "Vasya\r\n"
},
{
"input": "2250 2250 163 145\r\n",
"output": "Vasya\r\n"
},
{
"input": "3000 3000 176 78\r\n",
"output": "Vasya\r\n"
},
{
"input": "250 3500 8 178\r\n",
"output": "Vasya\r\n"
},
{
"input": "1750 1250 179 180\r\n",
"output": "Misha\r\n"
},
{
"input": "2750 1750 13 164\r\n",
"output": "Misha\r\n"
},
{
"input": "1750 2250 178 53\r\n",
"output": "Vasya\r\n"
},
{
"input": "2500 2750 73 179\r\n",
"output": "Misha\r\n"
},
{
"input": "1000 3500 178 175\r\n",
"output": "Vasya\r\n"
},
{
"input": "1000 500 7 162\r\n",
"output": "Misha\r\n"
},
{
"input": "1000 250 175 48\r\n",
"output": "Misha\r\n"
},
{
"input": "1750 500 166 177\r\n",
"output": "Misha\r\n"
},
{
"input": "250 250 0 0\r\n",
"output": "Tie\r\n"
},
{
"input": "250 3500 0 0\r\n",
"output": "Vasya\r\n"
},
{
"input": "250 3500 0 180\r\n",
"output": "Vasya\r\n"
},
{
"input": "3500 3500 180 180\r\n",
"output": "Tie\r\n"
},
{
"input": "3500 250 0 180\r\n",
"output": "Misha\r\n"
}
] | true
|
stdio
| null | true
|
139/A
| null |
139
|
Codeforces Beta Round 99 (Div. 2)
|
CF
| 1,324,728,000
| 2,011
|
A
| 2
| 256
|
Petr and Book
|
One Sunday Petr went to a bookshop and bought a new book on sports programming. The book had exactly n pages.
Petr decided to start reading it starting from the next day, that is, from Monday. Petr's got a very tight schedule and for each day of the week he knows how many pages he will be able to read on that day. Some days are so busy that Petr will have no time to read whatsoever. However, we know that he will be able to read at least one page a week.
Assuming that Petr will not skip days and will read as much as he can every day, determine on which day of the week he will read the last page of the book.
|
The first input line contains the single integer n (1 β€ n β€ 1000) β the number of pages in the book.
The second line contains seven non-negative space-separated integers that do not exceed 1000 β those integers represent how many pages Petr can read on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday correspondingly. It is guaranteed that at least one of those numbers is larger than zero.
|
Print a single number β the number of the day of the week, when Petr will finish reading the book. The days of the week are numbered starting with one in the natural order: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.
| null |
Note to the first sample:
By the end of Monday and therefore, by the beginning of Tuesday Petr has 85 pages left. He has 65 pages left by Wednesday, 45 by Thursday, 30 by Friday, 20 by Saturday and on Saturday Petr finishes reading the book (and he also has time to read 10 pages of something else).
Note to the second sample:
On Monday of the first week Petr will read the first page. On Monday of the second week Petr will read the second page and will finish reading the book.
|
[
{
"input": "100\n15 20 20 15 10 30 45",
"output": "6"
},
{
"input": "2\n1 0 0 0 0 0 0",
"output": "1"
}
] | null | 1,000
|
[
"implementation"
] | 49
|
[
{
"input": "100\r\n15 20 20 15 10 30 45\r\n",
"output": "6\r\n"
},
{
"input": "2\r\n1 0 0 0 0 0 0\r\n",
"output": "1\r\n"
},
{
"input": "100\r\n100 200 100 200 300 400 500\r\n",
"output": "1\r\n"
},
{
"input": "3\r\n1 1 1 1 1 1 1\r\n",
"output": "3\r\n"
},
{
"input": "1\r\n1 1 1 1 1 1 1\r\n",
"output": "1\r\n"
},
{
"input": "20\r\n5 3 7 2 1 6 4\r\n",
"output": "6\r\n"
},
{
"input": "10\r\n5 1 1 1 1 1 5\r\n",
"output": "6\r\n"
},
{
"input": "50\r\n10 1 10 1 10 1 10\r\n",
"output": "1\r\n"
},
{
"input": "77\r\n11 11 11 11 11 11 10\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n1000 1000 1000 1000 1000 1000 1000\r\n",
"output": "1\r\n"
},
{
"input": "1000\r\n100 100 100 100 100 100 100\r\n",
"output": "3\r\n"
},
{
"input": "999\r\n10 20 10 20 30 20 10\r\n",
"output": "3\r\n"
},
{
"input": "433\r\n109 58 77 10 39 125 15\r\n",
"output": "7\r\n"
},
{
"input": "1\r\n0 0 0 0 0 0 1\r\n",
"output": "7\r\n"
},
{
"input": "5\r\n1 0 1 0 1 0 1\r\n",
"output": "1\r\n"
},
{
"input": "997\r\n1 1 0 0 1 0 1\r\n",
"output": "1\r\n"
},
{
"input": "1000\r\n1 1 1 1 1 1 1\r\n",
"output": "6\r\n"
},
{
"input": "1000\r\n1000 1000 1000 1000 1000 1000 1000\r\n",
"output": "1\r\n"
},
{
"input": "1000\r\n1 0 0 0 0 0 0\r\n",
"output": "1\r\n"
},
{
"input": "1000\r\n0 0 0 0 0 0 1\r\n",
"output": "7\r\n"
},
{
"input": "1000\r\n1 0 0 1 0 0 1\r\n",
"output": "1\r\n"
},
{
"input": "509\r\n105 23 98 0 7 0 155\r\n",
"output": "2\r\n"
},
{
"input": "7\r\n1 1 1 1 1 1 1\r\n",
"output": "7\r\n"
},
{
"input": "2\r\n1 1 0 0 0 0 0\r\n",
"output": "2\r\n"
},
{
"input": "1\r\n0 0 0 0 0 1 0\r\n",
"output": "6\r\n"
},
{
"input": "10\r\n0 0 0 0 0 0 1\r\n",
"output": "7\r\n"
},
{
"input": "5\r\n0 0 0 0 0 6 0\r\n",
"output": "6\r\n"
},
{
"input": "3\r\n0 1 0 0 0 0 0\r\n",
"output": "2\r\n"
},
{
"input": "10\r\n0 0 0 0 0 0 10\r\n",
"output": "7\r\n"
},
{
"input": "28\r\n1 2 3 4 5 6 7\r\n",
"output": "7\r\n"
},
{
"input": "100\r\n5 5 5 5 5 5 5\r\n",
"output": "6\r\n"
},
{
"input": "4\r\n1 0 0 0 0 0 1\r\n",
"output": "7\r\n"
},
{
"input": "2\r\n0 0 0 0 0 0 1\r\n",
"output": "7\r\n"
},
{
"input": "7\r\n0 0 0 0 0 0 7\r\n",
"output": "7\r\n"
},
{
"input": "7\r\n2 1 1 1 1 1 0\r\n",
"output": "6\r\n"
},
{
"input": "2\r\n0 0 1 1 0 0 0\r\n",
"output": "4\r\n"
},
{
"input": "6\r\n1 1 1 1 1 1 0\r\n",
"output": "6\r\n"
},
{
"input": "5\r\n1 1 1 0 0 1 1\r\n",
"output": "7\r\n"
},
{
"input": "100\r\n10 20 30 10 10 10 10\r\n",
"output": "7\r\n"
},
{
"input": "1\r\n0 0 0 1 0 0 0\r\n",
"output": "4\r\n"
},
{
"input": "70\r\n10 10 10 10 10 10 10\r\n",
"output": "7\r\n"
},
{
"input": "22\r\n1 2 3 4 5 6 10\r\n",
"output": "7\r\n"
},
{
"input": "5\r\n0 0 0 1 0 0 0\r\n",
"output": "4\r\n"
},
{
"input": "2\r\n0 0 0 1 0 0 0\r\n",
"output": "4\r\n"
},
{
"input": "6\r\n1 0 0 0 0 0 2\r\n",
"output": "7\r\n"
},
{
"input": "10\r\n1 2 2 1 2 1 1\r\n",
"output": "7\r\n"
},
{
"input": "5\r\n0 0 0 0 0 0 10\r\n",
"output": "7\r\n"
},
{
"input": "4\r\n0 1 1 0 0 0 0\r\n",
"output": "3\r\n"
},
{
"input": "100\r\n0 0 0 0 0 1 0\r\n",
"output": "6\r\n"
}
] | true
|
stdio
| null | true
|
1650/B
| null |
1650
|
Codeforces Round 776 (Div. 3)
|
ICPC
| 1,646,750,100
| 2,022
|
B
| 2
| 256
|
DIV + MOD
|
Not so long ago, Vlad came up with an interesting function:
- $$$f_a(x)=\left\lfloor\frac{x}{a}\right\rfloor + x \bmod a$$$, where $$$\left\lfloor\frac{x}{a}\right\rfloor$$$ is $$$\frac{x}{a}$$$, rounded down, $$$x \bmod a$$$ β the remainder of the integer division of $$$x$$$ by $$$a$$$.
For example, with $$$a=3$$$ and $$$x=11$$$, the value $$$f_3(11) = \left\lfloor\frac{11}{3}\right\rfloor + 11 \bmod 3 = 3 + 2 = 5$$$.
The number $$$a$$$ is fixed and known to Vlad. Help Vlad find the maximum value of $$$f_a(x)$$$ if $$$x$$$ can take any integer value from $$$l$$$ to $$$r$$$ inclusive ($$$l \le x \le r$$$).
|
The first line of input data contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of input test cases.
This is followed by $$$t$$$ lines, each of which contains three integers $$$l_i$$$, $$$r_i$$$ and $$$a_i$$$ ($$$1 \le l_i \le r_i \le 10^9, 1 \le a_i \le 10^9$$$)Β β the left and right boundaries of the segment and the fixed value of $$$a$$$.
|
For each test case, output one number on a separate lineΒ β the maximum value of the function on a given segment for a given $$$a$$$.
| null |
In the first sample:
- $$$f_3(1) = \left\lfloor\frac{1}{3}\right\rfloor + 1 \bmod 3 = 0 + 1 = 1$$$,
- $$$f_3(2) = \left\lfloor\frac{2}{3}\right\rfloor + 2 \bmod 3 = 0 + 2 = 2$$$,
- $$$f_3(3) = \left\lfloor\frac{3}{3}\right\rfloor + 3 \bmod 3 = 1 + 0 = 1$$$,
- $$$f_3(4) = \left\lfloor\frac{4}{3}\right\rfloor + 4 \bmod 3 = 1 + 1 = 2$$$
As an answer, obviously, $$$f_3(2)$$$ and $$$f_3(4)$$$ are suitable.
|
[
{
"input": "5\n1 4 3\n5 8 4\n6 10 6\n1 1000000000 1000000000\n10 12 8",
"output": "2\n4\n5\n999999999\n5"
}
] |
Consider $$$f_a(r)$$$. Note that $$$\left\lfloor\frac{r}{a}\right\rfloor$$$ is maximal over the entire segment from $$$l$$$ to $$$r$$$, so if there is $$$x$$$ in which $$$f_a$$$ gives a greater result, then $$$x \bmod a > r\bmod a$$$.
Note that numbers from $$$r - r \bmod a$$$ to $$$r$$$ that have an incomplete quotient when divided by $$$a$$$ equal to $$$\left\lfloor\frac{r}{a}\right\rfloor$$$ do not fit this condition (and are guaranteed to have a value $$$f_a$$$ less than $$$f_a(r)$$$). And the number $$$x = r - r \bmod a - 1$$$:
β’ Has the maximum possible remainder $$$x \bmod a = a - 1$$$;
β’ Has the maximum possible $$$\left\lfloor\frac{r}{a}\right\rfloor$$$ among numbers less than $$$r - r\bmod a$$$.
So there are two candidates for the answerΒ β these are $$$r$$$ and $$$r - r \bmod a - 1$$$. The second candidate is suitable only if it is at least $$$l$$$. It remains only to compare the values of $$$f_a$$$ and select the maximum.
| 900
|
[
"math"
] | 9
|
[
{
"input": "5\r\n1 4 3\r\n5 8 4\r\n6 10 6\r\n1 1000000000 1000000000\r\n10 12 8\r\n",
"output": "2\r\n4\r\n5\r\n999999999\r\n5\r\n"
},
{
"input": "1\r\n87 95 696969\r\n",
"output": "95\r\n"
},
{
"input": "1\r\n6 999998 9\r\n",
"output": "111118\r\n"
},
{
"input": "1\r\n1 100 55\r\n",
"output": "54\r\n"
},
{
"input": "3\r\n1 100 54\r\n1 100 55\r\n1 100 56\r\n",
"output": "53\r\n54\r\n55\r\n"
}
] | false
|
stdio
| null | true
|
1471/A
| null |
1471
|
Codeforces Round 694 (Div. 2)
|
CF
| 1,609,857,300
| 2,021
|
A
| 1
| 256
|
Strange Partition
|
You are given an array $$$a$$$ of length $$$n$$$, and an integer $$$x$$$. You can perform the following operation as many times as you would like (possibly zero): replace two adjacent elements of the array by their sum. For example, if the initial array was $$$[3, 6, 9]$$$, in a single operation one can replace the last two elements by their sum, yielding an array $$$[3, 15]$$$, or replace the first two elements to get an array $$$[9, 9]$$$. Note that the size of the array decreases after each operation.
The beauty of an array $$$b=[b_1, \ldots, b_k]$$$ is defined as $$$\sum_{i=1}^k \left\lceil \frac{b_i}{x} \right\rceil$$$, which means that we divide each element by $$$x$$$, round it up to the nearest integer, and sum up the resulting values. For example, if $$$x = 3$$$, and the array is $$$[4, 11, 6]$$$, the beauty of the array is equal to $$$\left\lceil \frac{4}{3} \right\rceil + \left\lceil \frac{11}{3} \right\rceil + \left\lceil \frac{6}{3} \right\rceil = 2 + 4 + 2 = 8$$$.
Please determine the minimum and the maximum beauty you can get by performing some operations on the original array.
|
The first input line contains a single integer $$$t$$$Β β the number of test cases ($$$1 \le t \le 1000$$$).
The first line of each test case contains two integers $$$n$$$ and $$$x$$$ ($$$1 \leq n \leq 10^5$$$, $$$1 \leq x \leq 10^9$$$).
The next line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \leq a_i \leq 10^9$$$), the elements of the array $$$a$$$.
It is guaranteed that the sum of values of $$$n$$$ over all test cases does not exceed $$$10^5$$$.
|
For each test case output two integersΒ β the minimal and the maximal possible beauty.
| null |
In the first test case the beauty of the array does not change if we perform any operations.
In the second example we can leave the array unchanged to attain the maximum beauty, and to get the minimum beauty one can replace two elements $$$4$$$ and $$$11$$$ with their sum, yielding an array $$$[6, 15]$$$, which has its beauty equal to $$$7$$$.
|
[
{
"input": "2\n3 3\n3 6 9\n3 3\n6 4 11",
"output": "6 6\n7 8"
}
] |
Note that, $$$\left\lceil \frac{a + b}{x} \right\rceil \leq \left\lceil \frac{a}{x} \right\rceil + \left\lceil \frac{b}{x} \right\rceil$$$. It means that the maximal sum is attained if we do not apply any operations, and the minimal one is attained if we replace all the element with a single one, equal to the sum of all elements.
| 900
|
[
"greedy",
"math",
"number theory"
] | 24
|
[
{
"input": "2\r\n3 3\r\n3 6 9\r\n3 3\r\n6 4 11\r\n",
"output": "6 6\r\n7 8\r\n"
},
{
"input": "1\r\n10 1\r\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\r\n",
"output": "10000000000 10000000000\r\n"
},
{
"input": "1\r\n20 2\r\n536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912 536870912\r\n",
"output": "5368709120 5368709120\r\n"
},
{
"input": "1\r\n6 1\r\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\r\n",
"output": "6000000000 6000000000\r\n"
},
{
"input": "1\r\n4 2\r\n2 10234 6548 2345\r\n",
"output": "9565 9565\r\n"
},
{
"input": "1\r\n1 1\r\n1\r\n",
"output": "1 1\r\n"
},
{
"input": "1\r\n8 1\r\n100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000\r\n",
"output": "800000000 800000000\r\n"
},
{
"input": "1\r\n4 2\r\n2 10235 6548 2345\r\n",
"output": "9565 9566\r\n"
},
{
"input": "1\r\n20 1\r\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\r\n",
"output": "20000000000 20000000000\r\n"
},
{
"input": "1\r\n1 1234\r\n1\r\n",
"output": "1 1\r\n"
},
{
"input": "1\r\n2 3\r\n1000000000 100000000\r\n",
"output": "366666667 366666668\r\n"
}
] | false
|
stdio
| null | true
|
1969/B
| null |
1969
|
Educational Codeforces Round 165 (Rated for Div. 2)
|
ICPC
| 1,714,401,300
| 2,024
|
B
| 2
| 256
|
Shifts and Sorting
|
Let's define a cyclic shift of some string $$$s$$$ as a transformation from $$$s_1 s_2 \dots s_{n-1} s_{n}$$$ into $$$s_{n} s_1 s_2 \dots s_{n-1}$$$. In other words, you take one last character $$$s_n$$$ and place it before the first character while moving all other characters to the right.
You are given a binary string $$$s$$$ (a string consisting of only 0-s and/or 1-s).
In one operation, you can choose any substring $$$s_l s_{l+1} \dots s_r$$$ ($$$1 \le l < r \le |s|$$$) and cyclically shift it. The cost of such operation is equal to $$$r - l + 1$$$ (or the length of the chosen substring).
You can perform the given operation any number of times. What is the minimum total cost to make $$$s$$$ sorted in non-descending order?
|
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases.
The first and only line of each test case contains a binary string $$$s$$$ ($$$2 \le |s| \le 2 \cdot 10^5$$$; $$$s_i \in$$$ {0, 1})Β β the string you need to sort.
Additional constraint on the input: the sum of lengths of strings over all test cases doesn't exceed $$$2 \cdot 10^5$$$.
|
For each test case, print the single integerΒ β the minimum total cost to make string sorted using operation above any number of times.
| null |
In the first test case, you can choose the whole string and perform a cyclic shift: 10 $$$\rightarrow$$$ 01. The length of the substring is $$$2$$$, so the cost is $$$2$$$.
In the second test case, the string is already sorted, so you don't need to perform any operations.
In the third test case, one of the optimal strategies is the next:
1. choose substring $$$[1, 3]$$$: 11000 $$$\rightarrow$$$ 01100;
2. choose substring $$$[2, 4]$$$: 01100 $$$\rightarrow$$$ 00110;
3. choose substring $$$[3, 5]$$$: 00110 $$$\rightarrow$$$ 00011.
|
[
{
"input": "5\n10\n0000\n11000\n101011\n01101001",
"output": "2\n0\n9\n5\n11"
}
] |
Let's look at the operation as the following: you choose $$$(l, r)$$$, erase the element at position $$$r$$$ and then insert it before the element at position $$$l$$$. We can also interpret the cost of such operation as the following: you pay $$$1$$$ for the element at position $$$r$$$ you "teleport" to the left and $$$1$$$ for each element you teleport through (element inside segment $$$[l, r - 1]$$$).
Now let's look at two indices $$$x < y$$$ where $$$a_x = 1$$$ and $$$a_y = 0$$$. Since at the end, all zeroes should be before ones, you have to move $$$a_y$$$ to the left of $$$a_x$$$. But the only thing that moves to the left is element $$$a_r$$$, so you have to make at least one operation ending at $$$a_y$$$.
What does it mean? It means:
1. for every 0 that has at least one 1 from the left, you have to pay at least $$$1$$$ for teleporting it to the left;
2. for every 1, if there are $$$c$$$ 0-s to the right, you have to pay at least $$$c$$$, since each zero should be teleported through this 1.
The thoughts above gave us the lower bound on the answer, and it's not hard to come up with some constructive algorithms that will give us exactly that cost.
To calculate the lower bound, you just need to maintain some info while iterating from left to right: for example, the number of 0-s and 1-s to the left of the current position and the total number of 0-s in $$$s$$$. It's enough to check: is there any 1 to the left of the current position, and how many 0-s are to the right.
Instead of calculating the lower bound itself, you can also implement one of the algorithms that reach that lower bound, and it may be even a little easier.
| 1,000
|
[
"constructive algorithms",
"greedy"
] | 15
|
[
{
"input": "5\r\n10\r\n0000\r\n11000\r\n101011\r\n01101001\r\n",
"output": "2\r\n0\r\n9\r\n5\r\n11\r\n"
},
{
"input": "2\r\n11111111111111111010101010101111\r\n1111111110\r\n",
"output": "123\r\n10\r\n"
}
] | false
|
stdio
| null | true
|
1515/B
| null |
1515
|
Codeforces Global Round 14
|
CF
| 1,619,966,100
| 2,021
|
B
| 2
| 256
|
Phoenix and Puzzle
|
Phoenix is playing with a new puzzle, which consists of $$$n$$$ identical puzzle pieces. Each puzzle piece is a right isosceles triangle as shown below.
A puzzle piece
The goal of the puzzle is to create a square using the $$$n$$$ pieces. He is allowed to rotate and move the pieces around, but none of them can overlap and all $$$n$$$ pieces must be used (of course, the square shouldn't contain any holes as well). Can he do it?
|
The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases.
The first line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 10^9$$$)Β β the number of puzzle pieces.
|
For each test case, if Phoenix can create a square with the $$$n$$$ puzzle pieces, print YES. Otherwise, print NO.
| null |
For $$$n=2$$$, Phoenix can create a square like this:
For $$$n=4$$$, Phoenix can create a square like this:
For $$$n=6$$$, it is impossible for Phoenix to create a square.
|
[
{
"input": "3\n2\n4\n6",
"output": "YES\nYES\nNO"
}
] |
If $$$n$$$ can be written as $$$2x$$$ or $$$4x$$$, where $$$x$$$ is a square number, then the answer is YES. Otherwise it is NO.
To visualize this construction, we start by first building a smaller square using exactly $$$2$$$ or $$$4$$$ pieces (the drawings are in the sample test explanation). We can just use $$$x$$$ of those smaller squares to build a larger square.
Let's prove that there are no other answers (although this isn't necessary to solve the problem). Let's define each triangle piece to have a short side of length $$$1$$$ and a longer side of length $$$\sqrt{2}$$$. Consider one side of the square, and suppose that it has $$$a$$$ triangles on the short side and $$$b$$$ triangles on the longer side. The side length will be $$$a+\sqrt{2}b$$$. The area of the square is a rational number because the area of each triangle piece is rational. So, $$$(a+\sqrt{2}b)^2$$$ has to be rational, which means either $$$a$$$ is $$$0$$$, or $$$b$$$ is $$$0$$$. If either is $$$0$$$, we can use the construction in the previous paragraph.
Time complexity for each test case: $$$O(\sqrt{n})$$$ or $$$O(\log{n})$$$ (depends on how you check for square numbers)
| 1,000
|
[
"brute force",
"geometry",
"math",
"number theory"
] | 27
|
[
{
"input": "3\r\n2\r\n4\r\n6\r\n",
"output": "YES\r\nYES\r\nNO\r\n"
},
{
"input": "1\r\n999939200\r\n",
"output": "YES\r\n"
},
{
"input": "1\r\n92888450\r\n",
"output": "YES\r\n"
},
{
"input": "1\r\n1458\r\n",
"output": "YES\r\n"
},
{
"input": "1\r\n9060100\r\n",
"output": "YES\r\n"
},
{
"input": "1\r\n500101938\r\n",
"output": "YES\r\n"
},
{
"input": "1\r\n100000001\r\n",
"output": "NO\r\n"
},
{
"input": "1\r\n200040002\r\n",
"output": "YES\r\n"
},
{
"input": "1\r\n200000000\r\n",
"output": "YES\r\n"
},
{
"input": "1\r\n536870913\r\n",
"output": "NO\r\n"
},
{
"input": "3\r\n524304\r\n61032704\r\n61560720\r\n",
"output": "NO\r\nNO\r\nNO\r\n"
},
{
"input": "1\r\n114514\r\n",
"output": "NO\r\n"
},
{
"input": "3\r\n131073\r\n262148\r\n9266\r\n",
"output": "NO\r\nNO\r\nNO\r\n"
}
] | false
|
stdio
| null | true
|
237/A
| null |
237
|
Codeforces Round 147 (Div. 2)
|
CF
| 1,351,179,000
| 2,012
|
A
| 2
| 256
|
Free Cash
|
Valera runs a 24/7 fast food cafe. He magically learned that next day n people will visit his cafe. For each person we know the arrival time: the i-th person comes exactly at hi hours mi minutes. The cafe spends less than a minute to serve each client, but if a client comes in and sees that there is no free cash, than he doesn't want to wait and leaves the cafe immediately.
Valera is very greedy, so he wants to serve all n customers next day (and get more profit). However, for that he needs to ensure that at each moment of time the number of working cashes is no less than the number of clients in the cafe.
Help Valera count the minimum number of cashes to work at his cafe next day, so that they can serve all visitors.
|
The first line contains a single integer n (1 β€ n β€ 105), that is the number of cafe visitors.
Each of the following n lines has two space-separated integers hi and mi (0 β€ hi β€ 23;Β 0 β€ mi β€ 59), representing the time when the i-th person comes into the cafe.
Note that the time is given in the chronological order. All time is given within one 24-hour period.
|
Print a single integer β the minimum number of cashes, needed to serve all clients next day.
| null |
In the first sample it is not enough one cash to serve all clients, because two visitors will come into cafe in 8:10. Therefore, if there will be one cash in cafe, then one customer will be served by it, and another one will not wait and will go away.
In the second sample all visitors will come in different times, so it will be enough one cash.
|
[
{
"input": "4\n8 0\n8 10\n8 10\n8 45",
"output": "2"
},
{
"input": "3\n0 12\n10 11\n22 22",
"output": "1"
}
] | null | 1,000
|
[
"implementation"
] | 67
|
[
{
"input": "4\r\n8 0\r\n8 10\r\n8 10\r\n8 45\r\n",
"output": "2\r\n"
},
{
"input": "3\r\n0 12\r\n10 11\r\n22 22\r\n",
"output": "1\r\n"
},
{
"input": "5\r\n12 8\r\n15 27\r\n15 27\r\n16 2\r\n19 52\r\n",
"output": "2\r\n"
},
{
"input": "7\r\n5 6\r\n7 34\r\n7 34\r\n7 34\r\n12 29\r\n15 19\r\n20 23\r\n",
"output": "3\r\n"
},
{
"input": "8\r\n0 36\r\n4 7\r\n4 7\r\n4 7\r\n11 46\r\n12 4\r\n15 39\r\n18 6\r\n",
"output": "3\r\n"
},
{
"input": "20\r\n4 12\r\n4 21\r\n4 27\r\n4 56\r\n5 55\r\n7 56\r\n11 28\r\n11 36\r\n14 58\r\n15 59\r\n16 8\r\n17 12\r\n17 23\r\n17 23\r\n17 23\r\n17 23\r\n17 23\r\n17 23\r\n20 50\r\n22 32\r\n",
"output": "6\r\n"
},
{
"input": "10\r\n1 30\r\n1 30\r\n1 30\r\n1 30\r\n1 30\r\n1 30\r\n1 30\r\n1 30\r\n1 30\r\n1 30\r\n",
"output": "10\r\n"
},
{
"input": "10\r\n0 39\r\n1 35\r\n1 49\r\n1 51\r\n5 24\r\n7 40\r\n7 56\r\n16 42\r\n23 33\r\n23 49\r\n",
"output": "1\r\n"
},
{
"input": "15\r\n0 16\r\n6 15\r\n8 2\r\n8 6\r\n8 7\r\n10 1\r\n10 1\r\n10 3\r\n10 12\r\n13 5\r\n14 16\r\n14 16\r\n14 16\r\n14 16\r\n14 16\r\n",
"output": "5\r\n"
},
{
"input": "2\r\n0 24\r\n1 0\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n0 0\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n1 5\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n1 1\r\n",
"output": "1\r\n"
},
{
"input": "3\r\n0 0\r\n0 0\r\n0 0\r\n",
"output": "3\r\n"
},
{
"input": "1\r\n5 0\r\n",
"output": "1\r\n"
},
{
"input": "5\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n",
"output": "5\r\n"
},
{
"input": "1\r\n10 10\r\n",
"output": "1\r\n"
},
{
"input": "1\r\n8 0\r\n",
"output": "1\r\n"
},
{
"input": "10\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n0 0\r\n",
"output": "10\r\n"
},
{
"input": "2\r\n0 0\r\n0 1\r\n",
"output": "1\r\n"
},
{
"input": "2\r\n8 5\r\n8 5\r\n",
"output": "2\r\n"
}
] | false
|
stdio
| null | true
|
1796/B
| null |
1796
|
Educational Codeforces Round 144 (Rated for Div. 2)
|
ICPC
| 1,677,594,900
| 2,023
|
B
| 2
| 256
|
Asterisk-Minor Template
|
You are given two strings $$$a$$$ and $$$b$$$, consisting of lowercase Latin letters.
A template $$$t$$$ is string, consisting of lowercase Latin letters and asterisks (character '*'). A template is called asterisk-minor if the number of asterisks in it is less than or equal to the number of letters in it.
A string $$$s$$$ is said to be matching a template $$$t$$$ if you can replace each asterisk in $$$t$$$ with a string of lowercase Latin letters (possibly, an empty string) so that it becomes equal to $$$s$$$.
Find an asterisk-minor template such that both $$$a$$$ and $$$b$$$ match it, or report that such a template doesn't exist. If there are multiple answers, print any of them.
|
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of testcases.
The first line of each testcase contains a string $$$a$$$ ($$$1 \le |a| \le 50$$$, where $$$|a|$$$ is the length of $$$a$$$), consisting of lowercase Latin letters.
The second line contains a string $$$b$$$ ($$$1 \le |b| \le 50$$$), consisting of lowercase Latin letters.
|
For each testcase, output "NO", if there doesn't exist an asterisk-minor template that both $$$a$$$ and $$$b$$$ match. Otherwise, print "YES" in the first line and the template in the second line. If there are multiple answers, print any of them.
A template should consist only of lowercase Latin letters and asterisks (character '*'). The number of asterisks should be less than or equal to the number of letters.
| null |
In the first testcase, for a template "*b", you can replace the only asterisk with "aaa" to get "aaab" (which is equal to $$$a$$$) or with "zzz" to get "zzzb" (which is equal to $$$b$$$).
In the third testcase, a template "*o*" is not asterisk-minor, as it contains more asterisks than letters. There are no asterisk-minor templates that both $$$a$$$ and $$$b$$$ match.
In the fourth testcase, for a template "a*a*a*a", you can replace all asterisks with empty strings to get "aaaa" (which is equal to $$$a$$$) or two of them with "a" and two of them with an empty string to get "aaaaaa" (which is equal to $$$b$$$).
In the fifth testcase, there are no asterisks in a template "abcd", so only "abcd" can match it (which is coincidentally both $$$a$$$ and $$$b$$$).
|
[
{
"input": "6\naaab\nzzzb\ncodeforces\natcoder\ncodeforces\ntokitlx\naaaa\naaaaaa\nabcd\nabcd\nc\nf",
"output": "YES\n*b\nYES\n*co*\nNO\nYES\na*a*a*a\nYES\nabcd\nNO"
}
] |
What's the reason behind authors specifically asking for templates that have less or equal asterisks than letters? Well, without that the problem would be kind of trivial. A template "*" is matched by every string, so it would always work.
Hmm, let's try to make something similar to that template then. We basically have to find some part of that occurs in both strings that we can use letters on to get some freedom to use asterisks.
There are some easy cases. If the first letters of both strings are the same, then the template can be that letter followed by an asterisk. There's a symmetrical case for the last letter.
By studying the examples, you can also notice the final case: a common substring of both strings of length at least two surrounded by two asterisks. Moreover, since we only use two asterisks, we can find a substring of length exactly two (which always exists if a longer common substring exists).
Turns out, that's it. If a template exists, one of these three kinds also exists.
This is not that hard to show. If the first two kinds don't work, then you have to use asterisks on both sides of the template. In order for the template with asterisks on both sides to work, there have to be adjacent letters in it at least once (otherwise, it's like "*a*a*a*", and there are more asterisks than letters). And since at least one such substring exists, we can just remove everything other than this substring and the asterisks on the sides.
Overall complexity: $$$O(|a| \cdot |b|)$$$ per testcase.
| 1,000
|
[
"implementation",
"strings"
] | 12
|
[
{
"input": "6\r\naaab\r\nzzzb\r\ncodeforces\r\natcoder\r\ncodeforces\r\ntokitlx\r\naaaa\r\naaaaaa\r\nabcd\r\nabcd\r\nc\r\nf\r\n",
"output": "YES\r\n*b\r\nYES\r\n*co*\r\nNO\r\nYES\r\na*\r\nYES\r\na*\r\nNO\r\n"
}
] | false
|
stdio
| null | false
|
318/A
| null |
318
|
Codeforces Round 188 (Div. 2)
|
CF
| 1,371,223,800
| 2,013
|
A
| 1
| 256
|
Even Odds
|
Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is positive integer number). He is determined to rearrange them. But there are too many natural numbers, so Volodya decided to start with the first n. He writes down the following sequence of numbers: firstly all odd integers from 1 to n (in ascending order), then all even integers from 1 to n (also in ascending order). Help our hero to find out which number will stand at the position number k.
|
The only line of input contains integers n and k (1 β€ k β€ n β€ 1012).
Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specifier.
|
Print the number that will stand at the position number k after Volodya's manipulations.
| null |
In the first sample Volodya's sequence will look like this: {1, 3, 5, 7, 9, 2, 4, 6, 8, 10}. The third place in the sequence is therefore occupied by the number 5.
|
[
{
"input": "10 3",
"output": "5"
},
{
"input": "7 7",
"output": "6"
}
] | null | 900
|
[
"math"
] | 25
|
[
{
"input": "10 3\r\n",
"output": "5"
},
{
"input": "7 7\r\n",
"output": "6"
},
{
"input": "7 1\r\n",
"output": "1"
},
{
"input": "7 2\r\n",
"output": "3"
},
{
"input": "8 5\r\n",
"output": "2"
},
{
"input": "8 3\r\n",
"output": "5"
},
{
"input": "8 4\r\n",
"output": "7"
},
{
"input": "1000000000000 500000000001\r\n",
"output": "2"
},
{
"input": "999999999997 499999999999\r\n",
"output": "999999999997"
},
{
"input": "999999999999 999999999999\r\n",
"output": "999999999998"
},
{
"input": "1000000000000 1\r\n",
"output": "1"
},
{
"input": "999999999999 1\r\n",
"output": "1"
},
{
"input": "1 1\r\n",
"output": "1"
},
{
"input": "1000000000000 1000000000000\r\n",
"output": "1000000000000"
},
{
"input": "1000000000000 500000000000\r\n",
"output": "999999999999"
},
{
"input": "1000000000000 499999999999\r\n",
"output": "999999999997"
},
{
"input": "999999999997 499999999998\r\n",
"output": "999999999995"
},
{
"input": "619234238 556154835\r\n",
"output": "493075432"
},
{
"input": "38151981 36650624\r\n",
"output": "35149266"
},
{
"input": "680402465 442571217\r\n",
"output": "204739968"
},
{
"input": "109135284 9408714\r\n",
"output": "18817427"
},
{
"input": "603701841 56038951\r\n",
"output": "112077901"
},
{
"input": "356764822 321510177\r\n",
"output": "286255532"
},
{
"input": "284911189 142190783\r\n",
"output": "284381565"
},
{
"input": "91028405 61435545\r\n",
"output": "31842684"
}
] | true
|
stdio
| null | true
|
1166/A
| null |
1166
|
Codeforces Round 561 (Div. 2)
|
CF
| 1,558,105,500
| 2,019
|
A
| 1
| 256
|
Silent Classroom
|
There are $$$n$$$ students in the first grade of Nlogonia high school. The principal wishes to split the students into two classrooms (each student must be in exactly one of the classrooms). Two distinct students whose name starts with the same letter will be chatty if they are put in the same classroom (because they must have a lot in common). Let $$$x$$$ be the number of such pairs of students in a split. Pairs $$$(a, b)$$$ and $$$(b, a)$$$ are the same and counted only once.
For example, if there are $$$6$$$ students: "olivia", "jacob", "tanya", "jack", "oliver" and "jessica", then:
- splitting into two classrooms ("jack", "jacob", "jessica", "tanya") and ("olivia", "oliver") will give $$$x=4$$$ ($$$3$$$ chatting pairs in the first classroom, $$$1$$$ chatting pair in the second classroom),
- splitting into two classrooms ("jack", "tanya", "olivia") and ("jessica", "oliver", "jacob") will give $$$x=1$$$ ($$$0$$$ chatting pairs in the first classroom, $$$1$$$ chatting pair in the second classroom).
You are given the list of the $$$n$$$ names. What is the minimum $$$x$$$ we can obtain by splitting the students into classrooms?
Note that it is valid to place all of the students in one of the classrooms, leaving the other one empty.
|
The first line contains a single integer $$$n$$$ ($$$1\leq n \leq 100$$$)Β β the number of students.
After this $$$n$$$ lines follow.
The $$$i$$$-th line contains the name of the $$$i$$$-th student.
It is guaranteed each name is a string of lowercase English letters of length at most $$$20$$$. Note that multiple students may share the same name.
|
The output must consist of a single integer $$$x$$$Β β the minimum possible number of chatty pairs.
| null |
In the first sample the minimum number of pairs is $$$1$$$. This can be achieved, for example, by putting everyone except jose in one classroom, and jose in the other, so jorge and jerry form the only chatty pair.
In the second sample the minimum number of pairs is $$$2$$$. This can be achieved, for example, by putting kambei, gorobei, shichiroji and kyuzo in one room and putting heihachi, katsushiro and kikuchiyo in the other room. In this case the two pairs are kambei and kyuzo, and katsushiro and kikuchiyo.
In the third sample the minimum number of pairs is $$$4$$$. This can be achieved by placing three of the students named mike in one classroom and the other two students in another classroom. Thus there will be three chatty pairs in one classroom and one chatty pair in the other classroom.
|
[
{
"input": "4\njorge\njose\noscar\njerry",
"output": "1"
},
{
"input": "7\nkambei\ngorobei\nshichiroji\nkyuzo\nheihachi\nkatsushiro\nkikuchiyo",
"output": "2"
},
{
"input": "5\nmike\nmike\nmike\nmike\nmike",
"output": "4"
}
] |
First, note that we can solve the problem for each starting letter independently, because two students whose name starts with a different letter never form a chatty pair.
How do we solve the problem when all the students' names start with the same letter? We claim that it's best to split as evenly as possible. If one classroom has $$$a$$$ students, and the other has $$$b$$$ students with $$$a > b + 1$$$, then by moving one of the students from the first classroom into the second we remove $$$a - 1$$$ chatty pairs from the first classroom and create $$$b$$$ new chatty pairs in the second, for a net result of $$$(a - 1) - b > 0$$$ chatty pairs removed. So in the best splitting we have $$$\vert a - b \vert \leq 1$$$, meaning we split as evenly as possible.
Then, if $$$cnt_a$$$ denotes the number of students whose name starts with $$$a$$$, we will split them into a classroom containing $$$\lfloor \frac{cnt_a}{2} \rfloor$$$ students and one containing $$$\lceil \frac{cnt_a}{2} \rceil$$$ students. So the total number of chatty pairs among students whose name starts with $$$a$$$ is
$$$$$$\binom{\lfloor \frac{cnt_a}{2} \rfloor}{2} + \binom{\lceil \frac{cnt_a}{2} \rceil}{2}$$$$$$
The expression is the same for the other letters in the alphabet, and adding them all up gives us our answer. We can also solve the problem without determining what the best splitting is. If, for each starting letter, we try all the possible number of students to send into the first classroom, and choose the one that gives the minimal $$$x$$$, then we will only have to do $$$\mathcal{O}(n)$$$ checks in total, which is more than fast enough to solve the problem.
Complexity: $$$\mathcal{O}(n)$$$.
| 900
|
[
"combinatorics",
"greedy"
] | 23
|
[
{
"input": "4\r\njorge\r\njose\r\noscar\r\njerry\r\n",
"output": "1\r\n"
},
{
"input": "7\r\nkambei\r\ngorobei\r\nshichiroji\r\nkyuzo\r\nheihachi\r\nkatsushiro\r\nkikuchiyo\r\n",
"output": "2\r\n"
},
{
"input": "5\r\nmike\r\nmike\r\nmike\r\nmike\r\nmike\r\n",
"output": "4\r\n"
},
{
"input": "10\r\nnr\r\nbifiedubnohaektjox\r\nzxghhzkwfpbsmfsrvzry\r\njkv\r\nqppaqotfnqkogvsxyphj\r\ngjewi\r\ndzonunipvwclfwfngx\r\niwu\r\nzafueotqtrbntjy\r\nnvp\r\n",
"output": "0\r\n"
},
{
"input": "1\r\nnrkbi\r\n",
"output": "0\r\n"
},
{
"input": "5\r\nmrkbifiedu\r\nmohaektjox\r\ngxghhzkwfp\r\nmmfsrvzr\r\nmjkvyqppaq\r\n",
"output": "2\r\n"
},
{
"input": "20\r\ngrkbifiedu\r\ngohaektjox\r\nyxghhzkwfp\r\ngmfsrvzr\r\njjkvyqppaq\r\nmfnqko\r\nysxyphjvgj\r\njixdzo\r\nynipv\r\nilfwfngxa\r\ngutza\r\ngeotqtrb\r\ngjytnvppb\r\nmyllmkvnot\r\njafckw\r\njfccigs\r\njwabzf\r\nmjzeoxrui\r\ngctsja\r\nyvxpeybbh\r\n",
"output": "16\r\n"
},
{
"input": "20\r\nmrkbifiedu\r\nmohaektjox\r\ngxghhzkwfp\r\nmmfsrvzr\r\nmjkvyqppaq\r\nmfnqko\r\nmsxyphjvgj\r\nmixdzo\r\nmnipv\r\nglfwfngxa\r\nmutza\r\nmeotqtrb\r\nmjytnvppb\r\ngyllmkvnot\r\ngafckw\r\nmfccigs\r\nmwabzf\r\nmjzeoxrui\r\ngctsja\r\nmvxpeybbh\r\n",
"output": "53\r\n"
},
{
"input": "20\r\ngrkbifiedubnohaektjo\r\nizxghhzkwfpbsmfsrvzr\r\njjkvyqppaqotfnqkogvs\r\ngphjvgjewixdzonunipv\r\nilfwfngxaiwutzafueot\r\nirbntjytnvppbgyyllmk\r\njotpbafckwsufccigskt\r\njbzfmhjzeoxruiebctsj\r\nijvxpeybbhrezjuajkkp\r\njdqriujmuvcvphlcsxfm\r\nykwqjokeljlnyqpirlvp\r\nyhcczukakwarzzloccim\r\nmmygnzejmxmoksmsmnbq\r\ngzewloxwkwjrexgyiuwn\r\niacxcpwuwbvioohpndwm\r\nimkqihzucgjorhpukjjg\r\nmppnjejitmrbcckatznf\r\nmvqcunhdhjierflnmwld\r\njxoemcuqxabbzeqhlizr\r\nyscbwlaumgkbkpsxenpz\r\n",
"output": "13\r\n"
},
{
"input": "20\r\nnrkbifiedubnohaekt\r\noxyzxghhzkwfpbsm\r\nsrvzrywjkvyqppaqot\r\nnqkogvsxyphjvgje\r\nixdzonunipvwcl\r\nwfngxaiwutzaf\r\neotqtrbntjytnvpp\r\ngyyllmkvnotpbafc\r\nwsufccigsktwabzfmh\r\nzeoxruiebctsjal\r\nvxpeybbhrezjuajkkp\r\nedqriujmuvc\r\nphlcsxfmrikw\r\njokeljlnyq\r\nirlvpahhcczukakwarzz\r\noccimzwmygnzejmxmo\r\nsmsmnbqmozewloxwk\r\njrexgyiuwntaacxc\r\nwuwbvioohpndwmnfmk\r\nihzucgjorhpukjj\r\n",
"output": "2\r\n"
},
{
"input": "100\r\nm\r\ng\r\nm\r\nm\r\nm\r\ng\r\ng\r\nm\r\ng\r\nm\r\ng\r\ng\r\ng\r\nm\r\ng\r\ng\r\ng\r\nm\r\nm\r\nm\r\ng\r\nm\r\ng\r\ng\r\ng\r\nm\r\ng\r\ng\r\ng\r\ng\r\nm\r\ng\r\ng\r\nm\r\ng\r\ng\r\nm\r\nm\r\ng\r\nm\r\nm\r\nm\r\ng\r\ng\r\ng\r\ng\r\nm\r\nm\r\nm\r\nm\r\nm\r\ng\r\ng\r\ng\r\nm\r\nm\r\nm\r\nm\r\ng\r\ng\r\ng\r\nm\r\ng\r\nm\r\nm\r\ng\r\ng\r\ng\r\nm\r\ng\r\ng\r\ng\r\ng\r\nm\r\ng\r\ng\r\nm\r\ng\r\ng\r\ng\r\nm\r\ng\r\nm\r\nm\r\nm\r\nm\r\ng\r\ng\r\ng\r\ng\r\ng\r\nm\r\nm\r\ng\r\ng\r\nm\r\ng\r\nm\r\nm\r\nm\r\n",
"output": "1213\r\n"
},
{
"input": "6\r\nyou\r\nare\r\na\r\nvery\r\ncurious\r\nindividual\r\n",
"output": "0\r\n"
}
] | false
|
stdio
| null | true
|
End of preview.
README.md exists but content is empty.
- Downloads last month
- 20