/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Wrong Answer 212ms 592.0 KiB
#3 Wrong Answer 204ms 1.016 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-11-11 03:11:05
Judged By
Score
10
Total Time
212ms
Peak Memory
1.016 MiB