結果
| 問題 |
No.607 開通777年記念
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-18 04:06:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 67 ms / 2,000 ms |
| コード長 | 580 bytes |
| コンパイル時間 | 1,383 ms |
| コンパイル使用メモリ | 167,948 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 07:51:46 |
| 合計ジャッジ時間 | 2,613 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int w, h;
cin >> w >> h;
vector<int> A(w);
for(int y = 0; y < h; y++){
for(int x = 0, v; x < w; x++){
cin >> v;
A[x] += v;
}
for(int l = 0, r = 0, s = 0; l < w; l++){
while(r < w && s < 777)s += A[r++];
if(s == 777){
cout << "YES" << '\n';
return 0;
}
s -= A[l];
}
}
cout << "NO" << '\n';
}