Submission #1023700

#TimeUsernameProblemLanguageResultExecution timeMemory
1023700vjudge1Knapsack (NOI18_knapsack)C++98
12 / 100
0 ms348 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(b[0] * i > w){ break; } res += a[0]; } 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...