結果

問題 No.607 開通777年記念
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-19 01:35:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 193,512 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 03:28:25
合計ジャッジ時間 3,219 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n,m;
    cin>>n>>m;
    int a[m]{};
    for (int i=0;i<n;i++) {
        for (int j=0;j<m;j++) {
            int b;cin>>b;
            a[j]+=b;
        }
        int l=0;
        int sum=0;
        for (int r=0;r<m;r++) {
            sum+=a[r];
            while (sum>777) {
                sum-=a[l];
                l++;
            }
            if (sum==777) {
                puts("YES");
                return 0;
            }
        }
    }
    puts("NO");
    return 0;
}
0