/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 540.0 KiB
#3 Wrong Answer 1ms 548.0 KiB
#4 Accepted 1ms 532.0 KiB
#5 Wrong Answer 4ms 928.0 KiB

Code

#include <bits/stdc++.h>     //   All praise is due to Allah alone, and peace and blessings be
using namespace std;         //         upon him, after whom there is no other Prophet.

int32_t main() {
    cin.tie(0)->sync_with_stdio(false);

    int32_t Case = 1;    //cin >> Case;
    for (int T = 1; T <= Case; T++) {

        int n, k; cin >> n >> k;
        string s; cin >> s;

        function<void()> Test_Case = [&]() {
            for(int i = 0; i < n; i += k) {
                sort(s.begin() + i, s.begin() + min(n, i + k));
            }
            cout << s << '\n';
        };
        Test_Case();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1230 Lexicographically Smallest Rearrangement
Contest
LUCC Presents Intra LU Junior Programming Contest - Replay
Language
C++17 (G++ 13.2.0)
Submit At
2025-09-02 15:38:09
Judged At
2025-09-02 15:38:59
Judged By
Score
3
Total Time
4ms
Peak Memory
928.0 KiB