Task: | Sorting |
Sender: | vixephor |
Submission time: | 2021-01-31 10:51:10 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#2 | WRONG ANSWER | 0.01 s | 2 | details |
#3 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2 | details |
Code
/*Почему ты смотришь v мой код?плохо-плохо=)*///#pragma GCC optimize("Ofast")//#pragma GCC optimize("unroll-loops")#include <algorithm>#include <iostream>#include <cstdlib>#include <cstdarg>#include <cassert>#include <climits>#include <cstring>#include <complex>#include <cstdio>#include <vector>#include <string>#include <queue>#include <cmath>#include <ctime>#include <set>#include <map>#include <iomanip>#include <unordered_map>#include <bitset>#include<stack>using namespace std;#define ll long long#define ld long double#define int long long#define mp make_pair#define pb push_back#define eb emplace_back#define sum(a) ( accumulate ((a).begin(), (a).end(), 0ll))#define mine(a) (*min_element((a).begin(), (a).end()))#define maxe(a) (*max_element((a).begin(), (a).end()))#define mini(a) ( min_element((a).begin(), (a).end()) - (a).begin())#define maxi(a) ( max_element((a).begin(), (a).end()) - (a).begin())#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())#define int long long#define pb push_backtemplate<typename T> vector<T>& operator-- (vector<T>& v) { for (auto& i : v) --i; return v; }template<typename T> vector<T>& operator++ (vector<T>& v) { for (auto& i : v) ++i; return v; }template<typename T> istream& operator>>(istream& is, vector<T>& v) { for (auto& i : v) is >> i; return is; }template<typename T> ostream& operator<<(ostream& os, vector<T>& v) { for (auto& i : v) os << i << ' '; return os; }template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }template<typename T, typename U> ostream& operator<<(ostream& os, pair<T, U>& p) { os << p.first << ' ' << p.second; return os; }template<typename T, typename U> pair<T, U> operator-(pair<T, U> a, pair<T, U> b) { return mp(a.first - b.first, a.second - b.second); }template<typename T, typename U> pair<T, U> operator+(pair<T, U> a, pair<T, U> b) { return mp(a.first + b.first, a.second + b.second); }template<typename T, typename U> void umin(T& a, U b) { if (a > b) a = b; }template<typename T, typename U> void umax(T& a, U b) { if (a < b) a = b; }long long a, b, c, e, f, g;ll h[1000005];ll h2[1000005];ll h3[1000005];bool fl = 0;void rec(int c, int e, int f,int pos){if (fl == 1) return;if (pos == a + 1){if (c == b - 1 && e == b && f == b + 1){for (int i = 1; i <= a; i++){cout << h[i] << " ";}cout << '\n';fl = 1;return;}return;}if (c + pos <= b - 1){h[pos] = 1;rec(c + pos, e, f, pos + 1);}if (e + pos <= b){h[pos] = 2;rec(c, e + pos, f, pos + 1);}if (f + pos <= b + 1){h[pos] = 3;rec(c, e, f + pos, pos + 1);}}void solve(){cin >> a;for (int i = 1; i <= a; i++){cin >> h[i];}f = 0;for (int i = 1; i <= a; i++){for (int j = 1; j < a; j++){if (h[j] > h[j + 1]) { swap(h[j], h[j + 1]); f++;}}}if (f % 4 == 0){cout << "YES\n";}else cout<<"NO\n";}/*5 6 54132 1000 100-1 1 1-1 2 10001001L1 21R2 12LL1 2 22RR2 2 12LR1 5 1*/signed main() {int q;q = 1;// cin >> q;while (q != 0){solve();q--;}}/*0 4 10 16 28 43 0 -4 -10 -16 -28 -43202 210 234 270 366 516 202 210 234 270 366 516-1 3 9 15 27 42 1 -3 -9 -15 -27 -422252154 154 162 162 174 174 186 186 210 210 240 240154 162 174 186 210 240x1 x2 x3 x4 x5 x6154=x2*2162=x1*2162-154=(x1*2)-(x2*2)8=2*x1+2*x28=2*(x1+x2)4=x1-x2;174-162=(x2*2)-(x3*2)6=x2-x3;40 56 48 40 80 56 80 4840 48 56 801 5 9 2164 48 48 96x1-x2=4x3-x2=4x4-x3=120 4 10 16 28 431 7 9 10 19 37 73 145 28917 33 65 129 25713 19 31 552x-y=0;1-2=0bbccacbсbbcacaaaabbaayyyyxyyy = 14xyyyyyyy*/
Test details
Test 1
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
153 1 1 2 1 2 ... |
correct output |
---|
YES YES NO NO NO ... |
user output |
---|
NO |
Test 2
Group: 2
Verdict: WRONG ANSWER
input |
---|
1000 59 35 29 32 50 11 15 9 21 19 45 2... |
correct output |
---|
YES NO YES NO YES ... |
user output |
---|
YES |
Test 3
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
720 6 1 6 4 5 2 3 6 6 3 2 1 5 4 ... |
correct output |
---|
YES NO NO NO YES ... |
user output |
---|
NO |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1000 8 7 4 2 8 6 3 5 1 8 3 8 2 7 5 4 6 1 ... |
correct output |
---|
NO NO YES NO YES ... |
user output |
---|
NO |