# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
139718 | mlyean00 | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++14 | 1064 ms | 424 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 <bits/stdc++.h>
#ifdef DEBUG
#include "debug.hpp"
#else
#pragma GCC optimize("Ofast")
#define trace(...)
#include <bits/stdc++.h>
#define endl '\n'
#endif
using namespace std;
const string COL = "RGY";
int count_swaps(string s, string const& t) {
int n = s.length();
int ans = 0;
for (int i = 0; i < n; ++i) {
int j;
for (j = i; j < n; ++j) {
if (s[j] == t[i]) break;
}
if (j == n) return INT_MAX;
for (; j > i; --j) {
++ans;
swap(s[j], s[j - 1]);
}
}
return ans;
}
# | 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... |