Time Exceeded
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, q;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
int ind = min_element(v.begin(), v.end()) - v.begin();
cin >> q;
while ( q-- )
{
int x ; cin>> x ;
cout << ind + 1 << '\n';
v[ind] = x ;
ind = min_element(v.begin(), v.end()) - v.begin();
}
return 0;
}
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:48:21
- Judged At
- 2024-10-03 13:29:50
- Judged By
- Score
- 60
- Total Time
- ≥1064ms
- Peak Memory
- ≥952.0 KiB