結果
| 問題 |
No.935 う し た ぷ に き あ く ん 笑 ビ - ム
|
| コンテスト | |
| ユーザー |
toririm_
|
| 提出日時 | 2019-11-29 22:40:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 584 bytes |
| コンパイル時間 | 1,770 ms |
| コンパイル使用メモリ | 159,204 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-20 23:39:49 |
| 合計ジャッジ時間 | 2,782 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 3 WA * 55 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
#define MOD 1000000007
#define int long long
signed main(){
string s;
int n;cin>>n>>s;
int a[n];
int w[n];
w[0]=(s[0]=='E');
rep(i,n-1){
w[i+1]=w[i]+(s[i+1]=='E');
}
cin>>a[0];
rep(i,n-1){
int r;cin>>r;
a[i+1]=a[i]+r;
}
int q;cin>>q;
rep(i,q){
int k;
cin>>k;
auto j=upper_bound(a,a+n,k);
j--;
int ans=j-a;
cout<<w[ans]<<endl;
}
}
toririm_