Submission
Status:
[PP][PP][PPP][-SS][PPP][PPPPP][PPPP-SS][PPPP][PPPP][PPPPP]
Subtask/Task Score:
{10/10}{10/10}{10/10}{0/10}{10/10}{10/10}{0/10}{10/10}{10/10}{10/10}
Score: 80
User: sulinx
Problemset: ช่องบนไม้
Language: cpp
Time: 0.038 second
Submitted On: 2025-09-25 17:34:20
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,W,L,tmpn,tmp;
cin >> N >> W >> L;
int hole[W+L+L] = {0};
for(int i = 0;i<N;i++){
cin >> tmpn;
for(int j = 0;j<tmpn;j++){
cin >> tmp;
tmp = tmp + L;
hole[tmp]++;
for(int k = -L;k<=L;k++){
if(k!=0){
hole[tmp+k]++;
}
}
}
}
for(int i = 0;i<W+L+L;i++){
if(hole[i]>=N){
cout << 1;
return 0;
}
}
cout << 0;
}