結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー pointNpointN
提出日時 2020-02-26 01:35:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,230 bytes
コンパイル時間 1,305 ms
コンパイル使用メモリ 116,100 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-21 15:49:40
合計ジャッジ時間 12,799 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 TLE -
testcase_07 WA -
testcase_08 OLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
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 <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  ll N; cin >> N;
  string S; cin >> S;
  vector<ll> A(N); rep(i,N) cin >> A[i];
  vector<ll> sums(N+1,0);
  rep(i,N) sums[i+1] = sums[i] + A[i];
  vector<ll> esum(N+1,0);
  rep(i,N) esum[i+1] = esum[i] + ((S[i]=='E')?1:0);
  // rep(i,N+1) cout << esum[i] << " ";
  ll Q; cin >> Q;
  rep(q,Q){
    ll K; cin >> K;
    ll ans=0;
    ll l,r;
    for(l=0,r=0; l<=N; l++){
      while(r+1<=N && sums[r+1]-sums[l]<=K){
        r++;
      }
      cout << l << " " << r << " " << esum[r]-esum[l] << endl;
      ans = max(ans,esum[r]-esum[l]);
    }
    cout << ans << endl;
  }
  return 0;
}
0