結果

問題 No.80 四角形を描こう
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-06-27 00:41:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 3,153 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 58,056 KB
最終ジャッジ日時 2023-09-13 14:17:11
合計ジャッジ時間 5,471 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,992 KB
testcase_01 AC 119 ms
55,872 KB
testcase_02 AC 123 ms
56,476 KB
testcase_03 AC 124 ms
58,056 KB
testcase_04 AC 119 ms
56,304 KB
testcase_05 AC 120 ms
56,108 KB
testcase_06 AC 118 ms
55,736 KB
testcase_07 AC 119 ms
56,044 KB
testcase_08 AC 119 ms
55,996 KB
testcase_09 AC 121 ms
56,092 KB
testcase_10 AC 119 ms
56,048 KB
testcase_11 AC 123 ms
55,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class No080{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int d = sc.nextInt();
		if(d < 4){
			System.out.println(0);
			return;
		}
		if(d%2 != 0) d--;
		d /= 2;

		if(d%2 == 0){
			System.out.println((d/2)*(d/2));
		}else{
			System.out.println((d/2)*(d/2+1));
		}
	}
}
0