# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
902395 | pcc | Exercise Deadlines (CCO20_day1problem2) | C++14 | 423 ms | 22712 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |