結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
LogicR_piman
|
| 提出日時 | 2016-10-07 23:58:09 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 384 bytes |
| 記録 | |
| コンパイル時間 | 346 ms |
| コンパイル使用メモリ | 72,816 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-15 23:50:04 |
| 合計ジャッジ時間 | 2,565 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 9 |
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main() {
string s;
int i = 0, j = 0, n, a = 0;
long l;
cin >> s;
l = s.length();
while (-1) {
if (s[i] == 'c') {
n = 0;
for (j = i; j < l; j++) {
if (s[j] == 'w') {
n++;
}
}
a = a + n*(n - 1) / 2;
}
else if (s[i] == '\0') {
break;
}
i++;
}
cout << a << endl;
return 0;
}
LogicR_piman