Submission #1184917

#TimeUsernameProblemLanguageResultExecution timeMemory
1184917sanoScales (IOI15_scales)C++20
45.45 / 100
0 ms328 KiB
//#pragma GCC optimize("O3")
//#pragma GCC target("tune=native")
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

#include "scales.h"
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<fstream>
#include<algorithm>
#include <iomanip>
#include<map>
#include <set>
#include <unordered_map>
#include <stack>
#include <unordered_set>
#include <cmath>
#include <cstdint>
#include <cassert>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define shit short int
#define ll long long
//#define int ll
#define For(i, n) for(int i = 0; i < (int)n; i++)
#define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define rfor(i, n) for(int i = (int)n; i >= (int)0; i--)
#define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--)
#define vec vector
#define ff first
#define ss second
#define pb push_back
#define pii pair<int, int>
#define NEK 2000000000
#define mod 1000000007
#define mod2 1000000009
#define rsz resize
#define prv1 47
#define prv2 43
#define D 8
#define trav(a,x) for (auto& a: x)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define all(x) (x).begin(), (x).end()
#define sig 0.0000001

using namespace std;
//using namespace __gnu_pbds;

//template <typename T1, typename T2>
//using indexed_set = tree<pair<T1, T2>, null_type, less<pair<T1, T2>>, rb_tree_tag, tree_order_statistics_node_update>;

void init(int t) {
	return;
}
/*
vec<int> spravne;

int getHeaviest(int a, int b, int c) {
	For(i, spravne.size()) {
		if (spravne[i] == a) return a;
		if (spravne[i] == b) return b;
		if (spravne[i] == c) return c;
	}
	return -1;
}

int getLightest(int a, int b, int c) {
	rfor(i, spravne.size() - 1) {
		if (spravne[i] == a) return a;
		if (spravne[i] == b) return b;
		if (spravne[i] == c) return c;
	}
	return -1;
}

void vypis(int p[]) {
	for (auto i : spravne) cout << i << ' ';
	cout << '\n';
	For(i, spravne.size()) cout << p[i] << ' ';
	cout << '\n' << '\n';
	return;
}

void answer(int p[]) {
	For(i, spravne.size()) {
		if (spravne[i] != p[i]) {
			vypis(p);
			return;
		}
	}
	return;
}

*/
void orderCoins() {
	int n = 6;
	vec<int> p = { 1, 2, 3, 4, 5, 6 };
	For(i, n - 2) {
		int som = i;
		for (int j = i + 1; j < n; j += 2) {
			int j2 = j + 1;
			if (j2 >= n) j2 = j - 1;
			int novy = getHeaviest(p[i], p[j], p[j2]);
			if (novy == p[i]) continue;
			if (novy == p[j]) {
				swap(p[i], p[j]);
			}
			if (novy == p[j2]) {
				swap(p[i], p[j2]);
			}
		}
	}
	int novy = getLightest(p[n - 1], p[n - 2], p[n - 3]);
	if (novy == p[n - 2]) swap(p[n - 1], p[n - 2]);
	int p2[6];
	For(i, n) p2[i] = p[n - i - 1];
	answer(p2);
	return;
}
/*
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int t; t = 1;
	init(t);
	spravne = { 1, 2, 3, 4, 5, 6 };
	while(1) {
		orderCoins();
		if (!next_permutation(all(spravne))) break;
	}
	return 0;
}*/
#Verdict Execution timeMemoryGrader output
Fetching results...