結果

問題 No.607 開通777年記念
ユーザー TotoriTotori
提出日時 2017-12-07 11:34:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,221 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 487 ms
コンパイル使用メモリ 52,264 KB
実行使用メモリ 7,260 KB
最終ジャッジ日時 2023-08-19 12:05:04
合計ジャッジ時間 3,736 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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