Hello Codeforces,

I would like to invite you all to participate in the **2017 JUST Programming Contest 3.0** of Jordan University of Science and Technology. The contest was originally held on 26^{th} of August , and it will launch in Codeforces Gym on Wednesday 30 August 2017 15:00 UTC.

The problems were prepared by Vendetta. (Ibraheem Tuffaha), justHusam (Husam Musleh), Alaa_AbuHantash (Αlαα Abu Hantash), and 0xAC (Mohammad Al-Tahhan).

The duration of the contest is 4.5 hours, and the registration will be open 6 hours before the start of the contest.

Good luck for everyone, and I wish you all Accepted solutions.

**UPD:** Registration is currently open.

**UPD: The contest will start in 30 minutes.**

For problem B can anybody explain why this approach gives WA: count the number of each a[i], and each b[i] inside a map countA and countB, then iterate one of the array and add the max of each element that it's count is > 0 in both maps (countA and countB) to the answer.

because you choose for each row all available columns that can match with it and vice versa ..

because the result of multiplying matrix A by matrix B differ from multiplying matrix B by matrix A

some thing like this

1

4

2 3

2 3

3 2

3 2

all available pairs of indices i and j exist are 8

(1 , 3)

(1 , 4)

(2 , 3)

(2 , 4)

(3 , 1)

(3 , 2)

(4 , 1)

(4 , 2)

Thanks.

:)

Hi, this is my sol http://codeforces.com/gym/101502/submission/31438210 but I don't know how to do with case x==y, can you help me ? :<

check data types

How to solve problem J ?

let's suppose your lines of boxes starts with box with index a and finishes with box with index b, if you play first you can pick either box a or b, leaving the other player with boxes

`(a+1..b)`

or`(a..b-1)`

and we know he will do the optimal move and leave us with either`(a+2..b)`

or`(a+1..b-1)`

(if we picked box "a" in the previous turn) and`(a+1..b-1)`

or`(a..b-2)`

(if we picked "b" in the previous turn). since this is a zero-sum game, we can think of his move as he's trying to minimize our score. so our next move will be in the position that gives us the minimum score. now let's go back to the beginning of the game before picking either a or b, we pick the box that gives us a maximum minimum in our next possible moves, and we do it recursively for all positions of boxes we can achieve. more formally,Spoileryou'll also need a dp table to memoize the score for each pair (a,b)

my solution

thanks a lot :)

For problem A can anybody give a HINT and thanks in advance ^^

If the amount of money you have is

TotalMoney, and the price per orange isOrangePricethen the number of oranges you can buy is (assuming thatTotalMoneyis divisible byOrangePrice):We can use this equation to find

TotalMoney, which is equal to:TotalMoney=Oranges×OrangePriceLet's take the first test case as an example to explain the solution. If the price of the orange was increased by 25%, then the new price is equal to:

NewOrangePrice=OrangePrice× 1.25The number of oranges that can be bought after the price increase is equal to:

From the problem statement, we know that the amount of money didn't change, which mean:

NewTotalMoney≡TotalMoneySo, we can write the equation as follows:

Also, we know the following from the explanation above:

TotalMoney≡Oranges×OrangePriceNewOrangePrice≡OrangePrice× 1.25So, we can write the equation as follows:

Which can be written as follows:

In general, to calculate the answer you can use the following equation:

.

To avoid floating-point issues with compilers, you can multiply the equation by 100 to get the following equation:

.

I Got it ,This is a Good Explanation Thanks :D

IS here anyone can put the solutions of the 12 pbs here please ?

Can anyone share how to solve problem I. Was it a simple BFS but it was giving Wrong Answer on my submission.

We can find the current number of other figures can be reached, the establishment of a map, the shortest road

it will do a BFS ?? as the graph would be undirected or am i missing something

Yes, no direction

got it Thanks :)

Can anyone give me hint with problem D ?

BFS

and Remember that you

can'tdo the following transitions:1 <-> 6 (ie: if top is 1, you can go to 3,4,5,2 but not 6, same for 6 can go the same set but not 1)

3 <-> 4

5 <-> 2

Oh, I solved it , but very thanks you , btw, I am stuck at problem G, my idea is count hash code of all strings's suffix, but I don't know how to map value ?

Hmmm, you approach seems like it'll get a TLE for me.

Anyway, the problem is solvable by inserting the reverse of each string in a Tries. Think about it.

thanks, I will read trie

problem B ~~~~~ public static void main(String[] args) { MyScanner scanner=new MyScanner();

~~~~~

can some one tell me whats going wrong here

i am collecting frequency of columns in a map and iterating through the array if any row is present in the map and is row != column : then count=count+cols[current_row] else if current_row==current_col: then count=count+cols[current_row]-1