| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 252705 | VEGAnn | Geppetto (COCI15_geppetto) | C++14 | 231 ms | 504 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define PB push_back
using namespace std;
typedef long long ll;
const int N = 22;
bool bad[N][N];
int n, m, ans;
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
    freopen("in.txt","r",stdin);
#endif // _LOCAL
    cin >> n >> m;
    for (int i = 0; i < m; i++){
        int x, y; cin >> x >> y;
        x--; y--;
        bad[x][y] = bad[y][x] = 1;
    }
    for (int msk = 0; msk < (1 << n); msk++){
        bool ok = 1;
        for (int i = 0; i < n && ok; i++){
            if (!(msk & (1 << i))) continue;
            for (int j = i + 1; j < n && ok; j++){
                if (!(msk & (1 << j))) continue;
                if (bad[i][j])
                    ok = 0;
            }
        }
        ans += ok;
    }
    cout << ans;
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
