結果

問題 No.1677 mæx
ユーザー tailstails
提出日時 2021-09-14 17:57:16
言語 Perl
(5.38.2)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 5,324 KB
実行使用メモリ 35,408 KB
最終ジャッジ日時 2023-09-09 15:45:32
合計ジャッジ時間 4,546 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,752 KB
testcase_01 AC 2 ms
4,744 KB
testcase_02 AC 3 ms
4,808 KB
testcase_03 AC 2 ms
4,888 KB
testcase_04 AC 182 ms
31,704 KB
testcase_05 AC 182 ms
32,668 KB
testcase_06 AC 185 ms
32,488 KB
testcase_07 AC 182 ms
32,612 KB
testcase_08 AC 182 ms
31,892 KB
testcase_09 AC 182 ms
32,252 KB
testcase_10 AC 181 ms
32,136 KB
testcase_11 AC 181 ms
32,432 KB
testcase_12 AC 180 ms
32,460 KB
testcase_13 AC 180 ms
32,592 KB
testcase_14 AC 239 ms
33,708 KB
testcase_15 AC 236 ms
34,156 KB
testcase_16 AC 241 ms
33,900 KB
testcase_17 AC 244 ms
33,972 KB
testcase_18 AC 240 ms
34,220 KB
testcase_19 AC 2 ms
4,700 KB
testcase_20 AC 3 ms
4,804 KB
testcase_21 AC 232 ms
35,408 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Possible attempt to separate words with commas at Main.pl line 17.
Main.pl syntax OK

ソースコード

diff #

sub MD{998244353}
sub max{
	($a,$b,$c,$d,$e,$f)=@_;
	return map$_%MD,$a*$d,$a*$e+$b*$d+$b*$e,$a*$f+$b*$f+$c*$d+$c*$e+$c*$f;
}
sub mex{
	($a,$b,$c,$d,$e,$f)=@_;
	return map$_%MD,$b*$e+$b*$f+$c*$e+$c*$f,$a*$d+$a*$f+$c*$d,$a*$e+$b*$d;
}
sub mx{
	@a=max(@_);
	@e=mex(@_);
	return map$_%MD,map$a[$_]+$e[$_],0..2;
}
$_=<>;
s/\b\?//g;
s/\d/qw(1,0,0 0,1,0 0,0,1)[$&]/ge;
s/\?/1,1,1/g;
print+(eval)[<>]
0