結果

問題 No.111 あばばばば
ユーザー koukonkokoukonko
提出日時 2015-12-11 18:14:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 617 ms / 5,000 ms
コード長 611 bytes
コンパイル時間 2,957 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 49,800 KB
最終ジャッジ日時 2023-10-13 11:12:57
合計ジャッジ時間 5,204 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,256 KB
testcase_01 AC 44 ms
49,800 KB
testcase_02 AC 47 ms
48,984 KB
testcase_03 AC 617 ms
49,736 KB
testcase_04 AC 44 ms
49,200 KB
testcase_05 AC 52 ms
49,168 KB
testcase_06 AC 55 ms
49,440 KB
testcase_07 AC 110 ms
49,568 KB
testcase_08 AC 318 ms
49,776 KB
testcase_09 AC 44 ms
49,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			long line = Long.parseLong(buff.readLine());

			long ans = line - 2;
			long pro = line - 2;


			for(int i = 5; i <= line; i += 2){
				pro -= 2;
				ans += pro;
			}

			System.out.println(ans);

		} catch (NumberFormatException e) {
			e.getStackTrace();
		} catch (IOException e) {
			e.getStackTrace();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0