結果
問題 |
No.935 う し た ぷ に き あ く ん 笑 ビ - ム
|
ユーザー |
![]() |
提出日時 | 2020-01-21 22:44:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 492 bytes |
コンパイル時間 | 704 ms |
コンパイル使用メモリ | 74,196 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-06 10:49:08 |
合計ジャッジ時間 | 1,991 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 4 WA * 54 |
ソースコード
#include <string> #include <vector> #include <iostream> #include <algorithm> 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; 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; }