結果

問題 No.607 開通777年記念
ユーザー TotoriTotori
提出日時 2017-12-07 11:34:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,270 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 56,048 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2024-05-06 19:15:22
合計ジャッジ時間 3,849 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 54 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 5 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 1,160 ms
7,328 KB
testcase_12 AC 1,270 ms
7,224 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