diff --git a/src/10/12/P3879.cpp b/src/10/12/P3879.cpp new file mode 100644 index 0000000..bfab136 --- /dev/null +++ b/src/10/12/P3879.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include +#include +using ll = int64_t; + +ll n,m,l; +std::map> s; +std::string tmp; + +int main(){ + std::iostream::sync_with_stdio(false); + std::cin.tie(nullptr); + + std::cin>>n; + for(ll i=1;i<=n;i++){ + std::cin>>l; + for(ll j=1;j<=l;j++){ + std::cin>>tmp; + s[tmp].insert(i); + } + } + std::cin>>m; + while(m--){ + std::cin>>tmp; + if(const auto p = s.find(tmp);p!=s.end()){ + for(const ll i:p->second){ + std::cout<