Submission #707447

#TimeUsernameProblemLanguageResultExecution timeMemory
707447Chal1shkanKnjige (COCI20_knjige)C++14
Compilation error
0 ms0 KiB
# include <bits/stdc++.h> # define pb push_back # define ff first # define ss second # define nl "\n" # define sz(x) ((int)(x).size()) # define deb(x) cerr << #x << " = " << x << endl; # define pll pair <ll, ll> typedef long long ll; typedef unsigned long long ull; typedef long double ld; const ll maxn = 2e5 + 25; const ll inf = 2e9 + 0; const ll mod = 1e9 + 123; const ll dx[] = {-1, 1, 0, 0}; const ll dy[] = {0, 0, -1, 1}; using namespace std; int n; void ma1n (/* SABR */) { cin >> n; multiset <int> qw; deque <int> q1, q2; for (int i = 1, x; i <= n; ++i) { cin >> x; q1.pb(x); qw.insert(x); } deque <int> cur; vector <string> ans; while (!q1.empty()) { // deque <int> out = q1; // while (!out.empty()) // { // cout << out.front() << ' '; // out.pop_front(); // } // cout << nl; int need = *qw.rbegin(); while (!q1.empty() && q1.front() != need) { string s = "UZMI L L"; ans.pb(s); s = "STAVI L D"; ans.pb(s); cur.push_front(q1.front()); q1.pop_front(); } string s = "UZMI D L"; ans.pb(s); q1.pop_front(); while (!cur.empty()) { s = "UZMI L D"; ans.pb(s); s = "STAVI L L"; ans.pb(s); q1.push_front(cur.front()); cur.pop_front(); } s = "STAVI D D"; ans.pb(s); qw.erase(qw.find(need)); } while (n--) { s = "UZMI D D"; ans.pb(s); s = "STAVI D L"; ans.pb(s); } cout << sz(ans) << nl; for (string x : ans) cout << x << nl; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); // freopen("file.in", "r", stdin); // freopen("file.out", "w", stdout); int ttt = 1; // cin >> ttt; for (int test = 1; test <= ttt; ++test) { // cout << "Case " << test << ":" << ' '; ma1n(); } return 0; }

Compilation message (stderr)

Main.cpp: In function 'void ma1n()':
Main.cpp:75:3: error: 's' was not declared in this scope
   75 |   s = "UZMI D D";
      |   ^