Submission #48549785
Source Code Expand
/**
* @the_hyp0cr1t3
* 16.12.2023 17:34
**/
#include <bits/stdc++.h>
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int n;
std::cin >> n;
if (n-- == 1) {
std::cout << 3 << '\n';
return 0;
}
for (int len = 2; ; len++) {
for (int i = len - 1; i >= 0; i--) {
for (int j = len - 1 - i; j >= 0; j--) {
if (!--n) {
std::cout << std::string(i, '1') << std::string(j, '2') << std::string(len - i - j, '3') << '\n';
return 0;
}
}
}
}
assert(false);
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Repunit Trio |
| User | the_hyp0cr1t3 |
| Language | C++ 20 (gcc 12.2) |
| Score | 300 |
| Code Size | 656 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3560 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.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, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3468 KiB |
| 00_sample_02.txt | AC | 1 ms | 3492 KiB |
| 00_sample_03.txt | AC | 1 ms | 3560 KiB |
| 01_test_01.txt | AC | 1 ms | 3552 KiB |
| 01_test_02.txt | AC | 1 ms | 3372 KiB |
| 01_test_03.txt | AC | 1 ms | 3420 KiB |
| 01_test_04.txt | AC | 1 ms | 3384 KiB |
| 01_test_05.txt | AC | 1 ms | 3492 KiB |
| 01_test_06.txt | AC | 1 ms | 3428 KiB |
| 01_test_07.txt | AC | 1 ms | 3424 KiB |
| 01_test_08.txt | AC | 1 ms | 3488 KiB |
| 01_test_09.txt | AC | 1 ms | 3408 KiB |
| 01_test_10.txt | AC | 1 ms | 3496 KiB |
| 01_test_11.txt | AC | 1 ms | 3416 KiB |
| 01_test_12.txt | AC | 1 ms | 3488 KiB |
| 01_test_13.txt | AC | 1 ms | 3384 KiB |
| 01_test_14.txt | AC | 1 ms | 3412 KiB |
| 01_test_15.txt | AC | 1 ms | 3436 KiB |
| 01_test_16.txt | AC | 1 ms | 3384 KiB |
| 01_test_17.txt | AC | 1 ms | 3356 KiB |