# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70975 | dmfr | Bubble Sort 2 (JOI18_bubblesort2) | C++11 | 9073 ms | 6640 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bubblesort2.h"
#include <set>
#include <algorithm>
//#include <iostream>
using namespace std;
class Number{
public:
int Val;
int OriginalPos;
Number(){}
Number(const int& Val_, const int& OriginalPos_): Val(Val_), OriginalPos(OriginalPos_){}
bool operator<(const Number& obj)const{
if(this->Val != obj.Val) return (this->Val < obj.Val);
else return (this->OriginalPos < obj.OriginalPos);
}
};
int solve(const set<Number>& NumberSet, vector<int>& dif){
const int& N = dif.size();
int min_ = 0;
set<Number>::iterator it = NumberSet.begin();
for(int i = 0; i < N; ++i, ++it){
min_ = min(min_, i - it->OriginalPos);
if(i - (N-1) > min_) break;
}
# | 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... |