結果
問題 |
No.607 開通777年記念
|
ユーザー |
|
提出日時 | 2018-05-18 23:22:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 213 ms / 2,000 ms |
コード長 | 644 bytes |
コンパイル時間 | 501 ms |
コンパイル使用メモリ | 64,256 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 14:00:05 |
合計ジャッジ時間 | 2,011 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include<iostream> using namespace std; int main(){ int n, m; cin >> n >> m; int sum[n] = {}; int x; for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cin >> x; sum[j] += x; } int left = -1, right = 0, ans = 0; for(right = 0; right < n; right++){ ans += sum[right]; while(ans>777 && left < right){ left++; ans -= sum[left]; } if(ans==777){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }