結果
| 問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-11-20 15:51:30 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,131 bytes |
| コンパイル時間 | 2,900 ms |
| コンパイル使用メモリ | 278,096 KB |
| 実行使用メモリ | 19,536 KB |
| 最終ジャッジ日時 | 2025-11-20 15:51:42 |
| 合計ジャッジ時間 | 11,231 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 37 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define nl "\n"
#define pb push_back
#define mk make_pair
#define pii pair<int, int>
#define vi vector<int>
#define all(x) (x).begin(), (x).end()
#define umap unordered_map
#define uset unordered_set
#define MOD 1000000007
#define exp 1e9
#define sz(x) (int((x).size()))
#define forn(i, a, b) for (long long i = a; i < b; i++)
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
void solve()
{
int n;
cin >> n;
vi a(n);
for (auto &i : a)
cin >> i;
int ans = 0;
while (1)
{
bool isSorted = true;
for (int i = 0; i < n - 1; ++i)
{
if (a[i] >= a[i + 1])
{
isSorted = false;
break;
}
}
if (isSorted)
break;
for (int i = 0; i < n; ++i)
a[i] += i + 1;
ans++;
}
cout << ans << endl;
}
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
cin >> tc;
// cout << tc;
while (tc--)
{
solve();
}
}
vjudge1