Submission #1023696

#TimeUsernameProblemLanguageResultExecution timeMemory
1023696vjudge1Knapsack (NOI18_knapsack)C++98
0 / 100
1 ms344 KiB
#include <iostream> #include <cmath> #include <vector> #include <string> #include <algorithm> #include <set> #include <map> #include <deque> using namespace std; #define int long long #define ff first #define ss second int mod = 1e9 + 7; signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n , w; cin >> w >> n; int a[n] , b[n] , c[n]; for(int i = 0; i < n; i++){ cin >> a[i] >> b[i] >> c[i]; } int res = 0; for(int i = 1; i <= c[0]; i++){ if(a[i] * i > w){ break; } res += a[i]; } cout << res; return 0; } //AZIM_BEST
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...