levi.ackerman1732's blog

By levi.ackerman1732, history, 6 weeks ago, In English,

Hello all,

1301B - Motarack's Birthday

I have read the editorial and implemented the same. My code fails in some hidden test case. If any of you could provide some insight as to what I am doing wrong I would be grateful.

My submission: 71058284

I am extremely sorry if I am asking something that is fairly obvious. Thank you for your time.

Read more »

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

By levi.ackerman1732, history, 6 weeks ago, In English,

Hello all

1201A - Важный экзамен

My solution, was to store the number of responses(among A,B,C,D,E) for each question and choose the maximum among them and multiply with the marks awarded. I am getting a Runtime error. I am not able to figure out why.

The part of code where it's failing is:

s is string, j is the question number

	temp = (int)(s[j]-'A');

	v[j][temp]++;

I have encountered this problem quite a few times, but have avoided every time somehow. Please do let me know what is wrong with this.

My solution: 70953260

I am extremely sorry if I am asking something that is fairly obvious. Thank you for your time.

Read more »

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

By levi.ackerman1732, history, 2 months ago, In English,

893C - Слух

Hello all

I am trying to solve this question. I came up with a certain procedure, which to me seems right. Let me know if you find a mistake in it. Thanks.

My approach: I have assumed that I am starting from Node 0. I have joined paths from this node to all the other nodes with the given cost(input). For the neighbouring nodes input I have stored such that they do not have any cost to traverse between them, and I have also stored them in a separate vector(say v1) to use them later.

I have used Dijkstra's Algorithm to find the Shortest path from Node 0 to all the other nodes.

Now using v1 I have maintained an additional variable sum to all the additional distances that I need not cover.

I have then added the shortest distances that I found using Dijkstra and subtracted the sum of additional distances.

It works fine for most cases but fails at test case 11. The logic to me seems infallible. Help me with that.

I am extremely sorry If I am missing that is something fairly obvious.

69879696

Read more »

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

By levi.ackerman1732, history, 3 months ago, In English,

230B - T-primes

Hello all,

I am a bit new to this online coding platform hence I am sorry if I am asking anything that is fairly obvious. Getting to the solution of the question: If a number has to be T-Prime, it has to be a perfect square of a prime number.

My algo: 1)check if the number is a perfect square. 2)If it is a perfect square check if the square root is a prime number.

Problem I am facing: My code is working fine for many test cases, but failing at test case 16 with an error(wrong answer 28561st lines differ — expected: 'NO', found: 'YES') The input for 28561th line is 28561(169*169). In my system it is showing "NO" (not a t prime) which is correct.

I don't know where it went wrong. Any help is appreciated. Thank you.

My submission

Read more »

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