結果
| 問題 |
No.346 チワワ数え上げ問題
|
| コンテスト | |
| ユーザー |
asi1024
|
| 提出日時 | 2016-03-03 02:55:24 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 434 bytes |
| コンパイル時間 | 1,384 ms |
| コンパイル使用メモリ | 159,668 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-24 13:38:35 |
| 合計ジャッジ時間 | 1,895 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
const ld eps = 1e-9, pi = acos(-1.0);
ll dp[3];
int main() {
string str; cin >> str;
for (char c: str) {
if (c == 'c') dp[0]++;
else if (c == 'w') {
dp[2] += dp[1];
dp[1] += dp[0];
}
}
cout << dp[2] << endl;
return 0;
}
asi1024