# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
902395 | pcc | Exercise Deadlines (CCO20_day1problem2) | C++14 | 423 ms | 22712 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>
#include <bits/extc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
#define ordered_set(T) tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>
ordered_set(int) st,pos;
const int mxn = 2e5+10;
int arr[mxn];
std::priority_queue<pii,vector<pii>,less<pii>> pq;
int N;
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>N;
for(int i = 1;i<=N;i++)cin>>arr[i],pos.insert(i),pq.push(make_pair(arr[i],i));
ll ans = 0;
while(!pos.empty()){
int now = pos.size();
while(!pq.empty()&&pq.top().fs>=now){
if(pos.find(pq.top().sc) != pos.end()){
st.insert(pq.top().sc);
pq.pop();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |