結果

問題 No.129 お年玉(2)
ユーザー fmhrfmhr
提出日時 2015-04-23 07:07:55
言語 Go
(1.22.1)
結果
RE  
実行時間 -
コード長 660 bytes
コンパイル時間 10,935 ms
コンパイル使用メモリ 223,464 KB
実行使用メモリ 769,292 KB
最終ジャッジ日時 2024-04-18 10:38:54
合計ジャッジ時間 40,030 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
50,048 KB
testcase_01 RE -
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 760 ms
346,240 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 RE -
testcase_29 AC 3 ms
6,944 KB
testcase_30 AC 3 ms
6,940 KB
testcase_31 AC 4 ms
10,504 KB
testcase_32 AC 3 ms
10,504 KB
testcase_33 AC 23 ms
35,080 KB
testcase_34 AC 13 ms
29,576 KB
testcase_35 AC 20 ms
32,520 KB
testcase_36 AC 22 ms
33,420 KB
testcase_37 AC 26 ms
35,084 KB
testcase_38 AC 184 ms
115,720 KB
testcase_39 AC 265 ms
163,212 KB
testcase_40 MLE -
testcase_41 AC 431 ms
264,328 KB
testcase_42 AC 200 ms
129,292 KB
testcase_43 AC 198 ms
127,500 KB
testcase_44 RE -
testcase_45 AC 125 ms
83,852 KB
testcase_46 AC 292 ms
179,596 KB
testcase_47 MLE -
testcase_48 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
    "fmt"
)


func pascal( n, m , mod int64) int64 {
    n += 1
    var p [10001][9900]int64
    p[0][0] = 1
    var i, j int64
    for i=1; i<n; i++ {
        for j=0; j<n; j++ {
            if j == 0 {
                p[i][j] = 1
            } else {
                p[i][j] = (p[i-1][j-1]+p[i-1][j])%mod
            }
        }
    }
    return p[n-1][m]
}

func main() {
    var mod int64
    mod = 1000000000
    var N, M int64
    fmt.Scan(&N)
    fmt.Scan(&M)
    var a, b, c int64
    a = N/1000/M
    b = N - (a * M) * 1000
    c = b/1000
    N /= 1000
    N %= M
//    fmt.Println(M, c)
    fmt.Println(pascal(M, c, mod)%mod)
}
0