結果

問題 No.129 お年玉(2)
ユーザー ferinferin
提出日時 2017-02-13 21:13:29
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 842 bytes
コンパイル時間 1,729 ms
コンパイル使用メモリ 144,308 KB
実行使用メモリ 726,660 KB
最終ジャッジ日時 2023-08-28 15:41:53
合計ジャッジ時間 12,526 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 MLE -
testcase_08 WA -
testcase_09 WA -
testcase_10 MLE -
testcase_11 WA -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 WA -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 WA -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 MLE -
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 0 ms
4,376 KB
testcase_32 WA -
testcase_33 AC 2 ms
4,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 MLE -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 MLE -
testcase_45 WA -
testcase_46 WA -
testcase_47 MLE -
testcase_48 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF 1000000000
#define PI 3.14159265359
#define EPS 1e-12

ll dp[10010][10010];

int main(void)
{
  ll n, m;
  cin >> n >> m;
  ll a = n%(m*1000)/1000;
  if(a == 0) {
    cout << 1 << endl;
    return 0;
  }
  cout << a << endl;
  //m人にa枚を配る
  REP(i, m+1) {
    REP(j, i+1) {
      if(j == 0 || j == i) dp[i][j] = 1;
      else dp[i][j] = (dp[i-1][j-1] + dp[i-1][j])%INF;
      //cout << dp[i][j] << " ";
    }
    //cout << endl;
  }

  cout << dp[m][a]%INF << endl;
  return 0;
}
0