# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
252705 | VEGAnn | Geppetto (COCI15_geppetto) | C++14 | 231 ms | 504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |