Submission #66560724
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (ll i = a; i <= (b); i++)
#define sz(v) ((int)v.size())
#define el "\n"
int main() {
int t, n; cin >> t;
string s;
rep(tc,0,t-1){
cin >> n;
cin >> s;
rep(i,0,n-2){
int j = i;
int op = 0;
while (j+1<n && s[j] > s[j+1]) {
swap(s[j], s[j+1]);
op++;
j++;
}
if (op>0) break;
}
cout << s << el;
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - String Rotation |
| User | jefersonf |
| Language | C++ 17 (gcc 12.2) |
| Score | 0 |
| Code Size | 468 Byte |
| Status | WA |
| Exec Time | 24 ms |
| Memory | 3744 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt |
| All | 00_sample_01.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 | 3536 KiB |
| 01_test_01.txt | WA | 23 ms | 3448 KiB |
| 01_test_02.txt | WA | 24 ms | 3540 KiB |
| 01_test_03.txt | WA | 24 ms | 3484 KiB |
| 01_test_04.txt | WA | 24 ms | 3416 KiB |
| 01_test_05.txt | WA | 2 ms | 3544 KiB |
| 01_test_06.txt | WA | 2 ms | 3564 KiB |
| 01_test_07.txt | WA | 3 ms | 3492 KiB |
| 01_test_08.txt | WA | 2 ms | 3408 KiB |
| 01_test_09.txt | AC | 1 ms | 3632 KiB |
| 01_test_10.txt | AC | 1 ms | 3660 KiB |
| 01_test_11.txt | AC | 2 ms | 3584 KiB |
| 01_test_12.txt | AC | 2 ms | 3744 KiB |
| 01_test_13.txt | AC | 2 ms | 3580 KiB |
| 01_test_14.txt | AC | 2 ms | 3688 KiB |
| 01_test_15.txt | AC | 2 ms | 3676 KiB |
| 01_test_16.txt | AC | 2 ms | 3744 KiB |
| 01_test_17.txt | AC | 7 ms | 3556 KiB |