結果
問題 |
No.170 スワップ文字列(Easy)
|
ユーザー |
![]() |
提出日時 | 2017-01-16 20:56:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 350 bytes |
コンパイル時間 | 1,918 ms |
コンパイル使用メモリ | 166,748 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 00:45:51 |
合計ジャッジ時間 | 2,337 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; int func(int N){ if(N==1) return 1; return N*func(N-1); } int main() { string S; cin>>S; int p=func(S.size()); int Z='Z'; int hist[Z+1]={0}; for(int i=0;i<S.size();i++){ hist[S[i]]++; } for(int i='A';i<='Z';i++){ if(hist[i]>0){ p/=func(hist[i]); } } cout<<p-1<<endl; return 0; }