Advertisement
ivnikkk

Untitled

Mar 17th, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.37 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #define debug(l) cerr<<" smotri huinyi : "<<#l<<' '<<l<<'\n';
  3. #include "bits/stdc++.h"
  4. using namespace std;
  5. #define all(a) a.begin(), a.end()
  6. typedef long long ll;
  7. typedef long double ld;
  8. signed main() {
  9. #ifdef _DEBUG
  10.     freopen("input.txt", "r", stdin);
  11.     freopen("output.txt", "w", stdout);
  12. #endif
  13.     ios_base::sync_with_stdio(false);
  14.     cin.tie(nullptr);
  15.     srand(time(NULL));
  16.     ll n;
  17.     cin >> n;
  18.     ll a[10];
  19.     for (ll i = 0; i < 10; i++) {
  20.         a[i] = 0;
  21.     }
  22.     ll d = 0;
  23.     while (n > 0) {
  24.         a[d++] = n % 8;
  25.         n /= 8;
  26.     }
  27.     for (ll i = 9; i >= 0; i--) {
  28.         cout << a[i];
  29.     }
  30.     //ll t = 1;
  31.     //cin >> t;
  32.     //while (t--) {
  33.     //  ll n, m;
  34.     //  cin >> n >> m;
  35.     //  vector<ll>a(n);
  36.     //  for (ll i = 0; i < n; ++i) {
  37.     //      cin >> a[i];
  38.     //      a[i]--;
  39.     //  }
  40.     //  struct Info {
  41.     //      ll t, per;
  42.     //      ll ind;
  43.     //  };
  44.     //  vector<vector<Info>> op(n);
  45.     //  for (ll i = 0; i < m; i++) {
  46.     //      ll e, t, p;
  47.     //      cin >> e >> t >> p;
  48.     //      op[--e].push_back({ t,p, i + 1 });
  49.     //  }
  50.     //  ll last_t = 0;
  51.     //  const ll inf = 1e10;
  52.     //  bool ok = true;
  53.     //  vector<ll> ans;
  54.     //  for (ll i = 0; i < n; i++) {
  55.     //      ll C = a[i] - last_t;
  56.     //      vector<vector<ll>> dp(op[i].size() + 1, vector<ll>(201, inf));
  57.     //      for (ll k = 0; k <= op[i].size(); k++) {
  58.     //          dp[k][0] = 0;
  59.     //      }
  60.     //      for (ll k = 1; k <= op[i].size(); k++) {
  61.     //          for (ll j = 0; j <= 200; j++) {
  62.     //              dp[k][j] = dp[k - 1][j];
  63.     //              if (op[i][k - 1].per <= j) {
  64.     //                  dp[k][j] = min(dp[k][j], dp[k][j - op[i][k - 1].per] + op[i][k - 1].t);
  65.     //                  //debug(dp[k][j]);
  66.     //              }
  67.     //          }
  68.     //      }
  69.     //      ll now_ans = inf;
  70.     //      ll per = 0;
  71.     //      for (ll j = 100; j <= 200; j++) {
  72.     //          if (now_ans > dp[op[i].size()][j]) {
  73.     //              now_ans = dp[op[i].size()][j];
  74.     //              per = j;
  75.     //          }
  76.     //      }
  77.  
  78.     //      debug(now_ans);
  79.     //     
  80.     //      if (now_ans == inf || now_ans > C) {
  81.     //          ok = false;
  82.     //          break;
  83.     //      }
  84.     //      else {
  85.     //          ll it = op[i].size(), j = per;
  86.     //          while (j != 0 && it >= 1) {
  87.     //              if (dp[it - 1][j] == dp[it][j]) {
  88.     //                  it--;
  89.     //              }
  90.     //              else {
  91.     //                  ans.push_back(op[i][it - 1].ind);
  92.     //                  j -= op[i][it - 1].per;
  93.     //                  it--;
  94.     //              }
  95.     //          }
  96.     //      }
  97.     //      last_t += now_ans;
  98.     //  }
  99.     //  if (ok) {
  100.     //      cout << (ll)ans.size() << '\n';
  101.     //      for (ll& i : ans) {
  102.     //          cout << i << ' ';
  103.     //      }
  104.     //      cout << '\n';
  105.     //  }
  106.     //  else {
  107.     //      cout << -1 << '\n';
  108.     //  }
  109.     //}
  110. }
  111.  
  112.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement