結果

問題 No.607 開通777年記念
ユーザー seekingseeking
提出日時 2019-11-16 14:36:51
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 697 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 70,640 KB
実行使用メモリ 7,432 KB
最終ジャッジ日時 2023-10-25 03:52:51
合計ジャッジ時間 1,893 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 40 ms
6,200 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 4 ms
4,348 KB
testcase_10 AC 4 ms
4,348 KB
testcase_11 AC 230 ms
7,432 KB
testcase_12 AC 214 ms
7,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int a[1010][1010];
int now[1010];
int main()
{
	int N, M;
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		for (int j = 0; j < N; j++) {
			cin >> a[i][j];
		}
	}
	int sum = 0;
	int k = 0;
	for (int i = 0; i < M; i++) {
		k = 0; sum = 0;
		for (int j = 0; j < N; j++) {
			now[j] += a[i][j];
			sum += now[j];
			while (sum > 777) {
				sum -= now[k];
				k++;
			}
			if (sum == 777) {
				cout << "YES" << endl;
				return 0;
			}
		}
	}
	cout << "NO" << endl;
}
0