結果

問題 No.607 開通777年記念
ユーザー pekempeypekempey
提出日時 2017-12-07 00:02:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 452 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 68,908 KB
実行使用メモリ 7,344 KB
最終ジャッジ日時 2023-08-19 10:04:38
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge14 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 12 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 4 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 187 ms
7,100 KB
testcase_12 AC 193 ms
7,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int a[1001][1000];

int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i + 1][j];
      a[i + 1][j] += a[i][j];
    }
    for (int j = 0; j + 3 < m; j++) {
      if (a[i + 1][j] + a[i + 1][j + 1] + a[i + 1][j + 2] == 777) {
        puts("YES");
        return 0;
      } 
    }
  }
  puts("NO");
}
0