HTMLify
hash.cpp
Views: 1 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i =0; i<n; i++){ cin>>arr[i]; } //precompute int hash[13] = {0}; for(int i=0; i<n; i++ ){ hash[arr[i]] += 1; } int q; cin>>q; while(q--){ int number; cin>>number; //fetch cout<<hash[number]<<endl; } return 0; } |