結果
問題 |
No.129 お年玉(2)
|
ユーザー |
![]() |
提出日時 | 2015-11-28 01:19:31 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,084 bytes |
コンパイル時間 | 5,436 ms |
コンパイル使用メモリ | 77,476 KB |
実行使用メモリ | 50,624 KB |
最終ジャッジ日時 | 2024-09-14 01:31:52 |
合計ジャッジ時間 | 7,313 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | WA * 4 RE * 42 |
ソースコード
package yukicoder; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class yukicoder05 { public static void main(String[] args){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String tes = null; try { tes = br.readLine(); } catch (IOException e) { // TODO 自動生成された catch ブロック e.printStackTrace(); } String[] tew = null; long x = Long.parseLong(tes); try { tes = br.readLine(); } catch (IOException e) { // TODO 自動生成された catch ブロック e.printStackTrace(); } long x2 = Long.parseLong(tes); if((x/1000L) <= x2){ System.out.println(1); } long x3 = ((x/1000L)%x2); if(x3 == 0){ System.out.println(1); } long tmpx1=1,tmpx2=1,tmpx3=1; for(long i=x2;i>0;i--){ tmpx1 = tmpx1*i; } for(long i=x3;i>0;i--){ tmpx2 = tmpx2*i; } for(long i=(x2-x3);i>0;i--){ tmpx3 = tmpx3*i; } System.out.println((tmpx1/(tmpx2*tmpx3))%1000000000L); } }