結果

問題 No.607 開通777年記念
ユーザー CleyLCleyL
提出日時 2020-03-18 00:09:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 771 ms
コンパイル使用メモリ 66,144 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-05-08 01:54:44
合計ジャッジ時間 1,678 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 39 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 226 ms
7,424 KB
testcase_12 AC 213 ms
7,412 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~

ソースコード

diff #

#include <iostream>
using namespace std;
int n,m,sm,pv,i,j;
main(){
	cin>>n>>m;
	int mp[m][n];
	int nw[n];
	for(i=0;m>i;i++)for(j=0;n>j;j++)cin>>mp[i][j];
	for(i=0;n>i;i++)nw[i]=0;
	for(i=0;m>i;i++){
		sm=0;pv=0;
		for(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;
}
0