#include <iostream> #include <unordered_map> using namespace std; int main() { int n; unordered_map<int, int> cnt; cin >> n; for (int i = 0; i < n; i++) { int a; cin >> a; cnt[a]++; } int num = cnt.bucket_count(); for (int i = 0; i < num; i++) cout << "bucket #" << i << " has " << cnt.bucket_size(i) << " elements." << endl; return 0; }
100 0 199 398 597 796 995 1194 1393 1592 1791 1990 2189 2388 2587 2786 2985 3184 3383 3582 3781 3980 4179 4378 4577 4776 4975 5174 5373 5572 5771 5970 6169 6368 6567 6766 6965 7164 7363 7562 7761 7960 8159 8358 8557 8756 8955 9154 9353 9552 9751 9950 10149 10348 10547 10746 10945 11144 11343 11542 11741 11940 12139 12338 12537 12736 12935 13134 13333 13532 13731 13930 14129 14328 14527 14726 14925 15124 15323 15522 15721 15920 16119 16318 16517 16716 16915 17114 17313 17512 17711 17910 18109 18308 18507 18706 18905 19104 19303 19502 19701
bucket #0 has 100 elements. bucket #1 has 0 elements. bucket #2 has 0 elements. bucket #3 has 0 elements. bucket #4 has 0 elements. bucket #5 has 0 elements. bucket #6 has 0 elements. bucket #7 has 0 elements. bucket #8 has 0 elements. bucket #9 has 0 elements. bucket #10 has 0 elements. bucket #11 has 0 elements. bucket #12 has 0 elements. bucket #13 has 0 elements. bucket #14 has 0 elements. bucket #15 has 0 elements. bucket #16 has 0 elements. bucket #17 has 0 elements. bucket #18 has 0 elements. bucket #19 has 0 elements. bucket #20 has 0 elements. bucket #21 has 0 elements. bucket #22 has 0 elements. bucket #23 has 0 elements. bucket #24 has 0 elements. bucket #25 has 0 elements. bucket #26 has 0 elements. bucket #27 has 0 elements. bucket #28 has 0 elements. bucket #29 has 0 elements. bucket #30 has 0 elements. bucket #31 has 0 elements. bucket #32 has 0 elements. bucket #33 has 0 elements. bucket #34 has 0 elements. bucket #35 has 0 elements. bucket #36 has 0 elements. bucket #37 has 0 elements. bucket #38 has 0 elements. bucket #39 has 0 elements. bucket #40 has 0 elements. bucket #41 has 0 elements. bucket #42 has 0 elements. bucket #43 has 0 elements. bucket #44 has 0 elements. bucket #45 has 0 elements. bucket #46 has 0 elements. bucket #47 has 0 elements. bucket #48 has 0 elements. bucket #49 has 0 elements. bucket #50 has 0 elements. bucket #51 has 0 elements. bucket #52 has 0 elements. bucket #53 has 0 elements. bucket #54 has 0 elements. bucket #55 has 0 elements. bucket #56 has 0 elements. bucket #57 has 0 elements. bucket #58 has 0 elements. bucket #59 has 0 elements. bucket #60 has 0 elements. bucket #61 has 0 elements. bucket #62 has 0 elements. bucket #63 has 0 elements. bucket #64 has 0 elements. bucket #65 has 0 elements. bucket #66 has 0 elements. bucket #67 has 0 elements. bucket #68 has 0 elements. bucket #69 has 0 elements. bucket #70 has 0 elements. bucket #71 has 0 elements. bucket #72 has 0 elements. bucket #73 has 0 elements. bucket #74 has 0 elements. bucket #75 has 0 elements. bucket #76 has 0 elements. bucket #77 has 0 elements. bucket #78 has 0 elements. bucket #79 has 0 elements. bucket #80 has 0 elements. bucket #81 has 0 elements. bucket #82 has 0 elements. bucket #83 has 0 elements. bucket #84 has 0 elements. bucket #85 has 0 elements. bucket #86 has 0 elements. bucket #87 has 0 elements. bucket #88 has 0 elements. bucket #89 has 0 elements. bucket #90 has 0 elements. bucket #91 has 0 elements. bucket #92 has 0 elements. bucket #93 has 0 elements. bucket #94 has 0 elements. bucket #95 has 0 elements. bucket #96 has 0 elements. bucket #97 has 0 elements. bucket #98 has 0 elements. bucket #99 has 0 elements. bucket #100 has 0 elements. bucket #101 has 0 elements. bucket #102 has 0 elements. bucket #103 has 0 elements. bucket #104 has 0 elements. bucket #105 has 0 elements. bucket #106 has 0 elements. bucket #107 has 0 elements. bucket #108 has 0 elements. bucket #109 has 0 elements. bucket #110 has 0 elements. bucket #111 has 0 elements. bucket #112 has 0 elements. bucket #113 has 0 elements. bucket #114 has 0 elements. bucket #115 has 0 elements. bucket #116 has 0 elements. bucket #117 has 0 elements. bucket #118 has 0 elements. bucket #119 has 0 elements. bucket #120 has 0 elements. bucket #121 has 0 elements. bucket #122 has 0 elements. bucket #123 has 0 elements. bucket #124 has 0 elements. bucket #125 has 0 elements. bucket #126 has 0 elements. bucket #127 has 0 elements. bucket #128 has 0 elements. bucket #129 has 0 elements. bucket #130 has 0 elements. bucket #131 has 0 elements. bucket #132 has 0 elements. bucket #133 has 0 elements. bucket #134 has 0 elements. bucket #135 has 0 elements. bucket #136 has 0 elements. bucket #137 has 0 elements. bucket #138 has 0 elements. bucket #139 has 0 elements. bucket #140 has 0 elements. bucket #141 has 0 elements. bucket #142 has 0 elements. bucket #143 has 0 elements. bucket #144 has 0 elements. bucket #145 has 0 elements. bucket #146 has 0 elements. bucket #147 has 0 elements. bucket #148 has 0 elements. bucket #149 has 0 elements. bucket #150 has 0 elements. bucket #151 has 0 elements. bucket #152 has 0 elements. bucket #153 has 0 elements. bucket #154 has 0 elements. bucket #155 has 0 elements. bucket #156 has 0 elements. bucket #157 has 0 elements. bucket #158 has 0 elements. bucket #159 has 0 elements. bucket #160 has 0 elements. bucket #161 has 0 elements. bucket #162 has 0 elements. bucket #163 has 0 elements. bucket #164 has 0 elements. bucket #165 has 0 elements. bucket #166 has 0 elements. bucket #167 has 0 elements. bucket #168 has 0 elements. bucket #169 has 0 elements. bucket #170 has 0 elements. bucket #171 has 0 elements. bucket #172 has 0 elements. bucket #173 has 0 elements. bucket #174 has 0 elements. bucket #175 has 0 elements. bucket #176 has 0 elements. bucket #177 has 0 elements. bucket #178 has 0 elements. bucket #179 has 0 elements. bucket #180 has 0 elements. bucket #181 has 0 elements. bucket #182 has 0 elements. bucket #183 has 0 elements. bucket #184 has 0 elements. bucket #185 has 0 elements. bucket #186 has 0 elements. bucket #187 has 0 elements. bucket #188 has 0 elements. bucket #189 has 0 elements. bucket #190 has 0 elements. bucket #191 has 0 elements. bucket #192 has 0 elements. bucket #193 has 0 elements. bucket #194 has 0 elements. bucket #195 has 0 elements. bucket #196 has 0 elements. bucket #197 has 0 elements. bucket #198 has 0 elements.