結果
| 問題 |
No.607 開通777年記念
|
| コンテスト | |
| ユーザー |
sugarrr
|
| 提出日時 | 2018-01-31 20:43:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 240 ms / 2,000 ms |
| コード長 | 1,047 bytes |
| コンパイル時間 | 677 ms |
| コンパイル使用メモリ | 73,400 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-29 23:55:41 |
| 合計ジャッジ時間 | 1,948 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#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;
}
int l=0,r=1;
while(r<=n){
if(l==r){r++;continue;}
if(sum[r]-sum[l]==777){flag=true;break;}
if(sum[r]-sum[l]>777)l++;
else r++;
}
}
if(flag)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
}
sugarrr