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

Автор aditya123garg, история, 5 лет назад, По-английски

Hey Guys, there was a question in Round 2 of the HackWithInfy Contest which I feel is quite nice and I wasn't able to think of any possible solution to it. So the question goes like that:-

We have defined a function f(x) = sum of all the digits of x. Now,

0 <= i <= N

0 <= j <= N

We have to count how many pairs are there which satisfy the condition that f(i) + f(j) is a prime.

Constraints:- 0 <= N <= 10^50

Example:-

1) N = 2

pairs = 2

2) N = 3

pairs = 4

Can anyone suggest some possible method to solve this question??

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

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

Автор aditya123garg, история, 6 лет назад, По-английски

Hey Guys!! I have been trying to understand the Editorial's solution from quite a while now but couldn't get it properly. Can anyone please throw some light on how to proceed it.

Question link :- https://mirror.codeforces.com/contest/1163/problem/D

What I have understood till now.

At every position, we will assume every possible character to be there in the string c whenever there is asterisk present and after that, we are also maintaining what is the length of the prefix of string t and s which matches with the suffix of string c[0, i]. Now, how to move beyond this?

Additional help :-

Can someone provide some similar questions to this one which they have encountered while practicing.

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

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

Автор aditya123garg, история, 6 лет назад, По-английски

Hey Guys, My solution to the third problem of yesterday's round(Educational Round 63) fails on test case 20 according to Codeforces compiler but I am getting the correct answer on my own compiler and even on dry running it by myself.

Question link :-https://mirror.codeforces.com/contest/1155/problem/C

Solution link :-https://mirror.codeforces.com/contest/1155/submission/53144801

Test case on which it is failing :

2 1 10000000000 20000000000 10000000000

Plzz Guys see to it what's happening here !!

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

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

Автор aditya123garg, история, 6 лет назад, По-английски

Hey Guys!! Can anyone give some insights on how to approach this problem from Yesterday's contest?

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

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

Автор aditya123garg, история, 6 лет назад, По-английски

Problem link : http://mirror.codeforces.com/contest/705/problem/C

Solution link :- http://mirror.codeforces.com/contest/705/submission/42254642

Hey guys this code is giving me the runtime error in testcase-2 on submitting it while on running the same test on my system it is giving me correct answer. I literally have no clue of what's happening :(

Could anyone plzz help me out!!

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

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