結果
| 問題 |
No.623 fudan no modulus to tigau
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2017-12-23 00:07:38 |
| 言語 | Perl (5.40.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 283 bytes |
| コンパイル時間 | 440 ms |
| コンパイル使用メモリ | 5,760 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2024-12-17 23:51:40 |
| 合計ジャッジ時間 | 1,191 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
コンパイルメッセージ
Name "main::q" used only once: possible typo at Main.pl line 4. Main.pl syntax OK
ソースコード
$m=998244353;
$n=<>;
($t[$_],$a[$_],$b[$_])=glob<> for 2..$n;
$q=<>;
@x=glob<>;
for$x(@x){
$f[0]=1;
$f[1]=$x;
for$i(2..$n){
$f[$i]=
$t[$i]==1?($f[$a[$i]]+$f[$b[$i]])%$m:
$t[$i]==2?($a[$i]*$f[$b[$i]])%$m:
$t[$i]==3?($f[$a[$i]]*$f[$b[$i]])%$m:
0;
}
print$f[$n],$/;
}
tails