結果

問題 No.607 開通777年記念
ユーザー stone_725stone_725
提出日時 2018-01-25 11:16:14
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 804 bytes
コンパイル時間 3,441 ms
コンパイル使用メモリ 134,844 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-20 10:10:19
合計ジャッジ時間 4,432 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 6 ms
4,384 KB
testcase_08 AC 2 ms
4,384 KB
testcase_09 AC 3 ms
4,384 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 70 ms
4,384 KB
testcase_12 AC 75 ms
4,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

static const int INF = 1e9 + 7;

template<typename T>
using Vec = vector<T>;

template<typename T, typename T2>
using P = pair<T, T2>;

template<typename... Args>
using Tup = tuple<Args...>;

using llong = long long;
using ullong = unsigned long long;
using uint = unsigned int;

void hawawa()
{
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  for (int i = 0; i < m; i++) {
    int s = 0, cnt = 0;
    for (int g = 0; g < n; g++) {
      int num;
      cin >> num;
      a[g] += num;
      while (777 < cnt + a[g]) {
        cnt -= a[s];
        s++;
      }
      cnt += a[g];
      if (cnt == 777) {
        cout << "YES\n";
        return;
      }
    }
  }
  cout << "NO\n";
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  hawawa();
}
0