結果
問題 | No.1535 五七五 |
ユーザー | karinohito |
提出日時 | 2021-06-06 18:07:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 232 ms / 2,000 ms |
コード長 | 856 bytes |
コンパイル時間 | 1,585 ms |
コンパイル使用メモリ | 171,008 KB |
実行使用メモリ | 11,152 KB |
最終ジャッジ日時 | 2024-11-23 01:58:36 |
合計ジャッジ時間 | 4,533 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
//#include <atcoder/all> #include <bits/stdc++.h> //#include <windows.h> //#include <time.h> using namespace std; //using namespace atcoder; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector<ll>; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector<vector<ll>>; int main() { ll N; ll A,B,C; cin>>N>>A>>B>>C; vll S(N+2); rep(i,N){ string s; cin>>s; S[i]=s.size(); } S[N]=1e8; S[N+1]=1e8; vll SN(N+3,0); rep(i,N+2){ SN[i+1]=SN[i]+S[i]; } ll an=0; rep(i,N){ auto M=lower_bound(all(SN),SN[i]+A); if(*M!=SN[i]+A)continue; auto M2=lower_bound(all(SN),SN[i]+A+B); if(*M2!=SN[i]+A+B)continue; auto M3=lower_bound(all(SN),SN[i]+A+B+C); if(*M3!=SN[i]+A+B+C)continue; an++; } cout<<an<<endl; }