結果

問題 No.1680 Sum and Difference
コンテスト
ユーザー neko_the_shadow
提出日時 2021-10-20 14:08:53
言語 Perl
(5.42.1)
コンパイル:
perl -cw _filename_
実行:
perl -X _filename_
結果
WA  
実行時間 -
コード長 216 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 338 ms
コンパイル使用メモリ 13,696 KB
実行使用メモリ 13,824 KB
最終ジャッジ日時 2026-04-08 18:18:14
合計ジャッジ時間 2,017 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #
raw source code

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