結果

問題 No.80 四角形を描こう
ユーザー Mcpu3Mcpu3
提出日時 2018-06-21 23:12:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 319 bytes
コンパイル時間 2,062 ms
コンパイル使用メモリ 71,000 KB
実行使用メモリ 57,936 KB
最終ジャッジ日時 2023-09-13 07:42:46
合計ジャッジ時間 4,082 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,964 KB
testcase_01 AC 119 ms
56,020 KB
testcase_02 AC 119 ms
55,684 KB
testcase_03 AC 125 ms
55,884 KB
testcase_04 AC 119 ms
57,936 KB
testcase_05 AC 120 ms
56,272 KB
testcase_06 AC 121 ms
56,412 KB
testcase_07 AC 128 ms
56,124 KB
testcase_08 AC 126 ms
54,128 KB
testcase_09 AC 119 ms
55,796 KB
testcase_10 AC 118 ms
56,088 KB
testcase_11 AC 118 ms
56,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no80{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int d,x,y;
		d=stdIn.nextInt();
		x=d/4;
		y=d/4;
		while(true) {
			if((x+y+1)*2<=d) x++;
			else break;
			if((x+y+1)*2<=d) y++;
			else break;
		}
		System.out.print(x*y);
	}
}
0