結果

問題 No.607 開通777年記念
ユーザー rodearodea
提出日時 2018-11-03 16:32:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 744 bytes
コンパイル時間 1,787 ms
コンパイル使用メモリ 168,740 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-30 21:12:28
合計ジャッジ時間 3,474 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

int MOD=1e9+7;
ll INF=1e18;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int main(){
    int n, m; cin>>n>>m;
    vector<int> a(n), train(n, 0);
    bool just777=false;
    for(int i=0; i<m; i++){
        for(int j=0; j<n; j++){
            cin>>a[j];
            train[j]+=a[j];
        }

        int l=0, r=0, sum=0;
        while(r<n){
            sum+=train[r];
            if(sum==777) just777=true;
            while(777<sum && l<n){
                sum-=train[l];
                l++;
            }
            r++;
        }
    }

    if(just777) cout << "YES" << endl;
    else cout << "NO" << endl;
}
0