結果
問題 | No.607 開通777年記念 |
ユーザー |
![]() |
提出日時 | 2019-07-17 21:23:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 2,075 ms |
コンパイル使用メモリ | 166,664 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 08:51:38 |
合計ジャッジ時間 | 3,141 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include<bits/stdc++.h>using namespace std;typedef long long ll;signed main(){ios::sync_with_stdio(false);cin.tie(0);int n,m;cin>>n>>m;int cnt[n]={};int sum=0;for(int i=0;i<m;i++){sum=0;int t=0;for(int j=0;j<n;j++){int a;cin>>a;cnt[j]+=a;sum+=cnt[j];while(t<j && sum>777){sum-=cnt[t];t++;}if(sum==777){cout<<"YES"<<endl;return 0;}}}cout<<"NO"<<endl;}