結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
コンテスト
ユーザー vjudge1
提出日時 2025-11-20 16:22:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 1,034 bytes
コンパイル時間 1,890 ms
コンパイル使用メモリ 196,156 KB
実行使用メモリ 19,272 KB
最終ジャッジ日時 2025-11-20 16:22:44
合計ジャッジ時間 9,270 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define fastio()               \
  ios::sync_with_stdio(false); \
  cin.tie(nullptr);            \
  cout.tie(nullptr)

#define ll long long
#define sz(x) ((int)(x).size())
#define all(x) x.begin(), x.end()

#define deb(x) cerr << #x << " = " << x << '\n'

const int INF = (1e9 + 7);
const ll LINF = (1e18);
const double PI = acos(-1.0);
const int MOD = (1e9 + 7);

bool is_asc(const vector<int>& v) {
  for (int i = 0; i < static_cast<int>(v.size() - 1); i++) {
    if (v[i] >= v[i + 1]) {
      return false;
    }
  }
  return true;
}

int main() {
  int t;
  cin >> t;

  vector<int> outs(t, -1);

  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;

    vector<int> vals(n);
    for (auto& i : vals) {
      cin >> i;
    }

    int count = 0;
    while (!is_asc(vals)) {
      for (int i = 0; i < static_cast<int>(vals.size()); i++) {
        vals[i] += (i + 1);
      }
      count++;
    }

    outs[i] = count;
  }

  for (auto& out : outs) {
    cout << out << '\n';
  }
}
0