제출 #1206910

#제출 시각아이디문제언어결과실행 시간메모리
1206910friendiksRotating Lines (APIO25_rotate)C++20
11 / 100
37 ms2424 KiB
#ifndef LOCAL
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC diagnostic ignored "-Wpedantic"
#endif

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rnd(52);
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename V>
using table = gp_hash_table<T, V>;

using i128 = __int128;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;

const ll INF = 2e18;
const int inf = 2e9;
const int maxn = 1e5;
const int MOD = 988244353;
const ld pi = acos(-1);
const int P = 5167;
const int L = 26;
const ld EPS = 1e-7;

template<typename T, typename V>
void fill(T &container, V value) {
    for (auto &c: container)
        c = value;
}

void rotate(vector<int> t, int x);

void energy(int n, vector<int> v) {
    vector<pair<int, int> > a(n);
    for (int i = 0; i < n; ++i) a[i] = {v[i], i};
    sort(a.begin(), a.end());
    int mx = -1;
    for (int i = 0; i < n; ++i) {
        if (a[n - 1].first - 25000 > a[i].first) mx = i;
    }
    if (mx >= 0) {
        vector<int> t;
        for (int i = 0; i <= mx; ++i) {
            t.push_back(a[i].second);
            a[i].first += 25000;
        }
        rotate(t, 25000);
        sort(a.begin(), a.end());
        t = {};
        int k = a[0].first;
        for (int i = 0; i < n; ++i) {
            t.push_back(a[i].second);
            a[i].first -= k;
        }
        rotate(t, 50000 - k);
        sort(a.begin(), a.end());
    }
    for (int i = 0; i < n / 2; ++i) {
        rotate({a[i].second}, 50000 - a[i].first);
    }
    for (int i = n - 1; i >= n / 2; --i) {
        rotate({a[i].second}, 25000 - a[i].first);
    }
}

void solve() {
}

signed main1() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(4);
    int t = 1;
    //cin >> t;
    while (t--) solve();
    //stress();
}

컴파일 시 표준 에러 (stderr) 메시지

rotate.cpp: In function 'int main1()':
rotate.cpp:92:1: warning: no return statement in function returning non-void [-Wreturn-type]
   92 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...