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

Update BuildingTeams PySol content/3_Silver/Graph_Traversal.mdx #4917

Merged
merged 17 commits into from
Nov 19, 2024

Conversation

CryoJS
Copy link
Contributor

@CryoJS CryoJS commented Nov 10, 2024

Description

Adds new Python Solutions to https://cses.fi/problemset/task/1668/ for content/3_Silver/Graph_Traversal.mdx.
Relates to #3444

Runtimes

DFS (missing Python): https://cses.fi/problemset/result/11118878/ (0.74s)
Previous BFS Sol: https://cses.fi/problemset/result/11118911/ (0.90s)
New BFS Sol: https://cses.fi/problemset/result/11118910/ (0.69s)

Note: Updated/changed the pre-existing Python BFS solution as I had a simpler, faster solution.


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.

content/3_Silver/Graph_Traversal.mdx Show resolved Hide resolved
content/3_Silver/Graph_Traversal.mdx Outdated Show resolved Hide resolved
content/3_Silver/Graph_Traversal.mdx Outdated Show resolved Hide resolved
content/3_Silver/Graph_Traversal.mdx Outdated Show resolved Hide resolved
@SansPapyrus683
Copy link
Contributor

alright thanks for agreeing to revert ❤️
could you just submit the code one more time please? for both sols
ik for the other one you just changed the listcomp to an asterisk but i just want to make sure

@CryoJS
Copy link
Contributor Author

CryoJS commented Nov 19, 2024

Yep, of course!

@CryoJS
Copy link
Contributor Author

CryoJS commented Nov 19, 2024

Here are the newest submissions:
DFS -> https://cses.fi/problemset/result/11193528/ (AC, slowest is 0.73s)
BFS -> https://cses.fi/problemset/result/11193531/ (AC, slowest is 0.90s)

I couldn't find any optimizations, the code is pretty much exactly the same as the C++ code.
Nevertheless, how they managed to make BFS run slower than DFS, I don't know lol.

Copy link
Contributor

@SansPapyrus683 SansPapyrus683 left a comment

Choose a reason for hiding this comment

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

image

@SansPapyrus683 SansPapyrus683 merged commit 13e69c7 into cpinitiative:master Nov 19, 2024
3 checks passed
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.

4 participants