problem stringlengths 20 3.95k | answer stringclasses 532
values | task stringclasses 6
values | problem_number int64 1 1.31k | set_number int64 1 5 |
|---|---|---|---|---|
You are given a grid with N rows and N columns. An integer A_{i, j} is written on the square at the i-th row from the top and j-th column from the left. Here, it is guaranteed that A_{i,j} is either 0 or 1.
Shift the integers written on the outer squares clockwise by one square each, and print the resulting grid.
Her... | LiveCodeBench | 1,033 | 1 | |
You are given a grid with N rows and N columns. An integer A_{i, j} is written on the square at the i-th row from the top and j-th column from the left. Here, it is guaranteed that A_{i,j} is either 0 or 1.
Shift the integers written on the outer squares clockwise by one square each, and print the resulting grid.
Her... | LiveCodeBench | 1,033 | 2 | |
You are given a grid with N rows and N columns. An integer A_{i, j} is written on the square at the i-th row from the top and j-th column from the left. Here, it is guaranteed that A_{i,j} is either 0 or 1.
Shift the integers written on the outer squares clockwise by one square each, and print the resulting grid.
Her... | LiveCodeBench | 1,033 | 3 | |
Snuke the doctor prescribed N kinds of medicine for Takahashi. For the next a_i days (including the day of the prescription), he has to take b_i pills of the i-th medicine. He does not have to take any other medicine.
Let the day of the prescription be day 1. On or after day 1, when is the first day on which he has ... | LiveCodeBench | 1,034 | 1 | |
Snuke the doctor prescribed N kinds of medicine for Takahashi. For the next a_i days (including the day of the prescription), he has to take b_i pills of the i-th medicine. He does not have to take any other medicine.
Let the day of the prescription be day 1. On or after day 1, when is the first day on which he has ... | LiveCodeBench | 1,034 | 2 | |
Snuke the doctor prescribed N kinds of medicine for Takahashi. For the next a_i days (including the day of the prescription), he has to take b_i pills of the i-th medicine. He does not have to take any other medicine.
Let the day of the prescription be day 1. On or after day 1, when is the first day on which he has ... | LiveCodeBench | 1,034 | 3 | |
We have an undirected graph with (N_1+N_2) vertices and M edges. For i=1,2,\ldots,M, the i-th edge connects vertex a_i and vertex b_i.
The following properties are guaranteed:
- Vertex u and vertex v are connected, for all integers u and v with 1 \leq u,v \leq N_1.
- Vertex u and vertex v are connected, for all inte... | LiveCodeBench | 1,035 | 1 | |
We have an undirected graph with (N_1+N_2) vertices and M edges. For i=1,2,\ldots,M, the i-th edge connects vertex a_i and vertex b_i.
The following properties are guaranteed:
- Vertex u and vertex v are connected, for all integers u and v with 1 \leq u,v \leq N_1.
- Vertex u and vertex v are connected, for all inte... | LiveCodeBench | 1,035 | 2 | |
We have an undirected graph with (N_1+N_2) vertices and M edges. For i=1,2,\ldots,M, the i-th edge connects vertex a_i and vertex b_i.
The following properties are guaranteed:
- Vertex u and vertex v are connected, for all integers u and v with 1 \leq u,v \leq N_1.
- Vertex u and vertex v are connected, for all inte... | LiveCodeBench | 1,035 | 3 | |
There is a family consisting of person 1, person 2, \ldots, and person N. For i\geq 2, person i's parent is person p_i.
They bought insurance M times. For i=1,2,\ldots,M, person x_i bought the i-th insurance, which covers that person and their descendants in the next y_i generations.
How many people are covered by ... | LiveCodeBench | 1,036 | 1 | |
There is a family consisting of person 1, person 2, \ldots, and person N. For i\geq 2, person i's parent is person p_i.
They bought insurance M times. For i=1,2,\ldots,M, person x_i bought the i-th insurance, which covers that person and their descendants in the next y_i generations.
How many people are covered by ... | LiveCodeBench | 1,036 | 2 | |
There is a family consisting of person 1, person 2, \ldots, and person N. For i\geq 2, person i's parent is person p_i.
They bought insurance M times. For i=1,2,\ldots,M, person x_i bought the i-th insurance, which covers that person and their descendants in the next y_i generations.
How many people are covered by ... | LiveCodeBench | 1,036 | 3 | |
Takahashi wants a beverage called AtCoder Drink in a restaurant.
It can be ordered at a regular price of P yen.
He also has a discount coupon that allows him to order it at a lower price of Q yen.
However, he must additionally order one of the restaurant's N dishes to use that coupon.
For each i = 1, 2, \ldots, N, t... | LiveCodeBench | 1,037 | 1 | |
Takahashi wants a beverage called AtCoder Drink in a restaurant.
It can be ordered at a regular price of P yen.
He also has a discount coupon that allows him to order it at a lower price of Q yen.
However, he must additionally order one of the restaurant's N dishes to use that coupon.
For each i = 1, 2, \ldots, N, t... | LiveCodeBench | 1,037 | 2 | |
Takahashi wants a beverage called AtCoder Drink in a restaurant.
It can be ordered at a regular price of P yen.
He also has a discount coupon that allows him to order it at a lower price of Q yen.
However, he must additionally order one of the restaurant's N dishes to use that coupon.
For each i = 1, 2, \ldots, N, t... | LiveCodeBench | 1,037 | 3 | |
AtCoder Shop has N products.
The price of the i-th product (1\leq i\leq N) is P _ i.
The i-th product (1\leq i\leq N) has C_i functions. The j-th function (1\leq j\leq C _ i) of the i-th product (1\leq i\leq N) is represented as an integer F _ {i,j} between 1 and M, inclusive.
Takahashi wonders whether there is a pro... | LiveCodeBench | 1,038 | 1 | |
AtCoder Shop has N products.
The price of the i-th product (1\leq i\leq N) is P _ i.
The i-th product (1\leq i\leq N) has C_i functions. The j-th function (1\leq j\leq C _ i) of the i-th product (1\leq i\leq N) is represented as an integer F _ {i,j} between 1 and M, inclusive.
Takahashi wonders whether there is a pro... | LiveCodeBench | 1,038 | 2 | |
AtCoder Shop has N products.
The price of the i-th product (1\leq i\leq N) is P _ i.
The i-th product (1\leq i\leq N) has C_i functions. The j-th function (1\leq j\leq C _ i) of the i-th product (1\leq i\leq N) is represented as an integer F _ {i,j} between 1 and M, inclusive.
Takahashi wonders whether there is a pro... | LiveCodeBench | 1,038 | 3 | |
There are N sticks with several balls stuck onto them. Each ball has a lowercase English letter written on it.
For each i = 1, 2, \ldots, N, the letters written on the balls stuck onto the i-th stick are represented by a string S_i.
Specifically, the number of balls stuck onto the i-th stick is the length |S_i| of the... | LiveCodeBench | 1,039 | 1 | |
There are N sticks with several balls stuck onto them. Each ball has a lowercase English letter written on it.
For each i = 1, 2, \ldots, N, the letters written on the balls stuck onto the i-th stick are represented by a string S_i.
Specifically, the number of balls stuck onto the i-th stick is the length |S_i| of the... | LiveCodeBench | 1,039 | 2 | |
There are N sticks with several balls stuck onto them. Each ball has a lowercase English letter written on it.
For each i = 1, 2, \ldots, N, the letters written on the balls stuck onto the i-th stick are represented by a string S_i.
Specifically, the number of balls stuck onto the i-th stick is the length |S_i| of the... | LiveCodeBench | 1,039 | 3 | |
There are N sports players.
Among them, there are M incompatible pairs. The i-th incompatible pair (1\leq i\leq M) is the A_i-th and B_i-th players.
You will divide the players into T teams.
Every player must belong to exactly one team, and every team must have one or more players.
Additionally, for each i=1,2,\ldots... | LiveCodeBench | 1,040 | 1 | |
There are N sports players.
Among them, there are M incompatible pairs. The i-th incompatible pair (1\leq i\leq M) is the A_i-th and B_i-th players.
You will divide the players into T teams.
Every player must belong to exactly one team, and every team must have one or more players.
Additionally, for each i=1,2,\ldots... | LiveCodeBench | 1,040 | 2 | |
There are N sports players.
Among them, there are M incompatible pairs. The i-th incompatible pair (1\leq i\leq M) is the A_i-th and B_i-th players.
You will divide the players into T teams.
Every player must belong to exactly one team, and every team must have one or more players.
Additionally, for each i=1,2,\ldots... | LiveCodeBench | 1,040 | 3 | |
You are given a string S of length N consisting of 0 and 1.
It describes a length-N sequence A=(A _ 1,A _ 2,\ldots,A _ N). If the i-th character of S (1\leq i\leq N) is 0, then A _ i=0; if it is 1, then A _ i=1.
Find the following:
\[\sum _ {1\leq i\leq j\leq N}(\cdots((A _ i\barwedge A _ {i+1})\barwedge A _ {i+2})\ba... | LiveCodeBench | 1,041 | 1 | |
You are given a string S of length N consisting of 0 and 1.
It describes a length-N sequence A=(A _ 1,A _ 2,\ldots,A _ N). If the i-th character of S (1\leq i\leq N) is 0, then A _ i=0; if it is 1, then A _ i=1.
Find the following:
\[\sum _ {1\leq i\leq j\leq N}(\cdots((A _ i\barwedge A _ {i+1})\barwedge A _ {i+2})\ba... | LiveCodeBench | 1,041 | 2 | |
You are given a string S of length N consisting of 0 and 1.
It describes a length-N sequence A=(A _ 1,A _ 2,\ldots,A _ N). If the i-th character of S (1\leq i\leq N) is 0, then A _ i=0; if it is 1, then A _ i=1.
Find the following:
\[\sum _ {1\leq i\leq j\leq N}(\cdots((A _ i\barwedge A _ {i+1})\barwedge A _ {i+2})\ba... | LiveCodeBench | 1,041 | 3 | |
We have N dice.
For each i = 1, 2, \ldots, N, when the i-th die is thrown, it shows a random integer between 1 and A_i, inclusive, with equal probability.
Find the probability, modulo 998244353, that the following condition is satisfied when the N dice are thrown simultaneously.
There is a way to choose some (possibl... | LiveCodeBench | 1,042 | 1 | |
We have N dice.
For each i = 1, 2, \ldots, N, when the i-th die is thrown, it shows a random integer between 1 and A_i, inclusive, with equal probability.
Find the probability, modulo 998244353, that the following condition is satisfied when the N dice are thrown simultaneously.
There is a way to choose some (possibl... | LiveCodeBench | 1,042 | 2 | |
We have N dice.
For each i = 1, 2, \ldots, N, when the i-th die is thrown, it shows a random integer between 1 and A_i, inclusive, with equal probability.
Find the probability, modulo 998244353, that the following condition is satisfied when the N dice are thrown simultaneously.
There is a way to choose some (possibl... | LiveCodeBench | 1,042 | 3 | |
You are given a string S consisting of A, B, and C. S is guaranteed to contain all of A, B, and C.
If the characters of S are checked one by one from the left, how many characters will have been checked when the following condition is satisfied for the first time?
- All of A, B, and C have appeared at least once.
Inp... | LiveCodeBench | 1,043 | 1 | |
You are given a string S consisting of A, B, and C. S is guaranteed to contain all of A, B, and C.
If the characters of S are checked one by one from the left, how many characters will have been checked when the following condition is satisfied for the first time?
- All of A, B, and C have appeared at least once.
Inp... | LiveCodeBench | 1,043 | 2 | |
You are given a string S consisting of A, B, and C. S is guaranteed to contain all of A, B, and C.
If the characters of S are checked one by one from the left, how many characters will have been checked when the following condition is satisfied for the first time?
- All of A, B, and C have appeared at least once.
Inp... | LiveCodeBench | 1,043 | 3 | |
There are N people numbered 1 to N.
You are given their schedule for the following D days. The schedule for person i is represented by a string S_i of length D. If the j-th character of S_i is o, person i is free on the j-th day; if it is x, they are occupied that day.
From these D days, consider choosing some consecu... | LiveCodeBench | 1,044 | 1 | |
There are N people numbered 1 to N.
You are given their schedule for the following D days. The schedule for person i is represented by a string S_i of length D. If the j-th character of S_i is o, person i is free on the j-th day; if it is x, they are occupied that day.
From these D days, consider choosing some consecu... | LiveCodeBench | 1,044 | 2 | |
There are N people numbered 1 to N.
You are given their schedule for the following D days. The schedule for person i is represented by a string S_i of length D. If the j-th character of S_i is o, person i is free on the j-th day; if it is x, they are occupied that day.
From these D days, consider choosing some consecu... | LiveCodeBench | 1,044 | 3 | |
There is a directed graph with N vertices and N edges.
The i-th edge goes from vertex i to vertex A_i. (The constraints guarantee that i \neq A_i.)
Find a directed cycle without the same vertex appearing multiple times.
It can be shown that a solution exists under the constraints of this problem.
Notes
The sequence ... | LiveCodeBench | 1,045 | 1 | |
There is a directed graph with N vertices and N edges.
The i-th edge goes from vertex i to vertex A_i. (The constraints guarantee that i \neq A_i.)
Find a directed cycle without the same vertex appearing multiple times.
It can be shown that a solution exists under the constraints of this problem.
Notes
The sequence ... | LiveCodeBench | 1,045 | 2 | |
There is a directed graph with N vertices and N edges.
The i-th edge goes from vertex i to vertex A_i. (The constraints guarantee that i \neq A_i.)
Find a directed cycle without the same vertex appearing multiple times.
It can be shown that a solution exists under the constraints of this problem.
Notes
The sequence ... | LiveCodeBench | 1,045 | 3 | |
There is an N \times M grid and a player standing on it.
Let (i,j) denote the square at the i-th row from the top and j-th column from the left of this grid.
Each square of this grid is ice or rock, which is represented by N strings S_1,S_2,\dots,S_N of length M as follows:
- if the j-th character of S_i is ., squar... | LiveCodeBench | 1,046 | 1 | |
There is an N \times M grid and a player standing on it.
Let (i,j) denote the square at the i-th row from the top and j-th column from the left of this grid.
Each square of this grid is ice or rock, which is represented by N strings S_1,S_2,\dots,S_N of length M as follows:
- if the j-th character of S_i is ., squar... | LiveCodeBench | 1,046 | 2 | |
There is an N \times M grid and a player standing on it.
Let (i,j) denote the square at the i-th row from the top and j-th column from the left of this grid.
Each square of this grid is ice or rock, which is represented by N strings S_1,S_2,\dots,S_N of length M as follows:
- if the j-th character of S_i is ., squar... | LiveCodeBench | 1,046 | 3 | |
There is a grid with H rows and W columns. Let (i, j) denote the square at the i-th row from the top and j-th column from the left of the grid.
Each square of the grid is holed or not. There are exactly N holed squares: (a_1, b_1), (a_2, b_2), \dots, (a_N, b_N).
When the triple of positive integers (i, j, n) satisfies... | LiveCodeBench | 1,047 | 1 | |
There is a grid with H rows and W columns. Let (i, j) denote the square at the i-th row from the top and j-th column from the left of the grid.
Each square of the grid is holed or not. There are exactly N holed squares: (a_1, b_1), (a_2, b_2), \dots, (a_N, b_N).
When the triple of positive integers (i, j, n) satisfies... | LiveCodeBench | 1,047 | 2 | |
There is a grid with H rows and W columns. Let (i, j) denote the square at the i-th row from the top and j-th column from the left of the grid.
Each square of the grid is holed or not. There are exactly N holed squares: (a_1, b_1), (a_2, b_2), \dots, (a_N, b_N).
When the triple of positive integers (i, j, n) satisfies... | LiveCodeBench | 1,047 | 3 | |
Given a length-3 string S consisting of uppercase English letters, print Yes if S equals one of ACE, BDF, CEG, DFA, EGB, FAC, and GBD; print No otherwise.
Input
The input is given from Standard Input in the following format:
S
Output
Print Yes if S equals one of ACE, BDF, CEG, DFA, EGB, FAC, and GBD; print No other... | LiveCodeBench | 1,048 | 1 | |
Given a length-3 string S consisting of uppercase English letters, print Yes if S equals one of ACE, BDF, CEG, DFA, EGB, FAC, and GBD; print No otherwise.
Input
The input is given from Standard Input in the following format:
S
Output
Print Yes if S equals one of ACE, BDF, CEG, DFA, EGB, FAC, and GBD; print No other... | LiveCodeBench | 1,048 | 2 | |
Given a length-3 string S consisting of uppercase English letters, print Yes if S equals one of ACE, BDF, CEG, DFA, EGB, FAC, and GBD; print No otherwise.
Input
The input is given from Standard Input in the following format:
S
Output
Print Yes if S equals one of ACE, BDF, CEG, DFA, EGB, FAC, and GBD; print No other... | LiveCodeBench | 1,048 | 3 | |
Takahashi invented Tak Code, a two-dimensional code. A TaK Code satisfies all of the following conditions:
- It is a region consisting of nine horizontal rows and nine vertical columns.
- All the 18 cells in the top-left and bottom-right three-by-three regions are black.
- All the 14 cells that are adjacent (horizont... | LiveCodeBench | 1,049 | 1 | |
Takahashi invented Tak Code, a two-dimensional code. A TaK Code satisfies all of the following conditions:
- It is a region consisting of nine horizontal rows and nine vertical columns.
- All the 18 cells in the top-left and bottom-right three-by-three regions are black.
- All the 14 cells that are adjacent (horizont... | LiveCodeBench | 1,049 | 2 | |
Takahashi invented Tak Code, a two-dimensional code. A TaK Code satisfies all of the following conditions:
- It is a region consisting of nine horizontal rows and nine vertical columns.
- All the 18 cells in the top-left and bottom-right three-by-three regions are black.
- All the 14 cells that are adjacent (horizont... | LiveCodeBench | 1,049 | 3 | |
There are N sellers and M buyers in an apple market.
The i-th seller may sell an apple for A_i yen or more (yen is the currency in Japan).
The i-th buyer may buy an apple for B_i yen or less.
Find the minimum integer X that satisfies the following condition.
Condition: The number of people who may sell an apple for X y... | LiveCodeBench | 1,050 | 1 | |
There are N sellers and M buyers in an apple market.
The i-th seller may sell an apple for A_i yen or more (yen is the currency in Japan).
The i-th buyer may buy an apple for B_i yen or less.
Find the minimum integer X that satisfies the following condition.
Condition: The number of people who may sell an apple for X y... | LiveCodeBench | 1,050 | 2 | |
There are N sellers and M buyers in an apple market.
The i-th seller may sell an apple for A_i yen or more (yen is the currency in Japan).
The i-th buyer may buy an apple for B_i yen or less.
Find the minimum integer X that satisfies the following condition.
Condition: The number of people who may sell an apple for X y... | LiveCodeBench | 1,050 | 3 | |
You are given a non-empty string S consisting of (, ), and ?.
There are 2^x ways to obtain a new string by replacing each ? in S with ( and ), where x is the number of occurrences of ? in S. Among them, find the number, modulo 998244353, of ways that yield a parenthesis string.
A string is said to be a parenthesis st... | LiveCodeBench | 1,051 | 1 | |
You are given a non-empty string S consisting of (, ), and ?.
There are 2^x ways to obtain a new string by replacing each ? in S with ( and ), where x is the number of occurrences of ? in S. Among them, find the number, modulo 998244353, of ways that yield a parenthesis string.
A string is said to be a parenthesis st... | LiveCodeBench | 1,051 | 2 | |
You are given a non-empty string S consisting of (, ), and ?.
There are 2^x ways to obtain a new string by replacing each ? in S with ( and ), where x is the number of occurrences of ? in S. Among them, find the number, modulo 998244353, of ways that yield a parenthesis string.
A string is said to be a parenthesis st... | LiveCodeBench | 1,051 | 3 | |
There are N rectangular cuboids in a three-dimensional space.
These cuboids do not overlap. Formally, for any two different cuboids among them, their intersection has a volume of 0.
The diagonal of the i-th cuboid is a segment that connects two points (X_{i,1},Y_{i,1},Z_{i,1}) and (X_{i,2},Y_{i,2},Z_{i,2}), and its ed... | LiveCodeBench | 1,052 | 1 | |
There are N rectangular cuboids in a three-dimensional space.
These cuboids do not overlap. Formally, for any two different cuboids among them, their intersection has a volume of 0.
The diagonal of the i-th cuboid is a segment that connects two points (X_{i,1},Y_{i,1},Z_{i,1}) and (X_{i,2},Y_{i,2},Z_{i,2}), and its ed... | LiveCodeBench | 1,052 | 2 | |
There are N rectangular cuboids in a three-dimensional space.
These cuboids do not overlap. Formally, for any two different cuboids among them, their intersection has a volume of 0.
The diagonal of the i-th cuboid is a segment that connects two points (X_{i,1},Y_{i,1},Z_{i,1}) and (X_{i,2},Y_{i,2},Z_{i,2}), and its ed... | LiveCodeBench | 1,052 | 3 | |
There are N items.
Each of these is one of a pull-tab can, a regular can, or a can opener.
The i-th item is described by an integer pair (T_i, X_i) as follows:
- If T_i = 0, the i-th item is a pull-tab can; if you obtain it, you get a happiness of X_i.
- If T_i = 1, the i-th item is a regular can; if you obtain it... | LiveCodeBench | 1,053 | 1 | |
There are N items.
Each of these is one of a pull-tab can, a regular can, or a can opener.
The i-th item is described by an integer pair (T_i, X_i) as follows:
- If T_i = 0, the i-th item is a pull-tab can; if you obtain it, you get a happiness of X_i.
- If T_i = 1, the i-th item is a regular can; if you obtain it... | LiveCodeBench | 1,053 | 2 | |
There are N items.
Each of these is one of a pull-tab can, a regular can, or a can opener.
The i-th item is described by an integer pair (T_i, X_i) as follows:
- If T_i = 0, the i-th item is a pull-tab can; if you obtain it, you get a happiness of X_i.
- If T_i = 1, the i-th item is a regular can; if you obtain it... | LiveCodeBench | 1,053 | 3 | |
There are N people numbered 1 through N.
Each person has a integer score called programming ability; person i's programming ability is P_i points.
How many more points does person 1 need, so that person 1 becomes the strongest?
In other words, what is the minimum non-negative integer x such that P_1 + x > P_i for all i... | LiveCodeBench | 1,054 | 1 | |
There are N people numbered 1 through N.
Each person has a integer score called programming ability; person i's programming ability is P_i points.
How many more points does person 1 need, so that person 1 becomes the strongest?
In other words, what is the minimum non-negative integer x such that P_1 + x > P_i for all i... | LiveCodeBench | 1,054 | 2 | |
There are N people numbered 1 through N.
Each person has a integer score called programming ability; person i's programming ability is P_i points.
How many more points does person 1 need, so that person 1 becomes the strongest?
In other words, what is the minimum non-negative integer x such that P_1 + x > P_i for all i... | LiveCodeBench | 1,054 | 3 | |
There are N competitive programmers numbered person 1, person 2, \ldots, and person N.
There is a relation called superiority between the programmers. For all pairs of distinct programmers (person X, person Y), exactly one of the following two relations holds: "person X is stronger than person Y" or "person Y is stron... | LiveCodeBench | 1,055 | 1 | |
There are N competitive programmers numbered person 1, person 2, \ldots, and person N.
There is a relation called superiority between the programmers. For all pairs of distinct programmers (person X, person Y), exactly one of the following two relations holds: "person X is stronger than person Y" or "person Y is stron... | LiveCodeBench | 1,055 | 2 | |
There are N competitive programmers numbered person 1, person 2, \ldots, and person N.
There is a relation called superiority between the programmers. For all pairs of distinct programmers (person X, person Y), exactly one of the following two relations holds: "person X is stronger than person Y" or "person Y is stron... | LiveCodeBench | 1,055 | 3 | |
You are given an integer sequence A=(A_1,A_2,\dots,A_N).
You can perform the following operation any number of times (possibly zero).
- Choose integers i and j with 1\leq i,j \leq N. Decrease A_i by one and increase A_j by one.
Find the minimum number of operations required to make the difference between the minimu... | LiveCodeBench | 1,056 | 1 | |
You are given an integer sequence A=(A_1,A_2,\dots,A_N).
You can perform the following operation any number of times (possibly zero).
- Choose integers i and j with 1\leq i,j \leq N. Decrease A_i by one and increase A_j by one.
Find the minimum number of operations required to make the difference between the minimu... | LiveCodeBench | 1,056 | 2 | |
You are given an integer sequence A=(A_1,A_2,\dots,A_N).
You can perform the following operation any number of times (possibly zero).
- Choose integers i and j with 1\leq i,j \leq N. Decrease A_i by one and increase A_j by one.
Find the minimum number of operations required to make the difference between the minimu... | LiveCodeBench | 1,056 | 3 | |
The number pi to the 100-th decimal place is
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679.
You are given an integer N between 1 and 100, inclusive.
Print the value of pi to the N-th decimal place.
More precisely, truncate the value of pi to N decimal places and ... | LiveCodeBench | 1,057 | 1 | |
The number pi to the 100-th decimal place is
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679.
You are given an integer N between 1 and 100, inclusive.
Print the value of pi to the N-th decimal place.
More precisely, truncate the value of pi to N decimal places and ... | LiveCodeBench | 1,057 | 2 | |
The number pi to the 100-th decimal place is
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679.
You are given an integer N between 1 and 100, inclusive.
Print the value of pi to the N-th decimal place.
More precisely, truncate the value of pi to N decimal places and ... | LiveCodeBench | 1,057 | 3 | |
N people, person 1, person 2, \ldots, person N, are playing roulette.
The outcome of a spin is one of the 37 integers from 0 to 36.
For each i = 1, 2, \ldots, N, person i has bet on C_i of the 37 possible outcomes: A_{i, 1}, A_{i, 2}, \ldots, A_{i, C_i}.
The wheel has been spun, and the outcome is X.
Print the numbe... | LiveCodeBench | 1,058 | 1 | |
N people, person 1, person 2, \ldots, person N, are playing roulette.
The outcome of a spin is one of the 37 integers from 0 to 36.
For each i = 1, 2, \ldots, N, person i has bet on C_i of the 37 possible outcomes: A_{i, 1}, A_{i, 2}, \ldots, A_{i, C_i}.
The wheel has been spun, and the outcome is X.
Print the numbe... | LiveCodeBench | 1,058 | 2 | |
N people, person 1, person 2, \ldots, person N, are playing roulette.
The outcome of a spin is one of the 37 integers from 0 to 36.
For each i = 1, 2, \ldots, N, person i has bet on C_i of the 37 possible outcomes: A_{i, 1}, A_{i, 2}, \ldots, A_{i, C_i}.
The wheel has been spun, and the outcome is X.
Print the numbe... | LiveCodeBench | 1,058 | 3 | |
You are given a string S of length N consisting of lowercase English letters.
Each character of S is painted in one of the M colors: color 1, color 2, ..., color M; for each i = 1, 2, \ldots, N, the i-th character of S is painted in color C_i.
For each i = 1, 2, \ldots, M in this order, let us perform the following ope... | LiveCodeBench | 1,059 | 1 | |
You are given a string S of length N consisting of lowercase English letters.
Each character of S is painted in one of the M colors: color 1, color 2, ..., color M; for each i = 1, 2, \ldots, N, the i-th character of S is painted in color C_i.
For each i = 1, 2, \ldots, M in this order, let us perform the following ope... | LiveCodeBench | 1,059 | 2 | |
You are given a string S of length N consisting of lowercase English letters.
Each character of S is painted in one of the M colors: color 1, color 2, ..., color M; for each i = 1, 2, \ldots, N, the i-th character of S is painted in color C_i.
For each i = 1, 2, \ldots, M in this order, let us perform the following ope... | LiveCodeBench | 1,059 | 3 | |
You are given a string S of length N consisting of uppercase and lowercase English letters.
Let us perform Q operations on the string S.
The i-th operation (1\leq i\leq Q) is represented by a tuple (t _ i,x _ i,c _ i) of two integers and one character, as follows.
- If t _ i=1, change the x _ i-th character of S to c ... | LiveCodeBench | 1,060 | 1 | |
You are given a string S of length N consisting of uppercase and lowercase English letters.
Let us perform Q operations on the string S.
The i-th operation (1\leq i\leq Q) is represented by a tuple (t _ i,x _ i,c _ i) of two integers and one character, as follows.
- If t _ i=1, change the x _ i-th character of S to c ... | LiveCodeBench | 1,060 | 2 | |
You are given a string S of length N consisting of uppercase and lowercase English letters.
Let us perform Q operations on the string S.
The i-th operation (1\leq i\leq Q) is represented by a tuple (t _ i,x _ i,c _ i) of two integers and one character, as follows.
- If t _ i=1, change the x _ i-th character of S to c ... | LiveCodeBench | 1,060 | 3 | |
There are N roulette wheels.
The i-th (1\leq i\leq N) wheel has P _ i integers S _ {i,1},S _ {i,2},\ldots,S _ {i,P _ i} written on it, and you can play it once by paying C _ i yen.
When you play the i-th wheel once, an integer j between 1 and P _ i, inclusive, is chosen uniformly at random, and you earn S _ {i,j} point... | LiveCodeBench | 1,061 | 1 | |
There are N roulette wheels.
The i-th (1\leq i\leq N) wheel has P _ i integers S _ {i,1},S _ {i,2},\ldots,S _ {i,P _ i} written on it, and you can play it once by paying C _ i yen.
When you play the i-th wheel once, an integer j between 1 and P _ i, inclusive, is chosen uniformly at random, and you earn S _ {i,j} point... | LiveCodeBench | 1,061 | 2 | |
There are N roulette wheels.
The i-th (1\leq i\leq N) wheel has P _ i integers S _ {i,1},S _ {i,2},\ldots,S _ {i,P _ i} written on it, and you can play it once by paying C _ i yen.
When you play the i-th wheel once, an integer j between 1 and P _ i, inclusive, is chosen uniformly at random, and you earn S _ {i,j} point... | LiveCodeBench | 1,061 | 3 | |
N players, player 1, player 2, ..., player N, participate in a game tournament. Just before the tournament starts, each player forms a one-person team, so there are N teams in total.
The tournament has a total of N-1 matches. In each match, two different teams are chosen. One team goes first, and the other goes second.... | LiveCodeBench | 1,062 | 1 | |
N players, player 1, player 2, ..., player N, participate in a game tournament. Just before the tournament starts, each player forms a one-person team, so there are N teams in total.
The tournament has a total of N-1 matches. In each match, two different teams are chosen. One team goes first, and the other goes second.... | LiveCodeBench | 1,062 | 2 | |
N players, player 1, player 2, ..., player N, participate in a game tournament. Just before the tournament starts, each player forms a one-person team, so there are N teams in total.
The tournament has a total of N-1 matches. In each match, two different teams are chosen. One team goes first, and the other goes second.... | LiveCodeBench | 1,062 | 3 | |
You are given a string S consisting of lowercase English letters.
Remove all occurrences of a, e, i, o, u from S and print the resulting string.
S contains at least one character other than a, e, i, o, u.
Input
The input is given from Standard Input in the following format:
S
Output
Print the answer.
Constraints
... | LiveCodeBench | 1,063 | 1 | |
You are given a string S consisting of lowercase English letters.
Remove all occurrences of a, e, i, o, u from S and print the resulting string.
S contains at least one character other than a, e, i, o, u.
Input
The input is given from Standard Input in the following format:
S
Output
Print the answer.
Constraints
... | LiveCodeBench | 1,063 | 2 | |
You are given a string S consisting of lowercase English letters.
Remove all occurrences of a, e, i, o, u from S and print the resulting string.
S contains at least one character other than a, e, i, o, u.
Input
The input is given from Standard Input in the following format:
S
Output
Print the answer.
Constraints
... | LiveCodeBench | 1,063 | 3 | |
In the calendar of AtCoderLand, a year consists of M months: month 1, month 2, \dots, month M. The i-th month consists of D_i days: day 1, day 2, \dots, day D_i.
Furthermore, the number of days in a year is odd, that is, D_1+D_2+\dots+D_M is odd.
Find what day of what month is the middle day of the year.
In other wo... | LiveCodeBench | 1,064 | 1 | |
In the calendar of AtCoderLand, a year consists of M months: month 1, month 2, \dots, month M. The i-th month consists of D_i days: day 1, day 2, \dots, day D_i.
Furthermore, the number of days in a year is odd, that is, D_1+D_2+\dots+D_M is odd.
Find what day of what month is the middle day of the year.
In other wo... | LiveCodeBench | 1,064 | 2 | |
In the calendar of AtCoderLand, a year consists of M months: month 1, month 2, \dots, month M. The i-th month consists of D_i days: day 1, day 2, \dots, day D_i.
Furthermore, the number of days in a year is odd, that is, D_1+D_2+\dots+D_M is odd.
Find what day of what month is the middle day of the year.
In other wo... | LiveCodeBench | 1,064 | 3 | |
We have N cups of ice cream.
The flavor and deliciousness of the i-th cup are F_i and S_i, respectively (S_i is an even number).
You will choose and eat two of the N cups.
Your satisfaction here is defined as follows.
- Let s and t (s \ge t) be the deliciousness of the eaten cups.
- If the two cups have different ... | LiveCodeBench | 1,065 | 1 | |
We have N cups of ice cream.
The flavor and deliciousness of the i-th cup are F_i and S_i, respectively (S_i is an even number).
You will choose and eat two of the N cups.
Your satisfaction here is defined as follows.
- Let s and t (s \ge t) be the deliciousness of the eaten cups.
- If the two cups have different ... | LiveCodeBench | 1,065 | 2 | |
We have N cups of ice cream.
The flavor and deliciousness of the i-th cup are F_i and S_i, respectively (S_i is an even number).
You will choose and eat two of the N cups.
Your satisfaction here is defined as follows.
- Let s and t (s \ge t) be the deliciousness of the eaten cups.
- If the two cups have different ... | LiveCodeBench | 1,065 | 3 | |
There are H \times W cookies in H rows and W columns.
The color of the cookie at the i-row from the top and j-th column from the left is represented by a lowercase English letter c_{i,j}.
We will perform the following procedure.
1. For each row, perform the following operation: if there are two or more cookies remain... | LiveCodeBench | 1,066 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.