結果

問題 No.1535 五七五
ユーザー KudeKude
提出日時 2021-06-06 18:21:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 1,174 bytes
コンパイル時間 4,644 ms
コンパイル使用メモリ 260,328 KB
実行使用メモリ 7,104 KB
最終ジャッジ日時 2023-08-15 00:33:07
合計ジャッジ時間 6,783 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 85 ms
6,988 KB
testcase_05 AC 103 ms
6,988 KB
testcase_06 AC 91 ms
6,980 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,384 KB
testcase_17 AC 1 ms
4,384 KB
testcase_18 AC 102 ms
6,988 KB
testcase_19 AC 109 ms
7,096 KB
testcase_20 AC 108 ms
6,988 KB
testcase_21 AC 107 ms
7,100 KB
testcase_22 AC 106 ms
7,104 KB
testcase_23 AC 103 ms
7,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n)for (int i = 0; i < int(n); ++i)
#define rrep(i,n)for (int i = int(n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<class T> void chmax(T& a, const T& b) {a = max(a, b);}
template<class T> void chmin(T& a, const T& b) {a = min(a, b);}
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    int a, b, c;
    cin >> a >> b >> c;
    VI s(n), t(n + 1);
    rep(i, n) {
        string si;
        cin >> si;
        s[i] = si.size();
        t[i + 1] = t[i] + s[i];
    }
    int ans = 0;
    rep(i, n) {
        auto p1 = lower_bound(all(t), a + t[i]);
        auto p2 = lower_bound(p1, t.end(), a + b + t[i]);
        auto p3 = lower_bound(p2, t.end(), a + b + c + t[i]);
        if (p3 != t.end() && *p1 == a + t[i] && *p2 == a + b + t[i] && *p3 == a + b + c + t[i]) {
            ans++;
        }
    }
    cout << ans << '\n';
}
0