
hwi experience
skibdi ok
grheh
i just did and got
Solution
solution.cpp
#include <bits/stdc++.h>
void solve() {
int n;
std::cin >> n; std::vector<int> a(n);
for (auto &i : a)
std::cin >> i;
std::sort(a.begin(), a.end());
if (n == 2) {
std::cout << a[0] << " " << a[1] << "\n";
return;
}
int posy = -1, diff = std::numeric_limits<int>::max();
for (int i = 0; i < n - 1; ++i) {
if (a[i + 1] - a[i] < diff) {
posy = i;
diff = a[i + 1] - a[i];
}
}
std::cout << a[posy] << " ";
for (int i = posy + 2; i < n; ++i)
std::cout << a[i] << " ";
for (int i = 0; i < posy; ++i)
std::cout << a[i] << " ";
std::cout << a[posy + 1] <<Code "\n";
}
int main(void) {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
}Free my niggas they ain't done nothing wrong!
Okaeri Alice Cover Vol2

schema.sql
SELECT * FROM USER ORDER BY CREATED_AT DESC LIMIT 10; Solution
solution.cpp
#include <bits/stdc++.h>
void solve() {
int n;
std::cin >> n; std::vector<int> a(n);
for (auto &i : a)
std::cin >> i;
std::sort(a.begin(), a.end());
if (n == 2) {
std::cout << a[0] << " " << a[1] << "\n";
return;
}
int posy = -1, diff = std::numeric_limits<int>::max();
for (int i = 0; i < n - 1; ++i) {
if (a[i + 1] - a[i] < diff) {
posy = i;
diff = a[i + 1] - a[i];
}
}
std::cout << a[posy] << " ";
for (int i = posy + 2; i < n; ++i)
std::cout << a[i] << " ";
for (int i = 0; i < posy; ++i)
std::cout << a[i] << " ";
std::cout << a[posy + 1] <<Code "\n";
}
int main(void) {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
}- First ordered list item
- Another item ÅÅ* Unordered sub-list.
- Actual numbers don't matter, just that it's a number ÅÅ1. Ordered sub-list
- And another item.
ÅÅÅYou can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
ÅÅÅTo have a line break without a paragraph, you will need to use two trailing spaces.ÅÅ ÅÅÅNote that this line is separate, but within the same paragraph.ÅÅ ÅÅÅ(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
- Unordered list can use asterisks
- Or minuses
- Or pluses
I'm an inline-style link with title
[I'm a reference-style link][Arbitrary case-insensitive reference text]
I'm a relative reference to a repository file
[You can use numbers for reference-style link definitions][1]