結果

問題 No.607 開通777年記念
ユーザー sugarrrsugarrr
提出日時 2018-01-31 20:37:54
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 1,032 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 73,224 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-28 17:32:28
合計ジャッジ時間 1,948 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>

using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
typedef pair<double,double>d_d;
#define inf 100000000//10^8

/////////////////////////////////




int main(){
    int n,m;cin>>n>>m;
    int sum[n+1];for(int i=0;i<=n;i++)sum[i]=0;
    bool flag=false;
    while(m--){
        int su=0,p;
        for(int i=1;i<=n;i++){
            cin>>p;su+=p;
            sum[i]+=su;
        }
        for(int i=0;i<=n;i++){
            int search=777+sum[i];
            int *p=lower_bound(sum+i,sum+n+1,search);
            if(*p==search)flag=true/*,cout<<m<<" "<<i<<endl*/;
        }
    }
    if(flag)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


0