結果

問題 No.80 四角形を描こう
ユーザー ぴろずぴろず
提出日時 2014-12-05 11:25:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 73,944 KB
実行使用メモリ 41,728 KB
最終ジャッジ日時 2024-04-16 22:26:03
合計ジャッジ時間 4,533 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,632 KB
testcase_01 AC 136 ms
41,508 KB
testcase_02 AC 135 ms
41,576 KB
testcase_03 AC 137 ms
41,492 KB
testcase_04 AC 136 ms
41,688 KB
testcase_05 AC 135 ms
41,464 KB
testcase_06 AC 134 ms
41,424 KB
testcase_07 AC 136 ms
41,244 KB
testcase_08 AC 138 ms
41,728 KB
testcase_09 AC 135 ms
41,140 KB
testcase_10 AC 135 ms
41,524 KB
testcase_11 AC 137 ms
41,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no080;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		if (d <= 3) {
			System.out.println(0);
			return;
		}
		d = (d - d % 2) / 2;
		if (d%2 == 0) {
			System.out.println(d*d/4);
		}else{
			System.out.println((d/2)*(d/2+1));
		}
	}

}
0