knapsack.cpp: In function 'int main()':
knapsack.cpp:30:22: warning: comparison of integer expressions of different signedness: 'long int' and 'std::vector<long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | for (long i=1; i <= v.size(); i++) {
| ~~^~~~~~~~~~~
knapsack.cpp:8:64: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
8 | std::vector<long> v, w; long s, n, x, y, z, t=0; std::scanf("%ld %ld", &s, &n);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
knapsack.cpp:11:19: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
11 | std::scanf("%ld %ld %ld", &y, &z, &x);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~