結果

問題 No.72 そろばん Med
ユーザー scache
提出日時 2014-11-23 20:37:28
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 3,650 ms
コンパイル使用メモリ 74,324 KB
実行使用メモリ 41,644 KB
最終ジャッジ日時 2024-11-21 11:36:55
合計ジャッジ時間 8,075 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #


import java.util.Scanner;

public class Main72 {
	public static void main(String[] args) {
		Main72 p = new Main72();
	}

	public Main72() {
		Scanner sc = new Scanner(System.in);
		
		long n = sc.nextLong();
		solve(n);
	}

	private final long MOD = 1000007;
	public void solve(long n) {
		long res = ((n/2)%MOD) * ((n-n/2)%MOD+1) + (n-n/2)%MOD;
		System.out.println(res%MOD);
		
	}

}
0