結果

問題 No.1713 trick or treat!
ユーザー tentententen
提出日時 2021-10-25 10:57:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 1,050 bytes
コンパイル時間 2,129 ms
コンパイル使用メモリ 75,072 KB
実行使用メモリ 50,388 KB
最終ジャッジ日時 2024-04-14 04:53:43
合計ジャッジ時間 3,367 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
50,148 KB
testcase_01 AC 54 ms
50,028 KB
testcase_02 AC 53 ms
50,276 KB
testcase_03 AC 54 ms
50,388 KB
testcase_04 AC 55 ms
50,236 KB
testcase_05 AC 53 ms
50,276 KB
testcase_06 AC 55 ms
50,060 KB
testcase_07 AC 53 ms
50,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        System.out.println(kaijo(sc.nextInt() | sc.nextInt()));
    }
    
    static long kaijo(long x) {
        if (x == 0) {
            return 1;
        } else {
            return x * kaijo(x - 1);
        }
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public String nextLine() throws Exception {
        return br.readLine();
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0