結果

問題 No.1680 Sum and Difference
ユーザー neko_the_shadow
提出日時 2021-10-20 14:08:53
言語 Perl
(5.40.0)
結果
WA  
実行時間 -
コード長 216 bytes
コンパイル時間 665 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-09-20 06:33:34
合計ジャッジ時間 2,378 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;
use utf8;

use bigint;

my ($a, $b) = split / /, <>;
my $ans;
if ($a%2 == $b%2) {
    $ans = ($a+1)*($b+1) + $a*$b;
} else {
    $ans = ($a+1)*$b + $a*($b+1);
}
print $ans % (10**9+7), "\n";
0