結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー KnotsKnots
提出日時 2020-11-27 09:17:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,038 bytes
コンパイル時間 2,901 ms
コンパイル使用メモリ 200,744 KB
実行使用メモリ 9,000 KB
最終ジャッジ日時 2023-10-01 03:58:24
合計ジャッジ時間 6,706 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 4 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 4 ms
4,376 KB
testcase_04 AC 4 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 12 ms
4,376 KB
testcase_07 AC 11 ms
4,376 KB
testcase_08 AC 26 ms
4,380 KB
testcase_09 AC 15 ms
4,380 KB
testcase_10 AC 18 ms
4,376 KB
testcase_11 AC 23 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"
#define COUT16(x) cout << fixed << setprecision(16) << (x) << "\n";

int main(){
    int n,q;cin >> n;
    string s;cin >> s;
    vector<int> a(n);
    REP(i,n) cin >> a[i];
    cin >> q;
    vector<int> k(q);
    REP(i,q) cin >> k[i];
    for(int i=0;i<q;i++){
        int ans = 0;
        for(int left=0;left<n;left++){
            ll attack = 0;
            int tes = 0;
            int right = left;
            while(right<n&&attack+a[right]<=k[i]){
                attack += a[right];
                if(s[right]=='E')tes++;
                right++;
            }
            ans = max(ans,tes);
        }
        COUT(ans);
    }
}
    
0