結果

問題 No.83 最大マッチング
ユーザー yoneoka1985yoneoka1985
提出日時 2018-10-10 19:58:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 147 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 2,055 ms
コンパイル使用メモリ 74,700 KB
実行使用メモリ 41,476 KB
最終ジャッジ日時 2024-04-20 19:28:41
合計ジャッジ時間 4,531 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
41,156 KB
testcase_01 AC 131 ms
41,252 KB
testcase_02 AC 129 ms
40,948 KB
testcase_03 AC 130 ms
41,380 KB
testcase_04 AC 130 ms
41,148 KB
testcase_05 AC 120 ms
40,032 KB
testcase_06 AC 129 ms
41,124 KB
testcase_07 AC 133 ms
40,976 KB
testcase_08 AC 119 ms
40,260 KB
testcase_09 AC 124 ms
40,456 KB
testcase_10 AC 147 ms
41,472 KB
testcase_11 AC 139 ms
41,476 KB
testcase_12 AC 131 ms
40,936 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