結果

問題 No.346 チワワ数え上げ問題
ユーザー asi1024
提出日時 2016-03-03 02:53:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 1,571 ms
コンパイル使用メモリ 160,060 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 13:40:41
合計ジャッジ時間 2,534 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#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);

int 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;
}
0