/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 8ms 2.812 MiB
#3 Accepted 8ms 2.562 MiB
#4 Accepted 7ms 2.656 MiB
#5 Accepted 9ms 2.605 MiB
#6 Accepted 7ms 2.609 MiB
#7 Wrong Answer 7ms 2.668 MiB
#8 Wrong Answer 3ms 584.0 KiB
#9 Wrong Answer 2ms 496.0 KiB
#10 Wrong Answer 7ms 2.699 MiB
#11 Wrong Answer 2ms 568.0 KiB
#12 Wrong Answer 4ms 980.0 KiB
#13 Wrong Answer 5ms 792.0 KiB
#14 Wrong Answer 5ms 892.0 KiB
#15 Wrong Answer 7ms 2.602 MiB

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-10-03 13:29:45
Judged By
Score
30
Total Time
9ms
Peak Memory
2.812 MiB