結果

問題 No.905 Sorted?
ユーザー %20%20
提出日時 2019-10-11 22:02:32
言語 Perl
(5.38.2)
結果
AC  
実行時間 429 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 7,028 KB
実行使用メモリ 45,484 KB
最終ジャッジ日時 2023-08-16 17:52:37
合計ジャッジ時間 5,768 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,272 KB
testcase_01 AC 5 ms
5,108 KB
testcase_02 AC 5 ms
5,100 KB
testcase_03 AC 6 ms
5,184 KB
testcase_04 AC 5 ms
5,116 KB
testcase_05 AC 14 ms
5,972 KB
testcase_06 AC 11 ms
5,744 KB
testcase_07 AC 32 ms
7,872 KB
testcase_08 AC 283 ms
29,856 KB
testcase_09 AC 204 ms
24,028 KB
testcase_10 AC 391 ms
40,848 KB
testcase_11 AC 318 ms
37,148 KB
testcase_12 AC 309 ms
37,044 KB
testcase_13 AC 429 ms
44,216 KB
testcase_14 AC 364 ms
44,184 KB
testcase_15 AC 343 ms
45,304 KB
testcase_16 AC 341 ms
45,484 KB
testcase_17 AC 419 ms
45,416 KB
testcase_18 AC 330 ms
42,128 KB
testcase_19 AC 5 ms
5,124 KB
testcase_20 AC 5 ms
5,212 KB
testcase_21 AC 5 ms
5,088 KB
testcase_22 AC 5 ms
5,028 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$N=<>;
@A=glob<>;
for$i(1..$N-1){
	$f[$i]=$f[$i-1]+($A[$i-1]>$A[$i]);
	$g[$i]=$g[$i-1]+($A[$i-1]<$A[$i]);
}
<>;
for(<>){
	($l,$r)=split;
	print$f[$r]-$f[$l]?0:1,$",$g[$r]-$g[$l]?0:1,$/;
}
0