結果

問題 No.607 開通777年記念
ユーザー sggkshiosggkshio
提出日時 2019-12-09 01:04:59
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 888 bytes
コンパイル時間 1,241 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 7,376 KB
最終ジャッジ日時 2023-08-30 23:57:07
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;



int main() {
	
	int n, m;
	cin >> n >> m;
	vector<int>t(n);
	vector<vector<int>>p(m+1,vector<int>(n));

	for (int i = 0; i < m; i++) {
		for (int j = 0; j < n; j++) {
			int x;
			cin >> x;
			p[i][j] += x;
			p[i + 1][j] += p[i][j];
		
		}
	}
	for (int i = 0; i < m; i++) {
		int y = 0;
		int ans = 0;
		for (int j = 0; j < n; j++) {
			ans += p[i][j];
			if (ans==777) {
				cout << "YES" << endl;
				return 0;
			}
			while (ans > 777) {
				ans -= p[i][y];
				y++;
			}
		}
	}
	cout << "NO" << endl;

	return 0;


		
}
0