結果

問題 No.2201 p@$$w0rd
ユーザー hatsuka_iwa
提出日時 2023-04-08 03:19:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 1,678 ms
コンパイル使用メモリ 166,944 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-03 01:15:12
合計ジャッジ時間 2,598 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S; cin >> S;
  int LO = 0, AS = 0;

  auto P = [](auto P, int N) -> int {
    if (N == 0) return 1;
    int T = P(P, N / 2);
    if (N % 2 == 0) return T * T;
    return T * T * 2;
  };

  for (char C : S) {
    if (C == 'l' || C == 'o') LO++;
    if (C == 'a' || C == 's') AS++;
  }

  cout << (P(P, LO) - 1) * (P(P, AS) - 1) << endl;
}
0