Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
1.2 kB
2
Indexable
Never
#include "bits/stdc++.h"
using namespace std;

using ll = long long;
using ull = unsigned long long;
using db = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<db, db>;
using tiii = tuple<int, int, int>;
using str = string;

#define vt vector
#define pb push_back
#define eb emplace_back
#define ins insert
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

void solve() {
    int n = 250;
    vt<int> p(n);
    iota(all(p), 1);
    random_shuffle(all(p));
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j <= n - i; j++) {
            ans += *max_element(p.begin() + j, p.begin() + j + i);
        }
    }
    cout << n << '\n';
    for (int &g : p) cout << g << ' ';
    cout << '\n';
    cout << ans;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    int tests = 1;
    // cin >> tests;
    while (tests--) {
        solve();
    }
    return 0;
}