| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 82988 | l_zg | Geppetto (COCI15_geppetto) | C++14 | 122 ms | 720 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <cstdio>
using namespace std;
int a[405],b[405],x[20],sol;
int main(){
	int n,m;
	cin >> n >> m;
	
	for( int i = 0; i < m; i ++ ){
		int x,y;
		cin >> x >> y;
		a[i] = max(x,y);
		b[i] = min(x,y);
	}
	
	for ( int i = 0; i < ( 1 << n ); i ++ ){
		
		int t = 1;
		
		for ( int j = 0; j < n; j ++ ){
			if ( i & ( 1 << j ) ) x[j] = 1;
		}
		
		for ( int j = 0; j < m; j ++ ){
			if ( x[a[j] - 1 ] && x[b[j] - 1] ){
				t = 0;
				break;
			}
		}
		
		for ( int j = 0; j < n; j ++ ) {
//			cout << x[j] << " ";
			x[j] = 0;
		}
//		
//		cout << t << endl;
		
		sol += t;
	}
	
	cout << sol;
	
return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
