/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Wrong Answer 213ms 712.0 KiB
#3 Wrong Answer 213ms 940.0 KiB
#4 Wrong Answer 212ms 756.0 KiB
#5 Accepted 252ms 2.562 MiB
#6 Accepted 264ms 2.488 MiB

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    //cin>>t;
    //while(t--)
    //{
       long long n;
       cin>>n;
       vector<pair<long long,long long>>v(n);
       for(int i=0;i<n;i++)
       {


         long long p;
         cin>>p;
         v[i]=make_pair(p,i);
       }


        sort(v.begin(),v.end());

       long long q;
       cin>>q;

       long long minn=10000000000;
       long long ind=-1;

       long long j=0;

       for(int i=0;i<q;i++)
       {
           long long temp;
           cin>>temp;

           if(v[j].first<=minn&&j<n)
           {
               //cout<<"YES"<<endl;
               cout<<v[j].second+1<<endl;
               if(temp<minn)
               {
                   ind=v[j].second;
               }
               minn=min(minn,temp);
               j++;
           }
           else
           {
               cout<<ind+1<<endl;

               if(temp<minn)
               {
                   ind=ind;
               }

               minn=min(temp,minn);




           }

       }




    //}
}


Information

Submit By
Type
Submission
Problem
P1086 KuZ the Position
Contest
Bangladesh 2.0
Language
C++11 (G++ 13.2.0)
Submit At
2024-08-16 17:42:20
Judged At
2024-10-03 13:21:06
Judged By
Score
50
Total Time
264ms
Peak Memory
2.562 MiB