/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Wrong Answer 22ms 1.07 MiB
#3 Wrong Answer 22ms 1.129 MiB

Code

#include <bits/stdc++.h>

#pragma GCC optimize("Ofast")
using namespace std;

void solve(int cs) {
  int n;
  cin >> n;
  vector<int> a(n, 6);
  a.back() = 15;
  a[n - 2] = 10;
  int p = 2;
  for (int i = 0; i < n - 3; i++, p++) {
    a[i] = a[i] * p;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    cout << a[i] << " \n"[i == n - 1];
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc = 1;
  cin >> tc;
  for (int cs = 1; cs <= tc; cs++) {
    solve(cs);
  }
  return 0;
}

Information

Submit By
Type
Submission
Problem
P1070 Strange Sequences
Contest
Brain Booster #4
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-14 17:18:03
Judged At
2024-11-11 03:23:07
Judged By
Score
10
Total Time
22ms
Peak Memory
1.129 MiB