Submission #47916143
Source Code Expand
#include <iostream>
using namespace std;
int main()
{
int n, l, r;
cin >> n >> l >> r;
for (int i = 0; i < n; i++)
{
int tmp;
cin >> tmp;
if (tmp <= l)
{
cout << l;
}
else if (tmp >= r)
{
cout << r;
}
else
{
cout << tmp;
}
if (i < n - 1)
{
cout << " ";
}
else
{
cout << endl;
}
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Minimize Abs 1 |
| User | nnth_y |
| Language | C++ 20 (gcc 12.2) |
| Score | 200 |
| Code Size | 555 Byte |
| Status | AC |
| Exec Time | 239 ms |
| Memory | 3564 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3496 KiB |
| 00_sample_02.txt | AC | 1 ms | 3492 KiB |
| 01_test_01.txt | AC | 190 ms | 3460 KiB |
| 01_test_02.txt | AC | 142 ms | 3464 KiB |
| 01_test_03.txt | AC | 159 ms | 3440 KiB |
| 01_test_04.txt | AC | 207 ms | 3508 KiB |
| 01_test_05.txt | AC | 140 ms | 3472 KiB |
| 01_test_06.txt | AC | 239 ms | 3456 KiB |
| 01_test_07.txt | AC | 126 ms | 3468 KiB |
| 01_test_08.txt | AC | 201 ms | 3496 KiB |
| 01_test_09.txt | AC | 234 ms | 3564 KiB |
| 01_test_10.txt | AC | 145 ms | 3440 KiB |
| 01_test_11.txt | AC | 199 ms | 3460 KiB |
| 01_test_12.txt | AC | 116 ms | 3456 KiB |