結果
問題 | No.607 開通777年記念 |
ユーザー |
![]() |
提出日時 | 2018-01-25 11:16:14 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 75 ms / 2,000 ms |
コード長 | 804 bytes |
コンパイル時間 | 2,021 ms |
コンパイル使用メモリ | 163,524 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-30 11:48:23 |
合計ジャッジ時間 | 3,118 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>using namespace std;static const int INF = 1e9 + 7;template<typename T>using Vec = vector<T>;template<typename T, typename T2>using P = pair<T, T2>;template<typename... Args>using Tup = tuple<Args...>;using llong = long long;using ullong = unsigned long long;using uint = unsigned int;void hawawa(){int n, m;cin >> n >> m;vector<int> a(n);for (int i = 0; i < m; i++) {int s = 0, cnt = 0;for (int g = 0; g < n; g++) {int num;cin >> num;a[g] += num;while (777 < cnt + a[g]) {cnt -= a[s];s++;}cnt += a[g];if (cnt == 777) {cout << "YES\n";return;}}}cout << "NO\n";}int main(){ios::sync_with_stdio(false);cin.tie(0);hawawa();}