Блог пользователя KiZamaDo17

Автор KiZamaDo17, история, 9 месяцев назад, По-английски

So this was the question 1930A - Maximise The Score at think-cell Round 1. We simply had to sort the array and add the odd entries.

And so I did except that it gets accepted or TLE rejected just cause of Variable name.

I chose the loop variable i here and it TLEd 250123631 I chose the loop variable j and the exact same code as above and it got accepted 250123236 There are two loops in my program and I named both as j and it still got accepted 250123505

So why the particular hate for "i"? satyam343 And I lost 15 extra minutes and valuable points in that question as well.

I would love to know the reason if someone could explain or if it is a CF issue.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -10
  • Проголосовать: не нравится

Автор KiZamaDo17, история, 9 месяцев назад, По-английски

I attempted the D problem in JAVA 21 64bit with the simple logic of storing the remainder of a[i] in pairs along with their frequency in HashMap and check if (x-(a[i]%x)),(a[i]%y)) is already present, adding 1 to answer if it happens. I also make the remainder equal to x if it comes out to be zero.

Heres my solution

My Answer

but for some reason it fails the 12th test. I don't know what on God's Earth it is, but I then just convert the same logic to C++ and its accepted.

Where am I going wrong? What seems to be the problem here? Is there an alternative? A friend of mine suggested using a 2D array instead of a map an hence saving the trouble of creating pair class in JAVA but I could not fully grasp his concept. Please help me out here.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

Автор KiZamaDo17, история, 2 года назад, По-английски

So the college where I belong has a good Environment for C++. However, I've stuck to Java, my first programming language. So things don't go as smoothly as they should be going. It's not an excuse for my laziness :p. Anyway, I've realized arrays cannot achieve everything, contrary to what I used to preach around, blaming they don't think hard enough. And the problem was relatively simple, 1749B(Death's blessing), which pushed me to learn them for good. In no more than two days, I shall add ArrayList and other collection frameworks to my arsenal for good. It's a good feeling; I will chase it to the dawn of my rise. Signing off, KiZamaDo

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор KiZamaDo17, история, 2 года назад, По-английски

So, I have recently started to be a regular here, and this blog is to keep me coming back. Days have been good lately, and I've never felt more motivated. I am planning many things, and if it all pans out, I'll definitely be in a good place someday. I hope I don't weigh myself or my parents down, and I believe I am in for big things. Cheers to the times to come; I hope I can be the cool senior I have always wished to be.

Signing off, KiZamaDo.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +9
  • Проголосовать: не нравится