Skip to content

Add potential TLE testcases for two_sat#1328

Merged
maspypy merged 1 commit into
yosupo06:masterfrom
PonderKoKo:master
Jun 6, 2025
Merged

Add potential TLE testcases for two_sat#1328
maspypy merged 1 commit into
yosupo06:masterfrom
PonderKoKo:master

Conversation

@PonderKoKo

@PonderKoKo PonderKoKo commented Jun 1, 2025

Copy link
Copy Markdown
Contributor

This adds one testcase (with symmetric variants) that leads to TLE on solutions that follow the structure:

  1. Iterate over variables i (ascending / descending)
  2. Try to set i = true (or false) and follow implications.
  3. If this leads to a contradiction, revert changes, set i = false (or true) instead, and follow implications.

For example, I believe that the current fastest submission (https://judge.yosupo.jp/submission/230491) gets TLE on long_chain_01.

The structure of the testcase is quite simple, with a long implication chain to a contradiction, as described in the comment in the generator: // 1 -> 2, 2 -> 3, ..., n-1 -> n, n -> -n..

This is my first time contributing; let me know if I should make changes.

@maspypy

maspypy commented Jun 6, 2025

Copy link
Copy Markdown
Collaborator

There are no particular issues, so I merge it as is. Thank you.
I have also confirmed that the submission in question results in a TLE.
https://judge.yosupo.jp/hack/528

@maspypy maspypy merged commit 80002ed into yosupo06:master Jun 6, 2025
6 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.

2 participants