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-11-11 03:16:56
- Judged By
- Score
- 60
- Total Time
- ≥1092ms
- Peak Memory
- ≥1.074 MiB