# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1041682 | Ice_man | Scales (IOI15_scales) | C++14 | 1 ms | 436 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/**
____ ____ ____ __________________ ____ ____ ____
||I || ||c || ||e || || || ||M || ||a || ||n ||
||__|| ||__|| ||__|| ||________________|| ||__|| ||__|| ||__||
|/__\| |/__\| |/__\| |/________________\| |/__\| |/__\| |/__\|
*/
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include "scales.h"
#define maxn 200005
#define maxr 25005
#define maxlog 20
#define INF 1000000010
#define LINF 100000000000000000
#define pb(x) push_back(x)
#define X first
#define Y second
#define control cout<<"passed"<<endl;
using namespace std;
typedef long long ll;
typedef pair <ll , ll> pll;
typedef pair <int , int> pii;
typedef long double ld;
typedef unsigned long long ull;
typedef vector <int> vi;
void init(int T)
{
return;
}
int a[6];
void fix(int pos)
{
int light = getLightest(a[pos] , a[pos - 1] , a[pos - 2]);
if(a[pos] == light)
swap(a[pos] , a[pos - 1]);
if(a[pos - 1] == light)
swap(a[pos - 1] , a[pos - 2]);
}
void orderCoins()
{
for(int i = 0; i < 6; i++)
a[i] = i + 1;
vi q = {5 , 3 , 2 , 5 , 3 , 5 , 4 , 5};
for(auto& e : q)
fix(e);
if(getHeaviest(a[4] , a[5] , a[0]) != a[5])
swap(a[4] , a[5]);
answer(a);
}
/**int main()
{
#ifdef ONLINE_JUDGE
freopen("input.in", "r", stdin);
freopen("output.out", "w", stdout);
#endif
///startT = std::chrono::high_resolution_clock::now();
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
return 0;
}*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |