結果
問題 | No.73 helloworld |
ユーザー |
|
提出日時 | 2016-02-25 15:38:19 |
言語 | Go (1.23.4) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,001 bytes |
コンパイル時間 | 15,933 ms |
コンパイル使用メモリ | 224,876 KB |
実行使用メモリ | 10,160 KB |
最終ジャッジ日時 | 2024-12-17 23:57:23 |
合計ジャッジ時間 | 21,519 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 TLE * 1 |
ソースコード
package mainimport ("bufio""fmt""os""strconv")var sc = bufio.NewScanner(os.Stdin)func main() {sc.Split(bufio.ScanWords)alpha := make([]int, 26)for i := range alpha {alpha[i] = nextInt()}t := alpha['h'-'a'] * alpha['e'-'a'] * alpha['w'-'a'] * alpha['r'-'a'] * alpha['d'-'a']o := alpha['o'-'a']t *= (o / 2) * (o - o/2)l := alpha['l'-'a']n := 2*(l/3) + l%3t *= int(NCR(uint64(n), 2)) * (l - n)fmt.Println(t)}func nextLine() string {sc.Scan()return sc.Text()}func nextInt() int {i, _ := strconv.Atoi(nextLine())return i}func nextInt64() int64 {i, _ := strconv.ParseInt(nextLine(), 10, 64)return i}func nextUint64() uint64 {i, _ := strconv.ParseUint(nextLine(), 10, 64)return i}func nextFloat() float64 {f, _ := strconv.ParseFloat(nextLine(), 64)return f}func NCR(n, r uint64) uint64 {k := rif k > n/2 {k = n - r}ret := uint64(1)for i := uint64(1); i <= k; i++ {ret *= n - i + 1ret /= i}return ret}