結果

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

ソースコード

diff #
raw source code

use strict;
use warnings;
use utf8;

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