結果

問題 No.83 最大マッチング
ユーザー yoneoka1985yoneoka1985
提出日時 2018-10-10 19:58:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 3,154 ms
コンパイル使用メモリ 72,500 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2023-08-02 19:21:12
合計ジャッジ時間 5,447 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,804 KB
testcase_01 AC 128 ms
56,068 KB
testcase_02 AC 128 ms
55,480 KB
testcase_03 AC 127 ms
55,840 KB
testcase_04 AC 129 ms
55,612 KB
testcase_05 AC 126 ms
55,884 KB
testcase_06 AC 127 ms
55,776 KB
testcase_07 AC 127 ms
55,976 KB
testcase_08 AC 122 ms
55,768 KB
testcase_09 AC 135 ms
53,624 KB
testcase_10 AC 138 ms
55,696 KB
testcase_11 AC 139 ms
55,716 KB
testcase_12 AC 142 ms
55,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.lang.StringBuilder;

public class Main {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);

        // int 1つ分を読み込む
        int n = sc.nextInt();

        String top = ( n % 2 == 0 ) ? "1" : "7";
        StringBuilder sb = new StringBuilder(top);
        for(int i = 0; i < n/2 - 1 ; i++){
            sb.append("1");
        }

        // 標準出力に書き出す。
        System.out.println(sb.toString());
    }
}
0