Submission #1335391

#TimeUsernameProblemLanguageResultExecution timeMemory
1335391blackscreen1Art Collections (BOI22_art)C++20
100 / 100
680 ms484 KiB
#include "art.h"
#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;
typedef tree<long long, null_type, less<long long>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;
typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_multiset;
#define ll long long
#define iloop(m, h) for (auto i = m; i != h; i += (m < h ? 1 : -1))
#define jloop(m, h) for (auto j = m; j != h; j += (m < h ? 1 : -1))
#define kloop(m, h) for (auto k = m; k != h; k += (m < h ? 1 : -1))
#define lloop(m, h) for (auto l = m; l != h; l += (m < h ? 1 : -1))
#define pll pair<ll, ll>
#define INF 1000000000000000
#define MOD1 1000000007
#define MOD2 998244353
#define MOD3 1000000009
void solve(int N) {
	ll n = N, t1, t2;
    vector<int> order;
    vector<int> res(n, 0);
    bool used[n];
    memset(used, 0, sizeof(used));
    iloop(0, n) {order.push_back(i+1);}
    t1 = publish(order);
    iloop(0, n-1) {
		order.clear();
		jloop(i+1, 0) order.push_back(n - j + 1);
		jloop(0, n-i-1) order.push_back(j+1);
		t2 = publish(order);
		res[(n - 1 + t2 - t1)/2] = n-i;
		t1 = t2;
	}
	iloop(0, n) if (res[i] == 0) res[i] = 1;
	answer(res);
}
#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...