Language: C++

#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define mset(s,_) memset(s,_,sizeof s)
int dp[1 << 13];
map<int, int>mp;
int main() {
	int n, m;
	cin >> n >> m;
	mset(dp, 0x3f);
	mset(dp, 0x3f);
	dp[0] = 0;
	rep(i, 1, m) {
		int w, k;
		cin >> w >> k;
		int tmp = 0;
		rep(i, 1, k) {
			int c;
			cin >> c;
			tmp |= 1 << c - 1;
		}
		if (mp[tmp]) mp[tmp] = min(w, mp[tmp]);
		else mp[tmp] = w;
	}
	for (int i = 0; i < 1 << n; i++) {
		for (auto v : mp) {
			dp[i | v.first] = min(dp[i] + v.second, dp[i | v.first]);
		}
	}
	if (dp[(1 << n) - 1] == 0x3f3f3f3f) cout << -1 << '\n';
	else cout << dp[(1 << n )- 1] << '\n';
}



Compiler output:
a.cc:7:1: error: 'map' does not name a type
    7 | map<int, int>mp;
      | ^~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |         cin >> n >> m;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:23:21: error: 'mp' was not declared in this scope; did you mean 'tmp'?
   23 |                 if (mp[tmp]) mp[tmp] = min(w, mp[tmp]);
      |                     ^~
      |                     tmp
a.cc:23:40: error: 'min' was not declared in this scope; did you mean 'std::min'?
   23 |                 if (mp[tmp]) mp[tmp] = min(w, mp[tmp]);
      |                                        ^~~
      |                                        std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:27:31: error: 'mp' was not declared in this scope; did you mean 'm'?
   27 |                 for (auto v : mp) {
      |                               ^~
      |                               m
a.cc:28:43: error: 'min' was not declared in this scope; did you mean 'std::min'?
   28 |                         dp[i | v.first] = min(dp[i] + v.second, dp[i | v.first]);
      |                                           ^~~
      |                                           std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:31:45: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |         if (dp[(1 << n) - 1] == 0x3f3f3f3f) cout << -1 << '\n';
      |                                             ^~~~
      |                                             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:32:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   32 |         else cout << dp[(1 << n )- 1] << '\n';
      |              ^~~~
      |              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~