結果

問題 No.607 開通777年記念
ユーザー tailstails
提出日時 2017-12-07 00:17:21
言語 Perl
(5.38.2)
結果
AC  
実行時間 1,529 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-05-06 17:22:19
合計ジャッジ時間 4,116 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,888 KB
testcase_01 AC 7 ms
5,760 KB
testcase_02 AC 6 ms
5,888 KB
testcase_03 AC 7 ms
5,888 KB
testcase_04 AC 7 ms
5,888 KB
testcase_05 AC 6 ms
5,888 KB
testcase_06 AC 6 ms
5,888 KB
testcase_07 AC 116 ms
6,144 KB
testcase_08 AC 7 ms
5,888 KB
testcase_09 AC 23 ms
5,888 KB
testcase_10 AC 7 ms
5,888 KB
testcase_11 AC 1,281 ms
6,272 KB
testcase_12 AC 1,529 ms
6,400 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($n,$m)=glob<>;
for(1..$m){
	@a=glob<>;
	$s=0;
	$i=0;
	$j=0;
	while($j<$n){
		if($s<777){
			$s+=$b[$j]+=$a[$j];
			++$j;
		}
		while($s>777){
			$s-=$b[$i];
			++$i;
		}
		if($s==777){
			print"YES";
			exit;
		}
	}
}
print"NO"
0