結果
| 問題 |
No.346 チワワ数え上げ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-11 11:36:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 516 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 55,324 KB |
| 実行使用メモリ | 16,968 KB |
| 最終ジャッジ日時 | 2024-11-25 08:05:07 |
| 合計ジャッジ時間 | 37,404 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 TLE * 12 |
ソースコード
#include <iostream>
#include <cstdint>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
int ans = 0;
for (size_t i = 0; i < s.size(); i++) {
if (s.at(i) == 'c') {
for (size_t j = i + 1; j < s.size(); j++) {
if (s.at(j) == 'w') {
for (size_t k = j + 1; k < s.size(); k++) {
if (s.at(k) == 'w') {
ans++;
}
}
}
}
}
}
cout << ans << endl;
}