結果

問題 No.607 開通777年記念
ユーザー Totori
提出日時 2017-12-07 11:08:39
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 508 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 68,428 KB
最終ジャッジ日時 2025-01-05 04:52:48
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string.h>
using namespace std;
int a[1001][1001];
int main() {
	int n,m;
	int c[1001];
	cin>>n>>m;
	for(int i=1; i<=m; i++){
		memset(c,0,sizeof(int)*1001);
		for(int j=1;j<=n;j++){
			cin>>c[j];
		}
		for(int k=1;k<=n;k++){
			for(int l=k;l<=n;l++){
				for(int x=k;x<=l;x++) {
					a[k][l]+=c[x];
				}
			}
		}
		for(int k=1;k<=n;k++) {
			for (int l=1;l<=n;l++) {
				if(a[k][l]==777){
					cout<<"YES"<<endl;
					return 0;
				}
			}
		}
	}
	cout<<"NO"<<endl;
	return 0;
}
0