結果

問題 No.129 お年玉(2)
ユーザー fmhrfmhr
提出日時 2015-04-23 07:09:19
言語 Go
(1.22.1)
結果
RE  
実行時間 -
コード長 660 bytes
コンパイル時間 12,952 ms
コンパイル使用メモリ 234,672 KB
実行使用メモリ 766,976 KB
最終ジャッジ日時 2024-04-18 10:41:24
合計ジャッジ時間 37,472 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
50,048 KB
testcase_01 RE -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 578 ms
346,240 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 AC 965 ms
454,016 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 924 ms
435,712 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 1,006 ms
472,320 KB
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 1,040 ms
458,880 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 930 ms
438,400 KB
testcase_26 AC 953 ms
448,896 KB
testcase_27 AC 955 ms
435,584 KB
testcase_28 RE -
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 3 ms
5,376 KB
testcase_32 AC 3 ms
5,376 KB
testcase_33 AC 15 ms
10,240 KB
testcase_34 AC 7 ms
5,632 KB
testcase_35 AC 14 ms
9,344 KB
testcase_36 AC 16 ms
10,368 KB
testcase_37 AC 19 ms
12,288 KB
testcase_38 AC 166 ms
98,560 KB
testcase_39 AC 241 ms
147,968 KB
testcase_40 AC 863 ms
407,680 KB
testcase_41 AC 395 ms
251,520 KB
testcase_42 AC 189 ms
111,488 KB
testcase_43 AC 183 ms
109,568 KB
testcase_44 RE -
testcase_45 AC 111 ms
63,616 KB
testcase_46 AC 273 ms
164,864 KB
testcase_47 MLE -
testcase_48 AC 1,086 ms
478,720 KB
権限があれば一括ダウンロードができます

ソースコード

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