結果
問題 | No.73 helloworld |
ユーザー |
![]() |
提出日時 | 2022-02-12 01:28:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 627 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-28 00:35:15 |
合計ジャッジ時間 | 1,227 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
ns=[0]*26 for i in range(26): t=int(input()) ns[i]=t def cal(x): t=1 for i in range(x-1,0,-1): t=max(t,(i*(i-1)) // 2 * (x-i)) return t def cal2(x): t=1 for i in range(x-1,0,-1): t=max(t,i*(x-i)) return t s='helowrd' ss='helloworld' ans=1 for i in range(len(s)): if ns[ord(s[i])%97] < ss.count(s[i]): ans=0 break else: if s[i] == 'l': t = cal(ns[ord(s[i])%97]) elif s[i] == 'o': t = cal2(ns[ord(s[i])%97]) else: t = ns[ord(s[i])%97] ans *= t print(ans)