Submission #960485

# Submission time Handle Problem Language Result Execution time Memory
960485 2024-04-10T14:09:59 Z Isam Geppetto (COCI15_geppetto) C++17
16 / 80
1000 ms 596 KB
#include<bits/stdc++.h>
using namespace std;

int n, m, ans;

vector<int> tmp;

map<pair<int, int>, bool> mp;

signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n >> m;
	for(register int i = 1, u, v; i <= m; ++i){
		cin >> u >> v;
		mp[{u, v}] = mp[{v, u}] = true;
	}
	for(register int mask = 0; mask < (1 << n); ++mask){
		tmp.clear();
		for(register int i = 1; i <= n; ++i){
			if(mask & (1 << (i - 1))) tmp.emplace_back(i);
		}
		bool flag = true;
		
		for(auto to : tmp){
			for(auto toto : tmp){
				flag &= !mp[{to, toto}];
			}
		}
		
		ans += flag;
		
	}
	cout << ans << '\n';
	return 0;
}

Compilation message

geppetto.cpp: In function 'int main()':
geppetto.cpp:13:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |  for(register int i = 1, u, v; i <= m; ++i){
      |                   ^
geppetto.cpp:13:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |  for(register int i = 1, u, v; i <= m; ++i){
      |                          ^
geppetto.cpp:13:29: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |  for(register int i = 1, u, v; i <= m; ++i){
      |                             ^
geppetto.cpp:17:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |  for(register int mask = 0; mask < (1 << n); ++mask){
      |                   ^~~~
geppetto.cpp:19:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   19 |   for(register int i = 1; i <= n; ++i){
      |                    ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Execution timed out 1058 ms 348 KB Time limit exceeded
4 Execution timed out 1027 ms 452 KB Time limit exceeded
5 Execution timed out 1027 ms 344 KB Time limit exceeded
6 Execution timed out 1036 ms 344 KB Time limit exceeded
7 Execution timed out 1058 ms 460 KB Time limit exceeded
8 Execution timed out 1065 ms 596 KB Time limit exceeded
9 Execution timed out 1042 ms 444 KB Time limit exceeded
10 Execution timed out 1053 ms 452 KB Time limit exceeded