Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #define debug(l) cerr<<" smotri huinyi : "<<#l<<' '<<l<<'\n';
- #include "bits/stdc++.h"
- using namespace std;
- #define all(a) a.begin(), a.end()
- typedef long long ll;
- typedef long double ld;
- signed main() {
- #ifdef _DEBUG
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- srand(time(NULL));
- ll n;
- cin >> n;
- ll a[10];
- for (ll i = 0; i < 10; i++) {
- a[i] = 0;
- }
- ll d = 0;
- while (n > 0) {
- a[d++] = n % 8;
- n /= 8;
- }
- for (ll i = 9; i >= 0; i--) {
- cout << a[i];
- }
- //ll t = 1;
- //cin >> t;
- //while (t--) {
- // ll n, m;
- // cin >> n >> m;
- // vector<ll>a(n);
- // for (ll i = 0; i < n; ++i) {
- // cin >> a[i];
- // a[i]--;
- // }
- // struct Info {
- // ll t, per;
- // ll ind;
- // };
- // vector<vector<Info>> op(n);
- // for (ll i = 0; i < m; i++) {
- // ll e, t, p;
- // cin >> e >> t >> p;
- // op[--e].push_back({ t,p, i + 1 });
- // }
- // ll last_t = 0;
- // const ll inf = 1e10;
- // bool ok = true;
- // vector<ll> ans;
- // for (ll i = 0; i < n; i++) {
- // ll C = a[i] - last_t;
- // vector<vector<ll>> dp(op[i].size() + 1, vector<ll>(201, inf));
- // for (ll k = 0; k <= op[i].size(); k++) {
- // dp[k][0] = 0;
- // }
- // for (ll k = 1; k <= op[i].size(); k++) {
- // for (ll j = 0; j <= 200; j++) {
- // dp[k][j] = dp[k - 1][j];
- // if (op[i][k - 1].per <= j) {
- // dp[k][j] = min(dp[k][j], dp[k][j - op[i][k - 1].per] + op[i][k - 1].t);
- // //debug(dp[k][j]);
- // }
- // }
- // }
- // ll now_ans = inf;
- // ll per = 0;
- // for (ll j = 100; j <= 200; j++) {
- // if (now_ans > dp[op[i].size()][j]) {
- // now_ans = dp[op[i].size()][j];
- // per = j;
- // }
- // }
- // debug(now_ans);
- //
- // if (now_ans == inf || now_ans > C) {
- // ok = false;
- // break;
- // }
- // else {
- // ll it = op[i].size(), j = per;
- // while (j != 0 && it >= 1) {
- // if (dp[it - 1][j] == dp[it][j]) {
- // it--;
- // }
- // else {
- // ans.push_back(op[i][it - 1].ind);
- // j -= op[i][it - 1].per;
- // it--;
- // }
- // }
- // }
- // last_t += now_ans;
- // }
- // if (ok) {
- // cout << (ll)ans.size() << '\n';
- // for (ll& i : ans) {
- // cout << i << ' ';
- // }
- // cout << '\n';
- // }
- // else {
- // cout << -1 << '\n';
- // }
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement