結果

問題 No.769 UNOシミュレータ
ユーザー tailstails
提出日時 2018-12-16 22:19:36
言語 Perl
(5.38.2)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 7,084 KB
実行使用メモリ 5,536 KB
最終ジャッジ日時 2023-08-14 11:51:25
合計ジャッジ時間 3,107 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,544 KB
testcase_01 AC 2 ms
4,612 KB
testcase_02 AC 3 ms
4,732 KB
testcase_03 AC 3 ms
4,624 KB
testcase_04 AC 3 ms
4,536 KB
testcase_05 AC 3 ms
4,572 KB
testcase_06 AC 3 ms
4,676 KB
testcase_07 AC 3 ms
4,608 KB
testcase_08 AC 4 ms
4,552 KB
testcase_09 AC 9 ms
4,652 KB
testcase_10 AC 9 ms
4,480 KB
testcase_11 AC 9 ms
4,552 KB
testcase_12 AC 65 ms
4,836 KB
testcase_13 AC 65 ms
4,744 KB
testcase_14 AC 65 ms
4,672 KB
testcase_15 AC 127 ms
5,080 KB
testcase_16 AC 129 ms
5,136 KB
testcase_17 AC 129 ms
5,112 KB
testcase_18 AC 190 ms
5,508 KB
testcase_19 AC 189 ms
5,532 KB
testcase_20 AC 188 ms
5,388 KB
testcase_21 AC 191 ms
5,536 KB
testcase_22 AC 3 ms
4,624 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;
$dir=1;
$id=0;
while(<>){
	chop;
	if($d2 && $_ ne 'drawtwo'){
		$a[$id]-=$d2;
		$d2=0;
		$id=($id+$dir)%$n;
	}
	if($d4 && $_ ne 'drawfour'){
		$a[$id]-=$d4;
		$d4=0;
		$id=($id+$dir)%$n;
	}
	$a[$id]+=1;
	$lastid=$id;
	if($_ eq 'number'){
	}
	if($_ eq 'drawtwo'){
		$d2+=2;
	}
	if($_ eq 'drawfour'){
		$d4+=4;
	}
	if($_ eq 'skip'){
		$id=($id+$dir)%$n;
	}
	if($_ eq 'reverse'){
		$dir=-$dir;
	}
	$id=($id+$dir)%$n;
}
print$lastid+1,$",$a[$lastid];
0