結果
問題 |
No.129 お年玉(2)
|
ユーザー |
![]() |
提出日時 | 2018-03-01 15:36:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 384 bytes |
コンパイル時間 | 594 ms |
コンパイル使用メモリ | 67,456 KB |
実行使用メモリ | 13,824 KB |
最終ジャッジ日時 | 2024-12-25 15:16:06 |
合計ジャッジ時間 | 254,983 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 TLE * 41 |
ソースコード
#include<iostream> #include<algorithm> using namespace std; int num = 1e9; long long combination(long long m, long long i) { if (i == 0 || i == m) return 1; if (i == 1) return m; return combination(m - 1, i - 1) + combination(m - 1, i); } int main() { long long n, m, i = 0; cin >> n >> m; n = (n % (m * 1000)) / 1000; cout << combination(m, min(n, m-n)) % num << endl; }