結果

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

テストケース

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

ソースコード

diff #

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