結果

問題 No.607 開通777年記念
ユーザー Totori
提出日時 2017-12-07 11:34:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1,145 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 55,048 KB
実行使用メモリ 7,296 KB
最終ジャッジ日時 2024-11-29 04:53:37
合計ジャッジ時間 3,398 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

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