/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 7ms 3.012 MiB
#3 Accepted 7ms 2.594 MiB
#4 Accepted 6ms 2.566 MiB
#5 Accepted 5ms 2.566 MiB
#6 Accepted 6ms 2.77 MiB
#7 Wrong Answer 5ms 2.746 MiB
#8 Wrong Answer 2ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi (3.141592653589)
#define mod 1000000007
#define pb push_back
#define vi vector<ll>
#define mp make_pair
#define f first
#define s second
#define sz(container) (ll) container.size()
#define setp(x) cout << fixed << setprecision(x)
#define all(container) container.begin(), container.end()
#define rall(container) container.rbegin(), container.rend()
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int main()
{
    fast;
    ll t;
    cin >> t;
    while (t--)
    {
        ll n, k;
        cin >> n >> k;
        vector<string> v(n);
        for (ll i = 0; i < n; i++)
        {
            cin >> v[i];
        }
        vector<string> ans;
        for (ll i = 0; i < n - k; i++)
        {
            string s = "";
            for (ll j = i; j <= i + k; j++)
            {
                s += v[j];
            }
            // cout << s << "\n";
            ans.pb(s);
        }
        sort(rall(ans));
        cout << ans[0] << "\n";
    }
}

Information

Submit By
Type
Submission
Problem
P1083 Number concatenation
Language
C++17 (G++ 13.2.0)
Submit At
2024-08-17 04:45:57
Judged At
2024-11-11 03:09:45
Judged By
Score
30
Total Time
7ms
Peak Memory
3.012 MiB