# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1013626 | vjudge1 | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 9074 ms | 3412 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define mod 1000000007LL
#define inf 1e17
#define ll long long
using namespace std;
void printvec(vector<int> vec)
{
for (auto &&e : vec)
{
cout << e << ' ';
}
cout << endl;
}
vector<int> countScans(vector<int> a, vector<int> x, vector<int> v)
{
vector<int> s;
multiset<int> a_sorted;
for (int i = 0; i < a.size(); i++)
{
a_sorted.insert(a[i]);
}
for (int j = 0; j < x.size(); j++)
{
a_sorted.erase(a_sorted.find(a[x[j]]));
a_sorted.insert(v[j]);
a[x[j]] = v[j];
// for (auto& e:a_sorted) cout << e << ' ';
// cout << endl;
map<ll,ll> ind;
ll i = 0;
for (auto it = a_sorted.begin(); it != a_sorted.end(); it++)
{
ind[*it] = i;
i++;
}
ll maxe = 0;
for (int i = 0; i < a.size(); i++)
{
if(i > ind[a[i]])
{
maxe = max(maxe, i - ind[a[i]]);
}
}
s.push_back(maxe);
}
return s;
}
// int main()
// {
// vector<int> A = {1, 2, 3, 4};
// vector<int> X = {0, 2};
// vector<int> V = {3, 1};
// vector<int> ans = countScans(A,X,V);
// printvec(ans);
// }
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |