結果
| 問題 | No.2276 I Want AC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-08 18:25:01 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 663 bytes |
| 記録 | |
| コンパイル時間 | 605 ms |
| コンパイル使用メモリ | 74,880 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-14 13:41:53 |
| 合計ジャッジ時間 | 1,889 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 2 WA * 54 |
ソースコード
#include <iostream>
#include <string>
int main() {
long long A = 0, C = 0, a = 0, n = 0;
char L = 'A';
std::string S;
std::cin >> S; // Assuming the first input is not used as per the Python code
for (char s : S) {
if (s == L) {
A += 1;
} else {
C += 1;
n += A;
}
}
long long c = C;
long long m = n;
for (char s : S) {
if (s < L) {
n += c - 1 - a;
a += 1;
c -= 1;
}
c -= s > L;
a += s == L;
m = std::max(n, m);
}
std::cout << m << std::endl;
return 0;
}