/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Wrong Answer 1ms 532.0 KiB
#3 Wrong Answer 1ms 536.0 KiB
#4 Wrong Answer 1ms 580.0 KiB
#5 Wrong Answer 1ms 576.0 KiB
#6 Wrong Answer 1ms 580.0 KiB
#7 Wrong Answer 1ms 580.0 KiB
#8 Wrong Answer 1ms 320.0 KiB
#9 Wrong Answer 1ms 532.0 KiB
#10 Wrong Answer 1ms 576.0 KiB
#11 Wrong Answer 1ms 324.0 KiB
#12 Wrong Answer 1ms 580.0 KiB
#13 Wrong Answer 1ms 580.0 KiB
#14 Wrong Answer 1ms 428.0 KiB
#15 Wrong Answer 1ms 532.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'



void solve()
{
    
    int n , k ; cin>> n >> k ;
    string aa[n+5];
    for(int i=1 ; i<=n ; i++){
        string x ; cin>> x ;
        aa[i] = x ;
    }
    string ans = "";
    for(int i=1 ; i<=n-k+1 ; i++){
        string nt ="" ;
        for(int j=i ; j<=i+2 ; j++){
            nt += aa[j];
        }
        //cout<< nt << " " << i << " " << i+2 << nl;
        if(nt > ans){
            ans = nt ;
        }
    }
    
    cout<< ans << nl;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int T ;
    cin >> T ;
    for (int tt = 1 ; tt <= T ; tt++)
    {
        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 16:08:02
Judged At
2024-10-03 13:28:28
Judged By
Score
5
Total Time
1ms
Peak Memory
580.0 KiB