/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 340.0 KiB
#2 Accepted 8ms 3.016 MiB
#3 Accepted 8ms 2.652 MiB
#4 Accepted 8ms 2.637 MiB
#5 Accepted 9ms 2.742 MiB
#6 Accepted 8ms 2.621 MiB
#7 Wrong Answer 8ms 2.672 MiB
#8 Wrong Answer 3ms 580.0 KiB

Code

// @sagorahmedmunna

#include <bits/stdc++.h>
using namespace std;

void test() {
  int n, k;
  cin >> n >> k;
  string a[n];
  for (auto& ai : a) {
    cin >> ai;
  }
  vector<string> s;
  for (int i = 0; i < n - k; i++) {
    string temp = "";
    for (int j = i; j <= i + k; j++) {
      temp += a[j];
    }
    s.push_back(temp);
  }
  string mx = s[0];
  for (auto& si : s) {
    mx = max(mx, si);
  }
  cout << mx << '\n';
}

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int t = 1; 
  cin >> t;
  for (int i = 1; i <= t; i++) {
    test();
  }
  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:47:48
Judged At
2024-11-11 03:17:18
Judged By
Score
30
Total Time
9ms
Peak Memory
3.016 MiB