Submission #960490

#TimeUsernameProblemLanguageResultExecution timeMemory
960490IsamGeppetto (COCI15_geppetto)C++17
80 / 80
392 ms596 KiB
#include<bits/stdc++.h> using namespace std; int n, m, ans; vector<int> tmp; unordered_map<int, bool> mp[22]; 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] = true, 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(register int i = 0; i < (int)tmp.size(); ++i){ for(register int j = i + 1; j < (int)tmp.size(); ++j){ flag &= !mp[tmp[i]][tmp[j]]; } } ans += flag; } cout << ans << '\n'; return 0; }

Compilation message (stderr)

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){
      |                    ^
geppetto.cpp:24:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   24 |   for(register int i = 0; i < (int)tmp.size(); ++i){
      |                    ^
geppetto.cpp:25:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 |    for(register int j = i + 1; j < (int)tmp.size(); ++j){
      |                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...