結果
| 問題 |
No.935 う し た ぷ に き あ く ん 笑 ビ - ム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-29 22:18:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 775 bytes |
| コンパイル時間 | 1,508 ms |
| コンパイル使用メモリ | 169,924 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-20 23:28:16 |
| 合計ジャッジ時間 | 7,959 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 RE * 44 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
int main(){
int n;
cin >> n;
string s;
cin >> s;
vector<ll> a(n);
rep(i,n){
cin >> a[i];
}
int q;
cin >> q;
rep(query,q){
ll k;
cin >> k;
ll wa = 0;
int ans = 0;
int r = 0;
int cnt = 0;
rep(l,n){
for(;wa+a[r]<=k;r++){
wa+=a[r];
if(s[r]=='E'){
cnt++;
}
}
ans = max(ans,cnt);
wa-=a[l];
if(s[l]=='E'){
cnt--;
}
}
cout << ans << endl;
}
return 0;
}