結果

問題 No.607 開通777年記念
ユーザー toto6114toto6114
提出日時 2019-10-06 17:26:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 729 ms
コンパイル使用メモリ 91,656 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 02:03:04
合計ジャッジ時間 2,363 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 13 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 5 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 205 ms
5,376 KB
testcase_12 AC 213 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0