結果

問題 No.2815 Smaller than all
コンテスト
ユーザー highlighter
提出日時 2024-07-04 01:49:27
言語 C#
(.NET 10.0.201)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 71 ms / 2,000 ms
+ 115µs
コード長 269 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,908 ms
コンパイル使用メモリ 170,812 KB
実行使用メモリ 188,416 KB
最終ジャッジ日時 2026-07-12 10:19:16
合計ジャッジ時間 9,076 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (95 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

int N=int.Parse(Console.ReadLine());
int[] A=Console.ReadLine().Split().Select(int.Parse).ToArray();
int r=N;
for(int i=1;i<N;i++){
	if(A[i]>A[i-1]){
		r=i;
		break;
	}
}
int ans=0;
for(int i=r-1;i>=0;i--){
	if(A[i]==A[r-1])ans++;
	else break;
}
Console.WriteLine(ans);
0