skpro19's blog

By skpro19, history, 6 years ago, In English

I am stuck in this problem for the past one week -> Problem

I am unable to detect the bug in my solution-> Solution

Can someone please help.

Full text and comments »

 
 
 
 
  • Vote: I like it
  • -6
  • Vote: I do not like it

By skpro19, history, 6 years ago, In English

I am unable to solve the Problem B Large and problem C small and large.

Any help would be much appreciated.

Thanks!

Full text and comments »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By skpro19, history, 6 years ago, In English

The question is this.

I went through one of the submitted solutions:

I understood that for the solution to exist C must be divisible by g = gcd(A, B);

But, how are we getting the final values for x and y ?

Also, it would be very nice if someone can suggest some nice problems to practice on this topic.

Thanks!

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

By skpro19, history, 6 years ago, In English

The problem is this

After going through the submitted solution, I found the answer is this-> w! * b! * (w -1)* C(w + b — 3, n — 3)

Can someone please explain how this solution is coming.

Thanks!

Full text and comments »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By skpro19, history, 6 years ago, In English

The problem is 294C.

The tutorial says this:

The third sample is ...#...#... where # is a switched on lamp and . is a switched off lamp. As you can see we have three different types of lights. The first three lights (Type A), the 5th to 8th lights (Type B) and the last three lights (Type C). We have to switch on the lights three times for each type of lights. Aside from the order of moves for each type there are  possible permutations of the string AAABBBCCC which tells us how to combine the steps of different types. Switching on the lights is done uniquely for types 1 and 3. But for type 2 each time we have to possible options until we're left with one off light. So there are 2^(3 - 1) ways to do this. So the answer would be 1680*1*4*1 = 6720.

I can not understand the  part. A little help would be very much appreciated.

Full text and comments »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By skpro19, history, 6 years ago, In English

The problem is this.

The tutorial says this:

"If a fraction can be obtained with k resistors, then it is simple to calculate that we can obtain fractions and with k + 1 resistors. So adding one resistor means performing one operation backwards in Euclidean algorithm. That means that the answer is equal to the number of steps in standard Euclidean algorithm.

At first we thought about the major problem (any two elements can be joined), but had a moment of eureka and got that the given problem unexpectedly naturally can be reduced to GCD. "

I do not understand the tutorial. A little help will be really appreciated.

Thanks!

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

Is it possible to solve this question using recursion + memoisation instead of bottom up approach, without exceeding the given memory limit?

Full text and comments »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

In this question, DIV 2C, Is is possible to solve this using recursive approach without exceeding the memory limit??

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

The question is this. It appeared in the latest Hackerrank Week of Code. I went through the editorial and implemented my solution. What is wrong with my solution? Thanks!

Full text and comments »

 
 
 
 
  • Vote: I like it
  • -2
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

I participated in the Google 2017 APAC Round A. I was wondering if Google releases any kind of editorial for the same or not?

Thanks!

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

How do I generate all the submasks for a given mask?

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +10
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

When will the editorial for the CROC Finals be released?

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +15
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

The problem is Chef and Frogs. I have solved it using DFS and I am getting a WA. Can someone please point out the error ?

My solution is My Solution

Full text and comments »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

I was solving this problem -> Problem C

I went through the tutorial which says this ->

The problem was suggested by Lewin Gan lewin. The proof of the transitivity also belongs to him. Let's sort all the strings by comparator a + b < b + a and concatenate them. Let's prove that it's the optimal answer. Let that operator be transitive (so if ). Consider an optimal answer with two strings in reverse order by that operator. Because of the transitivity of operator we can assume that pair of strings are neighbouring. But then we can swap them and get the better answer. Let's prove the transitivity of operator. Consider the strings as the 26-base numbers. Then the relation a + b < b + a equivalent to . The last is simply the relation between real numbers. So we proved the transitivity of the relation a + b < b + a.

I couldn't understand a word of it. Can anyone please help ?

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

The problem is Almost Arithmetic Sequences.

Accepted Solution

Time limit exceeded

Can someone please figure out why is this happening?

Full text and comments »

 
 
 
 
  • Vote: I like it
  • -6
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

Why has Codeforces blocked access to the ProblemSet? I think it has been blocked since the last contest ended.

Full text and comments »

 
 
 
 
  • Vote: I like it
  • -15
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

Why are submissions not getting checked? How long is it gonna take?

Full text and comments »

 
 
 
 
  • Vote: I like it
  • +11
  • Vote: I do not like it

By skpro19, history, 7 years ago, In English

Is it something temporary or they are actually going ahead with it full time. I wish not. I kind of like the previous setitng. It would be very kind if somebody, officially with codeforces could answer this.

Full text and comments »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it