Submission

Status:
[PP][PP][PPP][P-S][PPP][PPPPP][PPPP-SS][PPPP][PPPP][PPPPP]

Score: 80

User: mister_o_hater_no1

Problemset: ช่องบนไม้

Language: cpp

Time: 0.037 second

Submitted On: 2025-04-19 12:38:54

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, w, l, k;cin>> n>>w >>l;
	vector<int> lh(w+ 5, 0);
	for(int i= 0; i< n; ++i){
		cin>>k;
		int h;
		for(int j= 0; j< k; ++j){
			cin>> h;
			for(int g= h- l- 1; g< h+ l; ++g){
				if(g>= 0 && g< w){
					++lh[g];
				}
			}
		}
	}
//	for(int c : lh){
//		cout<< c<< " ";
//	}
//	cout<< endl;
	for(int i= 0; i< w; ++i){
		if(lh[i]== n){
			cout<< "1";
			return 0;
		}
	}
	cout<< "0";
		
	return 0;
}