結果

問題 No.129 お年玉(2)
ユーザー 0w10w1
提出日時 2016-11-27 17:45:32
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 505 ms / 5,000 ms
コード長 491 bytes
コンパイル時間 2,017 ms
コンパイル使用メモリ 168,388 KB
実行使用メモリ 394,544 KB
最終ジャッジ日時 2023-08-18 17:46:05
合計ジャッジ時間 9,762 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
9,252 KB
testcase_01 AC 505 ms
394,544 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,500 KB
testcase_05 AC 179 ms
137,096 KB
testcase_06 AC 144 ms
111,660 KB
testcase_07 AC 256 ms
201,776 KB
testcase_08 AC 245 ms
194,396 KB
testcase_09 AC 129 ms
98,824 KB
testcase_10 AC 284 ms
229,340 KB
testcase_11 AC 152 ms
117,352 KB
testcase_12 AC 19 ms
16,892 KB
testcase_13 AC 12 ms
12,828 KB
testcase_14 AC 143 ms
113,768 KB
testcase_15 AC 122 ms
97,032 KB
testcase_16 AC 173 ms
134,240 KB
testcase_17 AC 113 ms
86,200 KB
testcase_18 AC 256 ms
201,248 KB
testcase_19 AC 336 ms
270,852 KB
testcase_20 AC 210 ms
167,632 KB
testcase_21 AC 134 ms
106,476 KB
testcase_22 AC 173 ms
137,360 KB
testcase_23 AC 291 ms
225,648 KB
testcase_24 AC 380 ms
304,484 KB
testcase_25 AC 143 ms
110,860 KB
testcase_26 AC 201 ms
161,168 KB
testcase_27 AC 191 ms
149,672 KB
testcase_28 AC 222 ms
173,956 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 1 ms
4,380 KB
testcase_36 AC 3 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 23 ms
20,980 KB
testcase_39 AC 24 ms
21,900 KB
testcase_40 AC 66 ms
56,324 KB
testcase_41 AC 88 ms
72,152 KB
testcase_42 AC 41 ms
33,988 KB
testcase_43 AC 8 ms
9,740 KB
testcase_44 AC 422 ms
336,464 KB
testcase_45 AC 22 ms
19,680 KB
testcase_46 AC 11 ms
11,460 KB
testcase_47 AC 358 ms
285,772 KB
testcase_48 AC 251 ms
200,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int MOD = ( int ) 1e9;

signed main(){
  ll N; int M; cin >> N >> M;
  N = N / 1000 * 1000;
  N %= M * 1000;
  N /= 1000;
  vector< vector< int > > C( M + 5, vector< int >( N + 5 ) );
  C[ 0 ][ 0 ] = 1;
  for( int i = 0; i <= M; ++i )
    for( int j = 0; j <= N; ++j )
      ( C[ i + 1 ][ j ] += C[ i ][ j ] ) %= MOD,
      ( C[ i + 1 ][ j + 1 ] += C[ i ][ j ] ) %= MOD;
  cout << C[ M ][ N ] << endl;
  return 0;
}
0