結果
| 問題 |
No.171 スワップ文字列(Med)
|
| コンテスト | |
| ユーザー |
Twizz
|
| 提出日時 | 2017-05-17 09:40:27 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 659 bytes |
| コンパイル時間 | 1,283 ms |
| コンパイル使用メモリ | 160,908 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-17 12:26:35 |
| 合計ジャッジ時間 | 1,657 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 1 WA * 9 |
ソースコード
#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 = 1000000007;
#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;
}
if (ch%537 == 0) { print(0); }
else print(ch%mod - 1);
//rep(i, 0, 26)print(count[i]);
return 0;
}
Twizz