結果

問題 No.131 マンハッタン距離
ユーザー togaerror
提出日時 2015-03-18 00:49:59
言語 Perl
(5.40.0)
結果
TLE  
実行時間 -
コード長 255 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 5,760 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-06-28 23:07:51
合計ジャッジ時間 6,516 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 1 -- * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/perl

use strict;
use warnings;

my ($x, $y, $d) = split / /, <>;
my $count = 0;

if($y < $x) {
	($x, $y) = ($y, $x);
}

for(my $i = 0; $i <= $x; $i++) {
	if($d <= $i + $y) {
		$count++;
	}
	if($i == $d) {
		last;
	}
}

print "$count\n";

exit;
0