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

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

How can i submit solutions to the problems of Izho 2024. Also if anyone has problems of day 2 it would be really helpful if you shared it.

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

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

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

Monotonic Stacks:

  • Excel at:
    • Finding next greater or smaller elements in arrays
    • Tracking maximum/minimum values within a sliding window
    • Solving problems involving range queries with certain restrictions
  • Operations:
    • Push, pop, peek, find next greater/smaller element
  • Time complexity: Typically O(1) for operations, but can involve upfront processing
  • Space complexity: Usually O(n)

Segment Trees:

  • Excel at:
    • Range queries (sum, minimum, maximum, etc.)
    • Range updates (adding/subtracting values within ranges)
    • Solving problems involving range operations efficiently
  • Operations:
    • Query for information within a range
    • Update values within a range
  • Time complexity: Typically O(log n) for queries and updates
  • Space complexity: O(n)

When to Choose:

  • Monotonic stack: Use for problems involving finding next greater/smaller elements, sliding window maximum/minimum, or range queries with specific conditions where a stack-like structure is naturally suited.
  • Segment tree: Use for problems involving general range queries, range updates, or efficient range-based operations that don't align well with a stack's structure.

Key Considerations:

  • Implementation complexity: Monotonic stacks are generally simpler to implement than segment trees.
  • Code readability: Monotonic stacks often lead to more readable code for problems they are well-suited for.
  • Performance trade-offs: In some cases, segment trees might offer faster queries at the cost of increased space usage.

In summary:

  • While segment trees can be used to solve certain problems that monotonic stacks can, they are not universally interchangeable.
  • The choice depends on the specific problem requirements and the trade-offs between implementation complexity, code readability, and performance.

What do you think need to be changed ?

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

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

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

Before reading this blog i kindly ask you read the problem statement: https://vjudge.net/problem/UVA-714

I implemented a binary search solution for this problem and i am getting wrong answer verdict when i submitted.

My code

If you encounter any problems in my solution whether they are about logic or implementation, let me know.

Thanks in advance

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

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

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

Hi everyone. I was solving problem https://codeforces.com/contest/1759/problem/E and my solution is this: https://codeforces.com/contest/1759/submission/228398584

but unfortunately i failed test 3. can you help me to clarify which part of my submission is wrong

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

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

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

Normally how long it takes for atcoder to update ratings of contestant ?

(is it soo long)?

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

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

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

i was solving this problem and after making few submissions i thought now it would pass, but i got wrong answer on test two,cause 256th number differs :(

here is my submission: https://codeforces.com/contest/1736/submission/218110763

it says out of bounds on long long. how could this happen with the given constraints.

what's more i can't see that test-case. so, i wanted ask whether someone can help me for this one.

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

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

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

Hello everyone, i think most of you guys herd about https://codeforces.com/blog/entry/119110

can someone explain how to push the solution.in the instructions it is written push your solution, but didn't explain how and where?

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

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

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

I have learned basics of c++ and i can now solve some problems which are related to intuition, but i'm still not good at implementation stuff...

So, before learning data structures i found out that i have to learn STL Library of C++

Can someone suggest anything like how can i learn it and become comfortable with it and what should i do next?

Thanks in advance:)

You can downvote if you want, but i need advice :)

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

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

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

I have problem with the last contest's problem B:

you can visit my code with sample case here

i don't understand why my code is not working even for the sample cases

can someone help me on this stuff, i would be really happy, thanks in advance

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

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

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

i was solving this problem

i got wrong answer many times(you can refer to my last submissions) on test 1, but when i checked myself with sample test-cases i got right answers.

I wonder why?

my last submission

can someone explain reason or give some hints , thanks in advance

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

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

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

Hi everyone, thank you for reading this blog. If you know c++ can you please keep reading to help me

problem: 1846C

my submission

i solved this problem in python, but i got runtime error on test 3 when i tried to do it using c++

i don't understand why i got runtime error on test 3. can somebody explain this to me

Thanks in advance

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

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