/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 6ms 3.082 MiB
#3 Accepted 6ms 2.734 MiB
#4 Accepted 5ms 2.551 MiB
#5 Accepted 6ms 2.551 MiB
#6 Accepted 5ms 2.566 MiB
#7 Wrong Answer 5ms 2.535 MiB
#8 Wrong Answer 2ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
// #define cerr cout
#include "algo/debug.h"
#else
#define deb(...) 30
#endif
#define ll long long
#define all(x) (x).begin(), (x).end()
#define f(i, n) for (int i = 0; i < n; i++)

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t;
    cin >> t;
    while (t--)
    {
        int n, k;
        cin >> n >> k;
        vector<string> v(n);
        for (auto &a : v)
            cin >> a;
        vector<string> final;
        for (int i = 0; i < n - k; i++)
        {
            string temp = "";
            for (int j = 0, kk = i; j <= k; j++, kk++)
            {
                temp += v[kk];
            }
            final.push_back(temp);
        }
        sort(all(final));
        // for (auto a : final)
        //     cout << a << '\n';
        cout << final.back() << '\n';
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1083 Number concatenation
Contest
Bangladesh 2.0
Language
C++20 (G++ 13.2.0)
Submit At
2024-08-16 15:49:36
Judged At
2024-11-11 03:17:11
Judged By
Score
30
Total Time
6ms
Peak Memory
3.082 MiB