結果

問題 No.83 最大マッチング
ユーザー tk55513tk55513
提出日時 2023-02-17 21:19:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 423 bytes
コンパイル時間 2,603 ms
コンパイル使用メモリ 72,236 KB
実行使用メモリ 55,876 KB
最終ジャッジ日時 2023-09-26 18:23:01
合計ジャッジ時間 5,056 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,836 KB
testcase_01 AC 126 ms
55,640 KB
testcase_02 AC 127 ms
55,848 KB
testcase_03 AC 128 ms
55,652 KB
testcase_04 AC 127 ms
55,596 KB
testcase_05 AC 126 ms
55,440 KB
testcase_06 AC 126 ms
55,516 KB
testcase_07 AC 127 ms
55,668 KB
testcase_08 AC 127 ms
55,676 KB
testcase_09 AC 137 ms
55,748 KB
testcase_10 AC 138 ms
55,772 KB
testcase_11 AC 139 ms
55,876 KB
testcase_12 AC 140 ms
55,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String... args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        StringBuilder sb=new StringBuilder();
        for (int i = 0; i < n / 2; i++) {
            sb.append(1);
        }
        if(n%2==1){
            sb.insert(0,7);
            sb.deleteCharAt(sb.length()-1);
        }
        System.out.println(sb);
    }
}
0