Time Exceeded
Code
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int t;
cin >> t;
vector<int> arr;
while (t--)
{
int n;
cin >> n;
arr.push_back(n);
}
int q;
cin >> q;
while (q--)
{
int x;
cin >> x;
int p = 0;
int minx = arr[p];
for (int i = 1; i < arr.size(); i++)
{
if (minx > arr[i])
{
minx = arr[i];
p = i;
}
}
arr[p] = x;
cout << p + 1 << endl;
}
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:55:08
- Judged At
- 2024-10-03 13:29:30
- Judged By
- Score
- 60
- Total Time
- ≥1054ms
- Peak Memory
- ≥1.098 MiB