Submission #1317785

#TimeUsernameProblemLanguageResultExecution timeMemory
1317785hellodude2526Topical (NOI23_topical)C++20
40 / 100
1095 ms23752 KiB
/* tourist orz dominater sir orz paras sir orz socho sir orz kshitij sir orz aryan maskara sir orz evenvalue orz aryan sir orz samik sir orz avighna sir orz sushil sir orz yash sir orz archit sir orz ola sir orz hashman sir orz hashman sir orz oviyan sir orz tiana chutiya */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> //variables and methods #define int long long #define endl '\n' const int INF = 1e18; //main method int32_t main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; int k; cin>>k; int r[n][k]; int u[n][k]; for (int i=0; i<n; i++) { for (int j=0; j<k; j++) { cin>>r[i][j]; } } for (int i=0; i<n; i++) { for (int j=0; j<k; j++) { cin>>u[i][j]; } } vector<int> p(k,0); vector<bool> done(n, false); int completed = 0; int progress = true; while(progress) { progress=false; for (int i=0; i<n; i++) { if (done[i]) continue; bool can = true; for (int j=0;j<k; j++) { if (p[j] < r[i][j]) { can = false; break; } } if (can) { done[i] = true; completed++;progress = true; for (int j=0;j<k; j++) { p[j]+=u[i][j]; } } } } cout<<completed<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...