/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 9ms 4.223 MiB
#3 Accepted 8ms 3.762 MiB
#4 Wrong Answer 7ms 3.809 MiB
#5 Accepted 7ms 3.746 MiB
#6 Accepted 7ms 3.805 MiB
#7 Wrong Answer 8ms 3.887 MiB
#8 Wrong Answer 2ms 576.0 KiB
#9 Wrong Answer 2ms 320.0 KiB
#10 Wrong Answer 7ms 3.496 MiB
#11 Wrong Answer 2ms 568.0 KiB
#12 Wrong Answer 3ms 840.0 KiB
#13 Wrong Answer 7ms 1.258 MiB
#14 Wrong Answer 5ms 1.004 MiB
#15 Wrong Answer 7ms 3.316 MiB

Code

#include<bits/stdc++.h>
#define fastio {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define ll   long long int
#define all(u) sort(u.begin(),u.end())
#define nxt(u) next_permutation(u.begin(),u.end())
#define rev(u) reverse(u.begin(),u.end())
#define cinv(u) for(auto &it : u) cin >> it;
#define pb push_back
#define Which would be worse
#define siz(st) st.size()
#define nl "\n"
#define yes cout<<"YES"<<"\n"
#define no cout<<"NO"<<"\n";
#define pii  pair < int , int >
#define v vector
#define For(s , e , k) for(int i = s ; i <= e ; i += k)
#define print(s , e , k , ar) for(int i = s ; i <= e ; i += k) cout << ar[i] << " \n"[i == e]
using namespace std;
//#ifndef ONLINE_JUDGE
//#include "template.h"
//#endif
const int fx[]={-1,0,1,0};
const int fy[]={0,1,0,-1};
const int sz = 2e5 + 10 ;
//cout<<"Case "<<t<<": "<<ans<<endl;
//priority_queue <ll, vector<ll>, greater<ll> > pq;//soto theke boro
//cout<<setprecision(10)<<fixed;
// ll id=lower_bound(de.begin(),de.end())-de.begin();
/*remainder extra space*/

void solve(){
      int n  , k;
      cin >> n  >> k ;
      v  < string  > ar(n) , de;
      For(0 , n - 1  , 1){
         cin >> ar[i];
      }
      for(int i = 0 ; i < n ; i++){
         string s ;
         for(int j = i ; j < n && j <= i + k ; j++){
            s += ar[j];
         }
         de.push_back(s);
      }
      all(de);
      rev(de);
      cout << de[0] << "\n";






}
int main(){

     fastio;
     int T = 1;
     cin >> T;
     while(T--)
     solve();
}

Information

Submit By
Type
Submission
Problem
P1083 Number concatenation
Contest
Bangladesh 2.0
Language
C++17 (G++ 13.2.0)
Submit At
2024-08-16 16:10:32
Judged At
2024-10-03 13:28:20
Judged By
Score
25
Total Time
9ms
Peak Memory
4.223 MiB