|
@@ -46,18 +46,18 @@ int main()
|
|
|
// for reach sum in a, see if it is in c. n squared checks of log (n squared), or n squared log n
|
|
|
for (int i = 0; i < clen; ++i)
|
|
|
{
|
|
|
- for (int j = (i + 1); j < n; ++j)
|
|
|
+ for (int j = i; j < n; ++j)
|
|
|
{
|
|
|
if (binary_search(c, (c + clen), (a[i] + a[j])))
|
|
|
{
|
|
|
free(a); free (b); free(c);
|
|
|
- cout << 1 << endl;
|
|
|
- return true;
|
|
|
+ cout << "TRUE" << endl;
|
|
|
+ return 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
free(a); free(b); free(c);
|
|
|
- cout << 0 << endl;
|
|
|
- return false;
|
|
|
+ cout << "FALSE" << endl;
|
|
|
+ return 0;
|
|
|
}
|