結果

問題 No.607 開通777年記念
ユーザー totori_nyaatotori_nyaa
提出日時 2019-07-17 21:23:17
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 3,495 ms
コンパイル使用メモリ 165,196 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-24 22:27:14
合計ジャッジ時間 3,169 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 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,384 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 5 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 3 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 67 ms
4,380 KB
testcase_12 AC 70 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

signed main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
 
    int n,m;
    cin>>n>>m;
    int cnt[n]={};
    int sum=0;
    for(int i=0;i<m;i++){
        sum=0;
        int t=0;
        for(int j=0;j<n;j++){
            int a;
            cin>>a;
            cnt[j]+=a;
            sum+=cnt[j];
            while(t<j && sum>777){
                sum-=cnt[t];
                t++;
            }
            if(sum==777){
            cout<<"YES"<<endl;
            return 0;
        }
        }
    }
    cout<<"NO"<<endl;
}
0