# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1162149 | gustavo_d | Scales (IOI15_scales) | C++20 | 1 ms | 328 KiB |
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T) {}
/*
int getMedian(int A, int B, int C);
int getHeaviest(int A, int B, int C);
int getLightest(int A, int B, int C);
int getNextLightest(int A, int B, int C, int D);
*/
// Olhar como é na STL
void put(vector<int>& v, int i, int val) {
vector<int> res;
for (int j=0; j<i; j++) res.push_back(v[j]);
res.push_back(val);
for (int j=i; j<(int)v.size(); j++) {
res.push_back(v[j]);
}
swap(v, res);
}
void rem(vector<int>&v, int val) {
vector<int> res;
for (int i=0; i<(int)v.size(); i++) {
if (v[i] != val) res.push_back(v[i]);
}
swap(res, v);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |