Submission #26858897
Source Code Expand
#include <stdio.h>
#include <algorithm>
#include <memory.h>
#include <vector>
#include <iostream>
#include <string>
#define int long long
int read(int x = 0, int f = 0, char ch = getchar())
{
while (ch < 48 or ch > 57)
f = ch == 45, ch = getchar();
while (48 <= ch and ch <= 57)
x = x * 10 + ch - 48, ch = getchar();
return f ? -x : x;
}
const int N = 1e6 + 5;
int n;
int a[N], b[N];
signed main()
{
n = read();
for (int i = 1; i <= n; i++)
a[i] = read();
for (int i = 1; i < n; i++)
if (a[i] > a[i + 1])
b[i] ^= 1, b[i + 1] ^= 1;
for (int i = 1; i <= n; i++)
printf("%lld ", b[i]);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Gold and Silver |
| User | TosakaUCW |
| Language | C++ (GCC 9.2.1) |
| Score | 400 |
| Code Size | 717 Byte |
| Status | AC |
| Exec Time | 37 ms |
| Memory | 6824 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 | 9 ms | 3464 KiB |
| 00-sample-002.txt | AC | 2 ms | 3484 KiB |
| 00-sample-003.txt | AC | 4 ms | 3484 KiB |
| 01-001.txt | AC | 2 ms | 3544 KiB |
| 01-002.txt | AC | 3 ms | 3640 KiB |
| 01-003.txt | AC | 15 ms | 4700 KiB |
| 01-004.txt | AC | 33 ms | 5140 KiB |
| 01-005.txt | AC | 16 ms | 4208 KiB |
| 01-006.txt | AC | 26 ms | 6124 KiB |
| 01-007.txt | AC | 34 ms | 6780 KiB |
| 01-008.txt | AC | 34 ms | 6684 KiB |
| 01-009.txt | AC | 36 ms | 6824 KiB |
| 01-010.txt | AC | 37 ms | 6644 KiB |
| 01-011.txt | AC | 33 ms | 5160 KiB |
| 01-012.txt | AC | 33 ms | 5092 KiB |
| 01-013.txt | AC | 34 ms | 6644 KiB |
| 01-014.txt | AC | 36 ms | 6608 KiB |
| 01-015.txt | AC | 34 ms | 5176 KiB |