結果

問題 No.540 格子点と経路
ユーザー tailstails
提出日時 2017-06-30 23:51:56
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 07:14:07
合計ジャッジ時間 1,195 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 7 ms
6,816 KB
testcase_02 AC 8 ms
6,940 KB
testcase_03 AC 8 ms
6,940 KB
testcase_04 AC 7 ms
6,940 KB
testcase_05 AC 7 ms
6,948 KB
testcase_06 WA -
testcase_07 AC 7 ms
6,944 KB
testcase_08 AC 7 ms
6,944 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 8 ms
6,940 KB
testcase_23 AC 8 ms
6,940 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Possible precedence problem on bitwise & operator at Main.pl line 19.
Main.pl syntax OK

ソースコード

diff #

($a,$b)=glob<>;
($a,$b)=($b,$a)if$a<$b;
if($a%2==0){
	if($b%2==0){
		$r=$a*$b+$b+1;
	}
	if($b%2==1){
		$r=($a*2-2)*($b+0)/2+4;
	}
}
if($a%2==1){
	if($b%2==0){
		$r=($a*2+1)*$b/2+1;
	}
	if($b%2==1){
		$r=($a*2+1)*($b+1)/2-1;
	}
}
if($a==2&$b==2){
	$r=$a*2+2;
}
if($b==0){
	$r=1;
}
if($a==0){
	$r=0;
}
print$r;

0