結果
問題 |
No.171 スワップ文字列(Med)
|
ユーザー |
![]() |
提出日時 | 2017-05-17 09:12:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 613 bytes |
コンパイル時間 | 1,258 ms |
コンパイル使用メモリ | 160,692 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 12:26:22 |
合計ジャッジ時間 | 2,337 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 WA * 4 RE * 4 |
ソースコード
#include"bits/stdc++.h" #include<fstream> #include<random> //#include<bits/stdc++.h> using namespace std; #define print(x) cout<<x<<endl; #define rep(i,a,b) for(int i=a;i<b;i++) typedef long long ll; const ll mod = 573; #define pi 3.141592 string s; ll ex(int n) { if (n == 1)return 1; return n*ex(n - 1)%mod; } int main() { cin >> s; ll count[26] = {}; int n = s.size(); rep(i, 0, n) { rep(j, 0, 26) { if (j == s[i] - 'A') { count[j]++; } } } ll ch = ex(n)%mod; rep(i, 0, 26) { if(count[i]>1)ch /= ex(count[i])%mod; } print(ch%mod-1); //rep(i, 0, 26)print(count[i]); return 0; }