/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 3ms 488.0 KiB
#2 Accepted 7ms 608.0 KiB
#3 Accepted 6ms 604.0 KiB
#4 Wrong Answer 6ms 608.0 KiB
#5 Accepted 6ms 600.0 KiB
#6 Accepted 7ms 604.0 KiB
#7 Wrong Answer 7ms 608.0 KiB

Code

#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define all(a) a.begin(),a.end()
#define endl '\n'
 typedef pair<int, int> pi; 

void solve()
{
        ll n,k;cin>>n>>k;
        vector<string>v(n);
        for(auto &c:v)cin>>c;

        string mx="0";
        string tmp;
        ll ct;
        for(ll i=0;i<n;i++)
        {
            tmp="";
            ct=k+1;
            ll j=i;
            while(ct--)
            {
                if(j==n)break;
                tmp+=v[j];
                j++;

            }
            if(mx<tmp)mx=tmp;

        }
        cout<<mx<<endl;

}

int main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    ll t=1;cin>>t;
    while(t--)
    {
      solve();
    }    
}

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:56:14
Judged At
2024-11-11 03:16:47
Judged By
Score
25
Total Time
7ms
Peak Memory
608.0 KiB