/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 536.0 KiB
#2 Accepted 217ms 736.0 KiB
#3 Accepted 532ms 884.0 KiB
#4 Accepted 529ms 876.0 KiB
#5 Time Exceeded ≥1087ms ≥940.0 KiB
#6 Time Exceeded ≥1081ms ≥944.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
int slv_by_payel(int n)
{
    vector<int> samp(n); 

    for (int i = 0; i < n; i++)
    {
        cin >> samp[i];
    }
    
    int q;
    cin >> q;

    while (q--) 
    {
        int x;
        cin >> x;
        
        int min = 0;
        for (int i = 1; i < n; i++)
        {
            if (samp[i] < samp[min])
            {
                min = i;
            }
        }

        cout << min + 1 << endl;
        
        samp[min] = x;
    }

    return 0;
}
int main()
{
    //int tc;
    //cin>>tc;
    //while(tc--)
    //{
        int n;
        cin>>n;
        slv_by_payel(n);
    //    cout<<reslt<<endl;
    //}
 
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1086 KuZ the Position
Language
C++17 (G++ 13.2.0)
Submit At
2024-08-16 18:28:22
Judged At
2024-11-11 03:10:36
Judged By
Score
60
Total Time
≥1087ms
Peak Memory
≥944.0 KiB