Time Exceeded
Code
#include <bits/stdc++.h>
#define fast() ios::sync_with_stdio(false); cin.tie(0);
using namespace std;
#define ll long long int
#define ft first
#define se second
int main() {
fast()
ll N;
cin >> N;
vector<ll> v(N);
for (ll i = 0; i < N; i++) {
cin >> v[i];
}
ll Q;
cin >> Q;
while (Q--) {
ll X;
cin >> X;
ll min_val = 1e9;
ll min_index = -1;
for (ll i = 0; i < N; i++) {
if (v[i] < min_val) {
min_val = v[i];
min_index = i;
}
}
cout << min_index + 1 << endl;
v[min_index] = X;
}
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 16:01:43
- Judged At
- 2024-10-03 13:29:03
- Judged By
- Score
- 60
- Total Time
- ≥1093ms
- Peak Memory
- ≥1.352 MiB