# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1006492 | 2024-06-24T02:35:56 Z | vjudge1 | Knjige (COCI20_knjige) | C++17 | 26 ms | 1492 KB |
#include<bits/stdc++.h> using namespace std; const int N = 105; vector<int> a; string space = " ", take = "UZMI", put = "STAVI", lft = "L", rht = "D"; vector<string> sol; int n; void SORT(vector<int> v) { //cerr << v.size() << endl; //for(auto x : v) //cout << x << ' '; //cout << endl; if(v.size() <= 1) return; vector<int> vp; int l = v.back(); sol.push_back(take + space + lft + space + rht); for(int j = v.size() - 2; j >= 0; j--) { sol.push_back(take + space + rht + space + rht); int r = a[j]; if(l > r) { vp.push_back(l); sol.push_back(put + space + lft + space + lft); sol.push_back(put + space + rht + space + lft); sol.push_back(take + space + lft + space + lft); l = r; } else { vp.push_back(r); sol.push_back(put + space + rht + space + lft); } } for(int i = 0; i < vp.size(); i++) { sol.push_back(take + space + rht + space + lft); sol.push_back(put + space + rht + space + rht); } sol.push_back(put + space + lft + space + lft); reverse(vp.begin(), vp.end()); SORT(vp); } int main() { cin >> n; a.resize(n); for(int i = 0; i < n; i ++) cin >> a[i]; for(int i = 0; i < n; i ++) { sol.push_back(take); sol.back() += space + lft + space + lft; sol.push_back(put); sol.back() += space + lft + space + rht; } SORT(a); cout << sol.size() << endl; for(auto s : sol) cout << s << endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 1492 KB | Wrong configuration |
2 | Incorrect | 22 ms | 1488 KB | Wrong configuration |
3 | Incorrect | 22 ms | 1492 KB | Wrong configuration |
4 | Incorrect | 22 ms | 1492 KB | Wrong configuration |
5 | Incorrect | 22 ms | 1492 KB | Wrong configuration |
6 | Incorrect | 26 ms | 1488 KB | Wrong configuration |
7 | Incorrect | 22 ms | 1492 KB | Wrong configuration |
8 | Incorrect | 22 ms | 1492 KB | Wrong configuration |
9 | Incorrect | 22 ms | 1492 KB | Wrong configuration |
10 | Incorrect | 24 ms | 1492 KB | Wrong configuration |