saiprajna_nayak's blog

By saiprajna_nayak, 8 years ago, In English

I need to translate C++ code of my friends to say Perl/Haskell code to avoid getting detected by cheating checker of codeforces. Google translate doesn't work :( Can anyone suggest any alternative ? Thanks in advance

Full text and comments »

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

By saiprajna_nayak, 8 years ago, In English
  • In the darkness of the night,
  • Found a stranger by my side.
  • Then the clouds gave way,
  • to the serenading moonlight
  • And I turned to the side,
  • Gazed down upon those beautiful eyes.
  • She turned, blushed and gave me a smile.
  • A bright light caught the corner of my eye.
  • The taxi had finally arrived.
  • So I turned towards her.
  • Only to be greeted by emptiness.
  • And as I reached to my pockets to pay,
  • Was again greeted by that old friend.
  • Robbed I had been,
  • Of my heart, phone and wallet.
  • In that cold moonlight street.
  • On that beautiful night.

Full text and comments »

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

By saiprajna_nayak, 8 years ago, In English

How to solve this : link

Full text and comments »

By saiprajna_nayak, 8 years ago, In English

I am pretty new unfortunately. So this is the question i just can't figure out how to solve.

Statement:

Sveta loves chocolates. More specifically she loves to have Gems chocolates. In PET most people love numbers, so here the different types of Gems are distinguished by numbers(unlike the boring blue/green/red colors).

As you already know, PET is a magical place. So every Wednesday, the Gems in the packet mysteriously increase in quantity. While most people never bothered to find out the reason, Sveta, being a smart girl, decoded the pattern in which this weird phenomenon occurred. She noticed that if the Gem had a number N, it would split into Gems with numbers in range of 2 to N-1 if the numbers were a factor of N. This splitting would go on until there was no way to split any remaining Gems in this manner.

Now Puru wants to know the final sum of numbers of the Gems after magical transformation in order to impress Sveta. Help him out.

Input:

First line contains T number of testcases

Next line contains N, the number of Gems in the packet Sveta has bought

Next line contains N integers, denoting the number assigned to each gem.

Output:

Print the sum of numbers of all gems after the magical transformation has taken place.

Constraints:

1 <= T <= 1000

1 <= N <= 40

2 <= number assigned to gems <= 10^4

Sample:

Input:

1

2

2 12

Output:

14

Explanation:

Now the first gem with value 2 can't divide as per the rules, so it stays as it is. Gem with number 12 divides into 4 gems with numbers 2,3,4 and 6. Now gems 2 and 3 cant divide, however gems 4 and 6 can divide into gems 2 and gems 2,3 respectively. Now the gems can't divide anymore and the magical transformation ends. So the result is 2 + 2+3 + 2 + 2+3 = 14

Full text and comments »

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

By saiprajna_nayak, 9 years ago, In English

By first finding depth of each node using BFS, then selecting nodes with maximum depth, we can implement Dijsktra to find the path. Once you get the path, just look at the path for 15 seconds else you'll get WA. Then look at cats in path. Also look at hawks , snipers, terrorists as well, since they can easily kill a parrot.

Then do headshot snipers and use cats to kill the hawks.

After doing all this, use BrainF**k to submit your code

Have a nice Day

Full text and comments »

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

By saiprajna_nayak, history, 9 years ago, In English

Is it really hard ?

Full text and comments »

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