Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create spoj-cot.mdx (solution for the problem I added about persisten… #5073

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

1Nigar357
Copy link
Contributor

@1Nigar357 1Nigar357 commented Jan 22, 2025

…t segment tree)

The code solution for the problem count on tree from spoj on persistent segment tree concept

Place an "x" in the corresponding checkbox if it is done or does not apply to this pull request.

  • I have tested my code.
  • I have added my solution according to the steps here.
  • I have followed the code conventions mentioned here.
    • I understand that if it is clear that I have not attempted to follow these conventions, my PR will be closed.
    • If changes are requested, I will re-request a review after addressing them.
  • I have linked this PR to any issues that it closes.

…t segment tree)

The code solution for the problem count on tree from spoj on persistent segment tree concept
@1Nigar357 1Nigar357 requested a review from dongliuu as a code owner January 22, 2025 22:36
@1Nigar357
Copy link
Contributor Author

Hi, I just submitted this pull request. Please let me know if there’s anything I need to adjust or address. Thanks!

@1Nigar357
Copy link
Contributor Author

1Nigar357 commented Jan 22, 2025

Could you please help me resolve the problem "Some checks were not successful"? Is the " '''cpp " causing the problem?

@TheGamingMousse
Copy link
Contributor

fyi, you can test ur mdx code at usaco.guide/editor

@TheGamingMousse
Copy link
Contributor

hmm, it's giving this error:

Internal solution spoj-cot isn't linked to all of its problems (see above). Did you forget to update the solution metadata of a module after adding an internal solution?

  Error:Internal solution spoj-cot isn't linked to all of its problems (see abo  ve). Did you forget to update the solution metadata of a module after adding a  n internal solution?
  
  - gatsby-node.js:1 
    /home/runner/work/usaco-guide/usaco-guide/.cache/compiled/gatsby-node.js:1:8    567
  
  - Array.forEach
  
  - gatsby-node.js:1 Object.n.createPages
    /home/runner/work/usaco-guide/usaco-guide/.cache/compiled/gatsby-node.js:1:7    973
  
  - task_queues:95 processTicksAndRejections
    node:internal/process/task_queues:95:5
  
  - api-runner-node.js:[48](https://github.com/cpinitiative/usaco-guide/actions/runs/12919237231/job/36029331675?pr=5073#step:7:49)7 runAPI
    [usaco-guide]/[gatsby]/src/utils/api-runner-node.js:487:16
  

not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 13.133s
failed createPages - 0.814s

@1Nigar357
Copy link
Contributor Author

1Nigar357 commented Jan 23, 2025

I changed the solution metadata kind to internal after committing this change. I think I accidentally included it in a different pull request

@TheGamingMousse
Copy link
Contributor

TheGamingMousse commented Jan 23, 2025

I changed the solution metadata kind to internal after committing this change. I think I accidentally included it in a different pull request

yeah thats what it looks like, just change the solution type to internal

@1Nigar357
Copy link
Contributor Author

I think I solved it

Copy link
Contributor

@TheGamingMousse TheGamingMousse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some misc style changes + other

for examples of how the code should roughly look, u can look at other internal solutions (here's a good example)

solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
@1Nigar357
Copy link
Contributor Author

Thank you for the suggestions! Is there anything else that you would suggest modifying?

solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Show resolved Hide resolved
…code)

Modified the explanation part and organized the code
@1Nigar357
Copy link
Contributor Author

I changed the code and the explanation part

solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
Corrected explanation, specifically the "handling overcounting with LCA" part
Changed the variable name from a to u and b to v
Modified the note, so it is more grammatically correct
@1Nigar357
Copy link
Contributor Author

Is there anything else that you suggest I modify? @SansPapyrus683

Copy link
Contributor

@TheGamingMousse TheGamingMousse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, value compression isn't strictly needed (altho it makes it faster, ig)

my code is here (u can remove fast io, altho using std::endl times out cuz its slow)

solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
Deleted long longs and the build function since they weren't necessary
I decreased the number of nodes since 5e6 would suffice
Reduced the number of nodes to 2e6
@1Nigar357
Copy link
Contributor Author

Is there anything else that you suggest I modify?

solutions/advanced/spoj-cot.mdx Show resolved Hide resolved
solutions/advanced/spoj-cot.mdx Outdated Show resolved Hide resolved
Improved the description's clarity, removed redundancies, and changed the format of the variables (latex)
@1Nigar357
Copy link
Contributor Author

1Nigar357 commented Feb 10, 2025

Anything else that you would recommend changing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants