結果
問題 | No.607 開通777年記念 |
ユーザー |
![]() |
提出日時 | 2018-02-16 22:40:28 |
言語 | Perl (5.40.0) |
結果 |
AC
|
実行時間 | 480 ms / 2,000 ms |
コード長 | 198 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-23 03:41:34 |
合計ジャッジ時間 | 2,039 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
Name "main::M" used only once: possible typo at Main.pl line 1. Main.pl syntax OK
ソースコード
($N,$M)=glob<>;for(<>){$i=0;$_[$i++]+=$_ for split;$s=$l=$r=0;while($r<=$N){if($s==777){exit!print'YES'}elsif($s<777){$s+=$_[$r++]}else{$s-=$_[$l++]}}}print'NO'