QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#265851 | #5646. Uniform Chemistry | BitsPlease# | WA | 0ms | 3392kb | C++20 | 791b | 2023-11-25 21:49:50 | 2023-11-25 21:49:50 |
Judging History
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'