結果
問題 | No.128 お年玉(1) |
ユーザー |
![]() |
提出日時 | 2015-11-28 01:21:36 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,151 bytes |
コンパイル時間 | 3,458 ms |
コンパイル使用メモリ | 77,816 KB |
実行使用メモリ | 50,476 KB |
最終ジャッジ日時 | 2024-10-01 10:09:51 |
合計ジャッジ時間 | 4,998 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 6 RE * 15 |
ソースコード
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); }else if((x/1000L) < x2){ System.out.println((x/1000L)*x2); } 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); } }