結果
| 問題 | No.607 開通777年記念 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-10-06 17:26:39 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 209 ms / 2,000 ms | 
| コード長 | 621 bytes | 
| コンパイル時間 | 898 ms | 
| コンパイル使用メモリ | 90,652 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-10 18:42:50 | 
| 合計ジャッジ時間 | 2,341 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 10 | 
ソースコード
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<vector>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
int main() {
  int n,m,a[1000]={};
  cin >> n >> m;
  for(int i=0; i<m; i++) {
    for(int j=0; j<n; j++) {
      int x;
      cin >> x;
      a[j]+=x;
    }
    int left=-1,cnt=0;
    for(int right=0; right<n; right++) {
      cnt+=a[right];
      while(cnt>777&&left<right) {
        left++;
        cnt-=a[left];
      }
      if(cnt==777) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
}
            
            
            
        