結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー 沙耶花沙耶花
提出日時 2021-03-12 21:37:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 702 bytes
コンパイル時間 4,294 ms
コンパイル使用メモリ 257,720 KB
実行使用メモリ 7,132 KB
最終ジャッジ日時 2024-04-22 12:25:53
合計ジャッジ時間 7,245 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
6,944 KB
testcase_07 WA -
testcase_08 AC 2 ms
6,940 KB
testcase_09 WA -
testcase_10 AC 1 ms
6,944 KB
testcase_11 WA -
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
6,944 KB
testcase_19 WA -
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 52 ms
6,944 KB
testcase_23 AC 13 ms
6,940 KB
testcase_24 AC 12 ms
6,944 KB
testcase_25 AC 54 ms
6,940 KB
testcase_26 AC 63 ms
7,112 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,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000

int op(int a,int b){
	return max(a,b);
}

int e(){
	return 0;
}

int main(){
	
	int N;
	cin>>N;
	
	vector<int> A(N);
	rep(i,N){
		scanf("%d",&A[i]);
	}
	
	{
		auto B = A;
		sort(B.begin(),B.end());
		B.erase(unique(B.begin(),B.end()),B.end());
		
		rep(i,N){
			A[i] = distance(B.begin(),lower_bound(B.begin(),B.end(),A[i]));
		}
	}
	
	segtree<int,op,e> seg(N+5);
	
	rep(i,N){
		seg.set(A[i],max(seg.get(A[i]),seg.prod(0,A[i]+1)+1));
	}
	
	cout<<N-seg.all_prod()<<endl;
	
    return 0;
}
0