結果

問題 No.607 開通777年記念
ユーザー tailstails
提出日時 2017-12-07 00:17:21
言語 Perl
(5.38.2)
結果
AC  
実行時間 1,673 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 5,344 KB
実行使用メモリ 5,696 KB
最終ジャッジ日時 2023-08-19 10:09:34
合計ジャッジ時間 4,549 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,124 KB
testcase_01 AC 6 ms
5,256 KB
testcase_02 AC 6 ms
5,128 KB
testcase_03 AC 6 ms
5,224 KB
testcase_04 AC 6 ms
5,136 KB
testcase_05 AC 6 ms
5,192 KB
testcase_06 AC 6 ms
5,132 KB
testcase_07 AC 125 ms
5,328 KB
testcase_08 AC 6 ms
5,136 KB
testcase_09 AC 24 ms
5,188 KB
testcase_10 AC 7 ms
5,296 KB
testcase_11 AC 1,507 ms
5,620 KB
testcase_12 AC 1,673 ms
5,696 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