Submission #25200949
Source Code Expand
#include <iostream>
#include <algorithm>
using namespace std;
string S;
int K;
int main() {
cin >> S >> K;
sort(S.begin(), S.end());
do {
if (--K == 0) { break; }
} while (next_permutation(S.begin(), S.end()));
cout << S << endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - One More aab aba baa |
| User | daimatz |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 263 Byte |
| Status | AC |
| Exec Time | 8 ms |
| Memory | 3640 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample_01.txt | AC | 8 ms | 3528 KiB |
| sample_02.txt | AC | 2 ms | 3512 KiB |
| sample_03.txt | AC | 2 ms | 3640 KiB |
| test_01.txt | AC | 2 ms | 3628 KiB |
| test_02.txt | AC | 2 ms | 3592 KiB |
| test_03.txt | AC | 2 ms | 3624 KiB |
| test_04.txt | AC | 2 ms | 3588 KiB |
| test_05.txt | AC | 2 ms | 3624 KiB |
| test_06.txt | AC | 4 ms | 3504 KiB |
| test_07.txt | AC | 2 ms | 3412 KiB |
| test_08.txt | AC | 2 ms | 3572 KiB |
| test_09.txt | AC | 2 ms | 3504 KiB |
| test_10.txt | AC | 2 ms | 3464 KiB |
| test_11.txt | AC | 2 ms | 3572 KiB |
| test_12.txt | AC | 3 ms | 3600 KiB |
| test_13.txt | AC | 2 ms | 3412 KiB |
| test_14.txt | AC | 2 ms | 3636 KiB |
| test_15.txt | AC | 2 ms | 3616 KiB |
| test_16.txt | AC | 2 ms | 3600 KiB |