結果
| 問題 | No.500 階乗電卓 |
| コンテスト | |
| ユーザー |
kohaku_kohaku
|
| 提出日時 | 2017-04-07 22:38:09 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 370 bytes |
| 記録 | |
| コンパイル時間 | 2,488 ms |
| コンパイル使用メモリ | 81,808 KB |
| 実行使用メモリ | 43,168 KB |
| 最終ジャッジ日時 | 2026-03-30 16:44:57 |
| 合計ジャッジ時間 | 3,752 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 5 RE * 8 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long Z = 1;
long mod = (long)Math.pow(10,12);
for(int i=1; i<=N; i++){
Z*=i;
Z%=mod;
if(Z==0)break;
}
System.out.println(Z);
}
}
kohaku_kohaku