結果
| 問題 |
No.935 う し た ぷ に き あ く ん 笑 ビ - ム
|
| コンテスト | |
| ユーザー |
square1001
|
| 提出日時 | 2020-01-21 22:43:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 479 bytes |
| コンパイル時間 | 653 ms |
| コンパイル使用メモリ | 71,672 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 10:47:40 |
| 合計ジャッジ時間 | 2,014 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 4 WA * 54 |
ソースコード
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main() {
int N; string S;
cin >> N >> S;
vector<long long> A(N);
for(int i = 0; i < N; ++i) cin >> A[i];
long long sum = 0;
vector<long long> seq = { 0 };
for(int i = 0; i < N; ++i) {
sum += A[i];
if(S[i] == 'E') seq.push_back(sum);
}
int Q;
cin >> Q;
while(Q--) {
long long x;
cin >> x;
cout << lower_bound(seq.begin(), seq.end(), x + 1) - seq.begin() << endl;
}
return 0;
}
square1001