Submission #8894582
Source Code Expand
#include<bits/stdc++.h> #define ll long long #define rep(i, n) for(int i=0; i<n; i++) #define REP(i, n) for(int i=0; i<=n; i++) #define repr(i, n) for(int i=n; i>0; i--) #define REPR(i, n) for(int i=n; i>=0; i--) const ll INF = 1LL<<60; const int INT_INF = 1e9; const ll MOD = 1e9+7; template<class T> void puts(T x) { std::cout << x << std::endl; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; const int MAX = 100010; ll dp[MAX][MAX]; int main() { ll w, h; cin >> w >> h; w--; h--; if (w > h) swap(w, h); rep(i, MAX) dp[i][0] = 1; rep(i, MAX) dp[i][i] = 1; for (int i = 1; i <= w+h; i++) { for (int j = 1; j < i; j++) { dp[i][j] = dp[i-1][j-1] + dp[i-1][j]; dp[i][j] %= MOD; } } cout << dp[w+h][h] << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - 経路 |
User | bokeh |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 981 Byte |
Status | CE |
Compile Error
/tmp/ccACEQFS.o: In function `_GLOBAL__sub_I_dp': Main.cpp:(.text.startup+0x185): relocation truncated to fit: R_X86_64_32 against `.bss' Main.cpp:(.text.startup+0x194): relocation truncated to fit: R_X86_64_32 against `.bss' collect2: error: ld returned 1 exit status