| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 548924 | SlyGaleeb | Mutating DNA (IOI21_dna) | C++17 | 41 ms | 2368 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ld long double
#define vf v[i].first
#define vs v[i].second
const ll MOD = 1e9 + 7;
void print(vector<ll> &v) {
for (auto c:v)
cout << c << " ";
cout << "\n";
}
int n;
string c,d;
void init(string a, string b) {
n = a.size();
c = a;
d = b;
}
int get_distance(int x, int y) {
int ans = 0;
string t1 = c.substr(x,y-x+1), t2 = d.substr(x,y-x+1);
sort(t1.begin(),t1.end());
sort(t2.begin(),t2.end());
if (t1!=t2)
return -1;
t1 = c.substr(x,y-x+1), t2 = d.substr(x,y-x+1);
int temp;
for (int i = 0; i < y-x+1; ++i) {
if (t1[i]!=t2[i]) {
for (int j = i; j < y-x+1; ++j) {
if (t1[j]==t2[i]) {
temp = j;
break;
}
}
swap(t1[i],t1[temp]);
++ans;
}
}
return ans;
}
/*int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string a,b;
cin >> a >> b;
init(a,b);
cout << get_distance(0,2);
}*/
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
