結果

問題 No.276 連続する整数の和(1)
ユーザー togaerrortogaerror
提出日時 2015-09-09 14:22:00
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 232 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 9,424 KB
最終ジャッジ日時 2023-09-26 10:14:47
合計ジャッジ時間 2,689 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
9,424 KB
testcase_01 AC 6 ms
4,864 KB
testcase_02 AC 5 ms
5,056 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;

my $n = <>;
my $count = 0;
my $ans;

for(my $i = 0; $i < $n; $i++) {
	$count += $i;
}
for(my $i = 1; $i < $n + 1; $i++) {
	if(($n % $i == 0)&&($count % $i == 0)) {
		$ans = $i;
	}
}

print "$ans\n";

exit;
0