QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#265851#5646. Uniform ChemistryBitsPlease#WA 0ms3392kbC++20791b2023-11-25 21:49:502023-11-25 21:49:50

Judging History

你现在查看的是最新测评结果

  • [2023-11-25 21:49:50]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3392kb
  • [2023-11-25 21:49:50]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;

typedef long long ll;

#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vars, Args&&... values) {
  cout << vars << " = ";
  string delim = "";
  (..., (cout << delim << values, delim = ", "));
  cout << '\n';
}

using ld = long double;

void solve() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> cs(n * 2 + 1);
  int ans = 0;
  for (int i = 0; i < n * 2 - 1; ++i) {
    cs[i] = s[i] == 'W';
    if (i > 0) cs[i] += cs[i - 1];
    if (i > n - 1) ans = max(ans, cs[i] - (i - n ? cs[i - n] : 0));
  }
  cout << ans << '\n';
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1;
  // cin >> t;
  while(t--) {
    solve();
  }
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3392kb

input:

2 3
1 1 1

output:

0

result:

wrong answer 1st numbers differ - expected: '1.000000000', found: '0.000000000', error = '1.000000000'