結果

問題 No.72 そろばん Med
ユーザー リチウムリチウム
提出日時 2014-11-19 00:08:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 2,758 ms
コンパイル使用メモリ 71,752 KB
実行使用メモリ 58,152 KB
最終ジャッジ日時 2023-08-30 21:46:13
合計ジャッジ時間 6,281 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,948 KB
testcase_01 AC 119 ms
55,368 KB
testcase_02 AC 118 ms
56,124 KB
testcase_03 AC 118 ms
55,348 KB
testcase_04 AC 118 ms
56,264 KB
testcase_05 WA -
testcase_06 AC 118 ms
56,116 KB
testcase_07 AC 118 ms
56,096 KB
testcase_08 WA -
testcase_09 AC 118 ms
55,600 KB
testcase_10 AC 119 ms
55,828 KB
testcase_11 AC 119 ms
55,684 KB
testcase_12 AC 119 ms
56,044 KB
testcase_13 WA -
testcase_14 AC 120 ms
55,672 KB
testcase_15 AC 118 ms
55,712 KB
testcase_16 AC 119 ms
55,796 KB
testcase_17 AC 119 ms
55,944 KB
testcase_18 AC 118 ms
55,664 KB
testcase_19 AC 118 ms
55,388 KB
testcase_20 AC 119 ms
55,936 KB
testcase_21 AC 119 ms
56,236 KB
testcase_22 WA -
testcase_23 AC 122 ms
55,568 KB
testcase_24 AC 117 ms
55,856 KB
testcase_25 AC 118 ms
55,540 KB
testcase_26 AC 117 ms
55,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		int mod=1000007;
			long x=n/2;
			long y=x%mod;
			long ans=((y%mod)*((n-x)%mod)+n%mod)%mod;
			
	    if(n%2==1){
	    	long z=n/2+1;
			long m=x%mod;
			long ansk=((m%mod)*((n-z)%mod)+n%mod)%mod;
			ans=Math.max(ans,ansk);			
		}
	    System.out.println(ans);
	}}
0