結果
問題 | No.607 開通777年記念 |
ユーザー |
|
提出日時 | 2017-12-07 00:08:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 316 ms / 2,000 ms |
コード長 | 600 bytes |
コンパイル時間 | 762 ms |
コンパイル使用メモリ | 77,640 KB |
実行使用メモリ | 7,336 KB |
最終ジャッジ日時 | 2024-11-29 01:34:26 |
合計ジャッジ時間 | 2,036 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>#include <set>using namespace std;int a[1001][1001];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 + 1][j + 1];a[i + 1][j + 1] += a[i][j + 1];}}for (int i = 0; i < m; i++) {set<int> st;for (int j = 0; j < n; j++) {// s[j] - s[i] = 777st.insert(a[i + 1][j]);a[i + 1][j + 1] += a[i + 1][j];if (st.count(a[i + 1][j + 1] - 777)) {puts("YES");return 0;}}}puts("NO");}