結果
| 問題 | No.170 スワップ文字列(Easy) |
| コンテスト | |
| ユーザー |
rocoder
|
| 提出日時 | 2017-08-12 13:33:35 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 58 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2026-09-15 09:40:23 |
| 合計ジャッジ時間 | 2,066 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 20 |
ソースコード
# your code goes here
#swap
S=list(input())
S.sort()
i=0
k=1
l=1
while i<len(S)-1:
if S[i]==S[i+1]:
k*=2
j=2
while i<len(S)-1 and S[i]==S[i+1]:
j+=1
k*=j
i+=1
l*=i
else:
i+=1
l*=i
i+=1
l*=i
print(l//k)
rocoder