Untitled
Never
#include <iostream> #include <vector> #include <queue> #include <map> using namespace std; map<int, queue<int>> m; map<int, int> kid; vector<int> ans; vector<int> candy; int main(void){ int N, M, sz, tmpc, tmpcandy; cin >> N >> M; for(int i = 1; i <= N; i++){ cin >> kid[i]; for(int j = 0; j < kid[i]; j++){ cin >> tmpc; m[tmpc].push(i); } } for(int i = 0; i < M; i++){ cin >> tmpcandy; candy.push_back(tmpcandy); if(!m[tmpcandy].empty()){ ans.push_back(m[tmpcandy].front()); kid[m[tmpcandy].front()]--; m[tmpcandy].pop(); } else ans.push_back(0); } //cout << "ans\n"; for(int i = 0; i < M; i++){ if(kid[ans[i]] > 0) ans[i] = 0; cout << ans[i] << endl; } }
Raw Text
-
Untitled
8 sec ago
-
Untitled
15 min ago
-
Russian Schoolgirl Shows Her Huge Ass, Sucks, Rides Cock and Gets Cum Inside
15 min ago
-
https://tworhttps://twor.microsoftcrmportals.com/forums/support-forum/6cf2361f-8e00-ef11-a73d-6045bd
25 min ago
-
asdfgndasfdgfhgh
27 min ago
-
my friend gave me a present
46 min ago
-
Untitled
49 min ago
-
Nomacasi
50 min ago
-
DLF Magnolias Service Apartments in Gurgaon
1 hour ago
-
My porn casting, when I venture into the industry. COMPLETE VIDEO Kylei Ellish y William Vegas.
1 hour ago