結果

問題 No.83 最大マッチング
ユーザー yagi2yagi2
提出日時 2017-04-25 14:19:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 462 ms / 5,000 ms
コード長 563 bytes
コンパイル時間 2,647 ms
コンパイル使用メモリ 77,888 KB
実行使用メモリ 65,820 KB
最終ジャッジ日時 2023-10-11 09:32:22
合計ジャッジ時間 6,884 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,588 KB
testcase_01 AC 124 ms
55,780 KB
testcase_02 AC 122 ms
55,580 KB
testcase_03 AC 129 ms
55,784 KB
testcase_04 AC 126 ms
55,896 KB
testcase_05 AC 126 ms
55,704 KB
testcase_06 AC 123 ms
55,828 KB
testcase_07 AC 123 ms
55,736 KB
testcase_08 AC 122 ms
54,272 KB
testcase_09 AC 228 ms
59,496 KB
testcase_10 AC 393 ms
65,820 KB
testcase_11 AC 462 ms
65,816 KB
testcase_12 AC 459 ms
65,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());

        List<Integer> ans = new ArrayList<>();
        while (N > 0) {
            if (N % 2 == 1) {
                ans.add(7);
                N -= 3;
            } else {
                ans.add(1);
                N -= 2;
            }
        }

        ans.forEach(System.out::print);
        System.out.println();
    }
}
0