← Back to archive

Stdle #160 · containers · 2026-11-13

What does this C++ snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <iostream>
#include <map>
int main() {
std::multimap<int,int> m;
m.insert({1, 10});
m.insert({1, 20});
std::cout << m.count(1) << " " << m.size() << "\n";
}
Containers
4 attempts left

Answer & explanation