結果
| 問題 | 
                            No.2593 Reorder and Mod 120
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-12-21 11:34:18 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 619 bytes | 
| コンパイル時間 | 180 ms | 
| コンパイル使用メモリ | 82,332 KB | 
| 実行使用メモリ | 68,792 KB | 
| 最終ジャッジ日時 | 2024-09-27 10:57:09 | 
| 合計ジャッジ時間 | 2,125 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 4 WA * 17 RE * 5 | 
ソースコード
N=int(input()) S=str(input()) arr=[0,0,0,0,0,0,0,0,0,0] for i in range(N): arr[int(S[i])]+=1 allN=0 for i in range(10): allN+=i*(arr[i]%120)*40 allN%=120 check=[] for i in range(10): for j in range(10): for k in range(10): if i==j and j==k and arr[i]<3: continue if (i==j and arr[i]<2) or (j==k and arr[j]<2) or (k==i and arr[k]<2): continue if arr[i]<1 or arr[j]<1 or arr[k]<1: continue check.append((allN -i*1 -j*10 -k*100)%120) check.sort() count=1 temp=check[0] for i in range(1, len(check)): if temp!=check[i]: count+=1 temp=check[i] print(count)