Submission #388442

# Submission time Handle Problem Language Result Execution time Memory
388442 2021-04-11T14:41:32 Z phathnv Knjige (COCI20_knjige) C++11
0 / 50
5 ms 1664 KB
#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("UZMI 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
1 Incorrect 5 ms 1608 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
2 Incorrect 5 ms 1664 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
3 Incorrect 5 ms 1608 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
4 Incorrect 5 ms 1608 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
5 Incorrect 5 ms 1608 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
6 Incorrect 5 ms 1588 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
7 Incorrect 4 ms 1484 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
8 Incorrect 5 ms 1608 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
9 Incorrect 5 ms 1608 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"
10 Incorrect 5 ms 1608 KB Token "UMIZ" doesn't correspond to pattern "(UZMI|STAVI)"