結果

問題 No.1186 長方形の敷き詰め
ユーザー snow39snow39
提出日時 2020-08-22 13:22:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 827 bytes
コンパイル時間 1,069 ms
コンパイル使用メモリ 95,096 KB
実行使用メモリ 11,188 KB
最終ジャッジ日時 2024-04-23 07:45:05
合計ジャッジ時間 1,668 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 10 ms
11,120 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 4 ms
6,944 KB
testcase_18 AC 7 ms
8,400 KB
testcase_19 AC 7 ms
9,232 KB
testcase_20 AC 9 ms
10,036 KB
testcase_21 AC 7 ms
8,048 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 9 ms
10,004 KB
testcase_25 AC 5 ms
7,436 KB
testcase_26 AC 5 ms
7,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

void add(ll &a,ll b){
  a=(a+b)%MOD;
}

void mul(ll &a,ll b){
  a%=MOD;b%=MOD;
  a=a*b%MOD;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll N,M;
  cin>>N>>M;

  vector<ll> dp(M+1,0);
  dp[0]=1;
  for(int i=0;i<M;i++){
    add(dp[i+1],dp[i]);
    if(i+1-N>=0) add(dp[i+1],dp[i+1-N]);
  }

  cout<<dp[M]<<endl;

  return 0;
}
0