結果
問題 | No.420 mod2漸化式 |
ユーザー |
|
提出日時 | 2016-09-09 23:58:35 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 546 bytes |
コンパイル時間 | 572 ms |
コンパイル使用メモリ | 65,756 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 11:18:39 |
合計ジャッジ時間 | 1,738 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#include <iostream>#include <string>#include <cmath>#include <iomanip>using namespace std;#define MAX 100#define C 2147483647long int row[MAX];int comb(int n, int r) {row[0] = 1;for (int i=1; i<=n; i++) {for (int j=i; j>0; j--) {row[j] += row[j-1];}}return row[r];}int main() {unsigned int n;cin >> n;if ( n > 31 ){cout << 0 << " " << 0 << endl;} else {long int x;x = comb(31, n);cout << x << " " << x*n/31*C << endl;}}