結果
問題 | No.607 開通777年記念 |
ユーザー |
![]() |
提出日時 | 2018-07-26 14:23:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 327 ms / 2,000 ms |
コード長 | 443 bytes |
コンパイル時間 | 1,684 ms |
コンパイル使用メモリ | 175,568 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 03:19:10 |
合計ジャッジ時間 | 3,274 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include<bits/stdc++.h>using namespace std;using Int = long long;//INSERT ABOVE HEREsigned main(){Int n,m;cin>>n>>m;auto YES=[]{cout<<"YES"<<endl;exit(0);};vector<Int> v(n,0);for(Int i=0;i<m;i++){set<Int> dp({0});Int res=0;for(Int j=0;j<n;j++){Int a;cin>>a;v[j]+=a;res+=v[j];dp.emplace(res);if(dp.count(res-777)) YES();}}cout<<"NO"<<endl;return 0;}