Submission #28428057
Source Code Expand
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep2(i,k,n) for (int i = (k); i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
// using P = pair<ll,ll>;
// const ll INF = (ll)1e18;
const int INF = (int)1e9+7;
template<typename T>
void chmin(T &a, T b) { a = min(a, b); }
template<typename T>
void chmax(T &a, T b) { a = max(a, b); }
template<typename T>
void print(vector<T> v) {
int n = v.size();
rep(i,n) {
if (i == 0) cout << v[i];
else cout << ' ' << v[i];
}
cout << endl;
}
void solve() {
int n;
cin >> n;
vector<int> A(n), change(n, 0);
rep(i,n) cin >> A[i];
rep(i,n-1) {
if (A[i] > A[i+1]) {
change[i] ^= 1;
change[i+1] ^= 1;
}
}
print(change);
}
int main() {
solve();
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Gold and Silver |
| User | goropikari |
| Language | C++ (GCC 9.2.1) |
| Score | 400 |
| Code Size | 1116 Byte |
| Status | AC |
| Exec Time | 81 ms |
| Memory | 5560 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 400 / 400 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt |
| All | 00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt, 01-001.txt, 01-002.txt, 01-003.txt, 01-004.txt, 01-005.txt, 01-006.txt, 01-007.txt, 01-008.txt, 01-009.txt, 01-010.txt, 01-011.txt, 01-012.txt, 01-013.txt, 01-014.txt, 01-015.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-001.txt | AC | 3 ms | 3492 KiB |
| 00-sample-002.txt | AC | 2 ms | 3424 KiB |
| 00-sample-003.txt | AC | 2 ms | 3636 KiB |
| 01-001.txt | AC | 2 ms | 3556 KiB |
| 01-002.txt | AC | 7 ms | 3672 KiB |
| 01-003.txt | AC | 35 ms | 4052 KiB |
| 01-004.txt | AC | 76 ms | 5288 KiB |
| 01-005.txt | AC | 44 ms | 4264 KiB |
| 01-006.txt | AC | 68 ms | 5280 KiB |
| 01-007.txt | AC | 79 ms | 5540 KiB |
| 01-008.txt | AC | 81 ms | 5484 KiB |
| 01-009.txt | AC | 80 ms | 5560 KiB |
| 01-010.txt | AC | 79 ms | 5420 KiB |
| 01-011.txt | AC | 78 ms | 5420 KiB |
| 01-012.txt | AC | 77 ms | 5484 KiB |
| 01-013.txt | AC | 76 ms | 5408 KiB |
| 01-014.txt | AC | 79 ms | 5512 KiB |
| 01-015.txt | AC | 78 ms | 5472 KiB |