結果
問題 |
No.72 そろばん Med
|
ユーザー |
![]() |
提出日時 | 2015-08-12 03:48:29 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 593 bytes |
コンパイル時間 | 1,691 ms |
コンパイル使用メモリ | 74,464 KB |
実行使用メモリ | 52,436 KB |
最終ジャッジ日時 | 2024-07-18 06:52:50 |
合計ジャッジ時間 | 3,780 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 9 |
ソースコード
import java.io.*; import java.math.BigInteger; class Main{ static final PrintWriter out=new PrintWriter(System.out); static long MOD=1000007; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()){ long n=Long.parseLong(line); long k=(long)n/2; n%=MOD; k%=MOD; BigInteger x=BigInteger.valueOf(n*(k+1)); BigInteger y=BigInteger.valueOf(k*k); BigInteger mod=BigInteger.valueOf(MOD); x=x.subtract(y).remainder(mod); out.println(x); out.flush(); } } }