/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Time Exceeded ≥1090ms ≥324.0 KiB
#3 Time Exceeded ≥1090ms ≥532.0 KiB
#4 Time Exceeded ≥1097ms ≥532.0 KiB
#5 Accepted 130ms 18.52 MiB
#6 Accepted 133ms 18.555 MiB

Code

#include <bits/stdc++.h>
#include <cmath>
#include <bitset>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>pbds;
#define ll  long long  int
#define yes printf("Yes\n")
#define no printf("No\n")
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) ((a*b)/gcd(a,b))
#define pi acos(-1.00)
const int mod=1000000007;
void evan() {
 
}
signed main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(nullptr);
   //int t=1;
   //cin>>t;
  //for(int i=1;i<=t;i++) evan();
  ll n;
 scanf("%lld", &n);
 ll a[n+1];
 map<ll,ll>m;
 multiset<ll>s;
 for(int i=1;i<=n;i++){
   scanf("%lld", &a[i]);
   m[a[i]]=i;
   s.insert(a[i]);
 }
 ll q;
 scanf("%lld", &q);
 while(q--){
   ll x;
   scanf("%lld", &x);
   auto it=s.begin();
   ll xx=*it;
   printf("%lld\n", m[xx]);
   m[x]=xx;
   s.erase(it);
 }
}

Information

Submit By
Type
Submission
Problem
P1086 KuZ the Position
Contest
Bangladesh 2.0
Language
C++20 (G++ 13.2.0)
Submit At
2024-08-16 15:54:36
Judged At
2024-10-03 13:29:32
Judged By
Score
50
Total Time
≥1097ms
Peak Memory
≥18.555 MiB