結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー e869120e869120
提出日時 2021-03-12 21:42:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 975 ms
コンパイル使用メモリ 83,064 KB
実行使用メモリ 7,248 KB
最終ジャッジ日時 2024-04-22 12:31:43
合計ジャッジ時間 4,257 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 3 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 3 ms
6,940 KB
testcase_09 WA -
testcase_10 AC 3 ms
6,940 KB
testcase_11 WA -
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 3 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
6,940 KB
testcase_19 WA -
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 3 ms
6,940 KB
testcase_22 AC 71 ms
6,944 KB
testcase_23 AC 19 ms
6,944 KB
testcase_24 AC 16 ms
6,944 KB
testcase_25 AC 76 ms
6,984 KB
testcase_26 AC 90 ms
7,244 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;

long long N, X[1 << 18];
long long B[1 << 18], cnt;

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) cin >> X[i];
	for (int i = 0; i < N; i++) X[i] = (1000000LL * X[i]) + 1LL * i;
	for (int i = 0; i < N; i++) {
		int pos1 = lower_bound(B, B + cnt, X[i] + 1) - B;
		if (pos1 == cnt) cnt++;
		B[pos1] = X[i];
	}
	cout << N - cnt << endl;
	return 0;
}
0