結果

問題 No.111 あばばばば
ユーザー yagi2yagi2
提出日時 2017-04-25 11:55:12
言語 Java19
(openjdk 21)
結果
AC  
実行時間 2,557 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 2,145 ms
コンパイル使用メモリ 72,396 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2023-10-11 09:28:00
合計ジャッジ時間 7,427 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
55,644 KB
testcase_01 AC 109 ms
56,144 KB
testcase_02 AC 107 ms
55,764 KB
testcase_03 AC 2,557 ms
55,728 KB
testcase_04 AC 109 ms
55,752 KB
testcase_05 AC 112 ms
55,944 KB
testcase_06 AC 121 ms
55,724 KB
testcase_07 AC 351 ms
55,940 KB
testcase_08 AC 1,259 ms
55,744 KB
testcase_09 AC 106 ms
56,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Long L = Long.parseLong(sc.next());

        long cnt = 0;
        for (int i = 3; i <= L; i++) {
            if (i % 2 == 0) continue;
            cnt += L - i + 1;
        }
        System.out.println(cnt);
    }
}
0