[语言月赛 202412] 顽强拼搏奖的四种发法
#include<bits/stdc++.h>
using namespace std;
int vis[1001][1001];
int arr[1001];
int main(){
int tid,pid,state;
int n,t,p,k;
cin>>n>>t>>p>>k;
for(int i=1;i<=n;i++){
cin>>tid>>pid>>state;
if(vis[tid][pid]==0&&state==1){
arr[tid]++;
vis[tid][pid]=1;
}
if(vis[tid][pid]==1&&state==0){
vis[tid][pid]=0;
}
}
for(int i=1;i<=t;i++){
if(arr[i]>=k){
cout<<i<<" ";
}
else{
if(vis[i][1]==1){
cout<<i<<" ";
}
else{
cout<<"-1 ";
}
}
}
return 0;
}