답안 #270539

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
270539 2020-08-17T17:49:27 Z eohomegrownapps Restore Array (RMI19_restore) C++14
7 / 100
14 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

int n,m;

void subtask1(){
	int l[200];
	int r[200];
	int k[200];
	int v[200];
	for (int i = 0; i<m; i++){
		cin>>l[i]>>r[i]>>k[i]>>v[i];
	}
	for (int i = 0; i<(1<<n); i++){
		//cout<<"check\n";
		bool works = true;
		for (int j = 0; j<m; j++){
			int cnt0 = 0;
			for (int x = l[j]; x<=r[j]; x++){
				if ((1<<x)&i){
					continue;
				} else {
					cnt0++;
				}
			}
			//cout<<l[j]<<' '<<r[j]<<' '<<cnt0<<'\n';
			if (!((v[j]&&cnt0<k[j])||((!v[j])&&cnt0>=k[j]))){
				works=false;
				break;
			}
		}
		if (works){
			for (int x = 0; x<n; x++){
				cout<<bool((1<<x)&i)<<' ';
			}cout<<'\n';
			return;
		}
	}
	cout<<-1<<'\n';
	return;
}

int main(){
	cin>>n>>m;
	if (n<=18){
		subtask1();
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 14 ms 256 KB Output is correct
6 Correct 10 ms 256 KB Output is correct
7 Correct 3 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 14 ms 256 KB Output is correct
6 Correct 10 ms 256 KB Output is correct
7 Correct 3 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
11 Incorrect 0 ms 256 KB Unexpected end of file - int32 expected
12 Halted 0 ms 0 KB -