#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#define double long double
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000007
#define PI 3.14159265359
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005ll
#define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,m,a[5005];
struct kth{
int l,r,value,k;
};
kth b[100005];
int32_t main(){
CODE_START;
cin>>n>>m;
for(ll i=1;i<=n;i++)
{
a[i]=-1;
}
for(ll i=1;i<=n;i++)
{
cin>>b[i].l>>b[i].r>>b[i].k>>b[i].value;
if(b[i].value==0){
ll j=b[i].l;
if(a[j]==1){
rc("-1");
}else a[j]=0;
}else if(b[i].value==1){
for(ll j=b[i].l;j<=b[i].r;j++)
{
if(a[j]==0){
rc("-1");
}
a[j]=1;
}
}
}
for(ll i=1;i<=n;i++)
{
if(a[i]==-1){
a[i]=1;
}
}
for(ll i=1;i<=n;i++)
{
cout<<a[i]<<' ';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
620 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
620 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |