結果

問題 No.2042 RGB Caps
コンテスト
ユーザー 👑 tails
提出日時 2022-08-19 21:57:53
言語 Perl
(5.42.1)
コンパイル:
perl -cw _filename_
実行:
perl -X _filename_
結果
AC  
実行時間 267 ms / 2,000 ms
コード長 191 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 554 ms
コンパイル使用メモリ 6,528 KB
実行使用メモリ 31,300 KB
最終ジャッジ日時 2026-05-11 05:48:21
合計ジャッジ時間 3,952 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::k" used only once: possible typo at Main.pl line 1.
Name "main::R" used only once: possible typo at Main.pl line 11.
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.
Main.pl syntax OK

ソースコード

diff #
raw source code

($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