Submission #495513

# Submission time Handle Problem Language Result Execution time Memory
495513 2021-12-19T08:27:10 Z oolimry Knjige (COCI20_knjige) C++17
0 / 50
3 ms 1488 KB
#include<bits/stdc++.h>
using namespace std;

signed main(){
    ios::sync_with_stdio(false);cin.tie(0);
    
    int n; cin >> n;
    vector<int> L(n); 
    vector<int> R; 
    
    for(int i = 1;i <= n;i++) cin >> L[i];
    
    reverse(L.begin(),L.end());
    vector<string> ans;
    
    for(int iter = n;iter >= 2;iter--){
		for(int i = 0;i < iter;i++){
			if(L.back() == iter){
				ans.push_back("UZMI R L\n");
			}
			else{
				ans.push_back("UZMI L L\n");
				ans.push_back("STAVI L R\n");
				
				R.push_back(L.back());
			}
			
			L.pop_back();
		}
		
		ans.push_back("STAVI R L\n");
		
		while(not R.empty()){
			ans.push_back("UZMI L R\n");
			ans.push_back("STAVI L L\n");
			L.push_back(R.back());
			R.pop_back();
		}
	}
	
	cout << (int) ans.size() << '\n';
	
	for(string s : ans) cout << s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
2 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
3 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
4 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
5 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
6 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
7 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
8 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
9 Incorrect 2 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"
10 Incorrect 3 ms 1488 KB Token "R" doesn't correspond to pattern "(L|D)"