# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
413639 | vato_chachanidze | Event Hopping 2 (JOI21_event2) | C++14 | 89 ms | 4916 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
long long n,k,i,finish,r[100009],l[100009],q;
vector<long long> ans;
int main()
{
cin>>n>>k;
for(i=1;i<=n;i++)
{
cin>>r[i]>>l[i];
}
finish=l[1];
q=1;
ans.push_back(1);
for(i=2;i<=n;i++)
{
if(q==k)
{
break;
}
if(finish>r[i])
{
continue;
}
finish=l[i];
q++;
ans.push_back(i);
}
if(q!=k)
{
cout<<"-1";
}
else
{
for(i=0;i<ans.size();i++)
{
cout<<ans[i]<<endl;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |