| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 388443 | phathnv | Knjige (COCI20_knjige) | C++11 | 5 ms | 1700 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 107;
int n, a[N];
vector<string> ans;
void Move(int x){
for(int i = 1; i < x; i++){
ans.push_back("UMIZ L L");
ans.push_back("STAVI L R");
}
ans.push_back("UMIZ D L");
for(int i = 1; i < x; i++){
ans.push_back("UMIZ L R");
ans.push_back("STAVI L L");
}
ans.push_back("STAVI D L");
for(int i = x; i > 1; i--)
swap(a[i], a[i - 1]);
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for(int i = 1; i <= n; i++)
cin >> a[i];
for(int i = 1; i <= n; i++){
int p = max_element(a + i, a + 1 + n) - a;
Move(p);
}
cout << ans.size() << '\n';
for(string s : ans)
cout << s << '\n';
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
