結果
| 問題 | No.607 開通777年記念 | 
| コンテスト | |
| ユーザー | 👑 | 
| 提出日時 | 2020-03-18 00:06:35 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 229 ms / 2,000 ms | 
| コード長 | 489 bytes | 
| コンパイル時間 | 553 ms | 
| コンパイル使用メモリ | 64,640 KB | 
| 実行使用メモリ | 7,456 KB | 
| 最終ジャッジ日時 | 2024-11-30 23:28:54 | 
| 合計ジャッジ時間 | 1,849 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 10 | 
ソースコード
#include <iostream>
using namespace std;
int main(){
	int n,m;cin>>n>>m;
	int mp[m][n];
	int nw[n];
	for(int i = 0; m > i; i++){
		for(int j = 0; n > j; j++){
			cin>>mp[i][j];
		}
	}
	for(int i = 0; n > i; i++)nw[i]=0;
	for(int i = 0; m > i; i++){
		int sm = 0;
		int pv = 0;
		for(int j = 0; n > j; j++){
			nw[j] = nw[j]+mp[i][j];
			sm += nw[j];
			while(777 < sm){
				sm-=nw[pv];pv++;
			}
			if(777==sm){
				cout << "YES" << endl;
				return 0;
			}
		}
	}
	cout << "NO" << endl;
}
            
            
            
        