Compare commits

..

2 Commits

Author SHA1 Message Date
5e1de21a22 Prevent swapping two equal items 2024-10-15 11:36:59 -03:00
11d8f8e757 Increase minimal temperature
It should be a lot faster now, although the answers might be a little
worse
2024-10-15 10:37:17 -03:00
2 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,7 @@
#endif
#ifndef TEMP_MIN
#define TEMP_MIN 0.01
#define TEMP_MIN 10
#endif
int main(int argc, char *argv[])

3
sa.hpp
View File

@ -65,7 +65,8 @@ class box {
auto swappable11(box &other, int capacity) -> bool {
long long choice1 = items.top();
long long choice2 = other.items.top();
return choice1 + other.fullness - choice2 <= capacity &&
return choice1 != choice2 &&
choice1 + other.fullness - choice2 <= capacity &&
choice2 + fullness - choice1 <= capacity;
}