結果
| 問題 | No.420 mod2漸化式 |
| コンテスト | |
| ユーザー |
YamaKasa
|
| 提出日時 | 2018-09-20 01:54:42 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 535 bytes |
| 記録 | |
| コンパイル時間 | 1,619 ms |
| コンパイル使用メモリ | 83,516 KB |
| 実行使用メモリ | 1,055,160 KB |
| 最終ジャッジ日時 | 2026-04-02 00:17:58 |
| 合計ジャッジ時間 | 5,469 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 27 TLE * 7 MLE * 1 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long x = scan.nextLong();
scan.close();
if(x > 31) {
System.out.println(0 + " " + 0);
}else {
long c = comb(31, (int)x);
long sum = ((long)Math.pow(2, 31) - 1) * comb(30, (int)x-1);
System.out.println(c + " " + sum);
}
}
static long comb(int n, int k) {
if(k == 0) {
return 1;
}else if(n == k) {
return 1;
}else {
return comb(n - 1, k - 1) + comb(n - 1, k);
}
}
}
YamaKasa