結果

問題 No.2042 RGB Caps
ユーザー tailstails
提出日時 2022-08-19 21:57:53
言語 Perl
(5.38.2)
結果
AC  
実行時間 429 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 659 ms
コンパイル使用メモリ 5,456 KB
実行使用メモリ 30,208 KB
最終ジャッジ日時 2023-08-10 02:57:30
合計ジャッジ時間 4,413 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,112 KB
testcase_01 AC 7 ms
5,276 KB
testcase_02 AC 6 ms
5,260 KB
testcase_03 AC 6 ms
5,064 KB
testcase_04 AC 6 ms
5,380 KB
testcase_05 AC 7 ms
5,088 KB
testcase_06 AC 170 ms
5,040 KB
testcase_07 AC 134 ms
12,136 KB
testcase_08 AC 268 ms
19,604 KB
testcase_09 AC 48 ms
7,920 KB
testcase_10 AC 385 ms
27,260 KB
testcase_11 AC 59 ms
6,112 KB
testcase_12 AC 429 ms
30,128 KB
testcase_13 AC 422 ms
30,196 KB
testcase_14 AC 427 ms
30,208 KB
testcase_15 AC 6 ms
5,052 KB
testcase_16 AC 115 ms
11,120 KB
testcase_17 AC 35 ms
7,024 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::k" used only once: possible typo at Main.pl line 1.
Name "main::G" used only once: possible typo at Main.pl line 11.
Name "main::B" used only once: possible typo at Main.pl line 11.
Name "main::R" used only once: possible typo at Main.pl line 11.
Main.pl syntax OK

ソースコード

diff #

($n,$k)=glob<>;
@a=sort{$a-$b}<>;
for(1..$n){
	$c=R;
	if($a[0]==$_){
		$_=shift@a;
		chop;
		$c=chop;
	}
	for(B,G,R,$c){
		if($$_<=$R&&$$_<=$G&&$$_<=$B){
			$d=$_;
		}
	}
	++$$d;
	print$d;
}
0