結果

問題 No.83 最大マッチング
ユーザー yagi2
提出日時 2017-04-25 14:19:08
言語 Java
(openjdk 23)
結果
AC  
実行時間 432 ms / 5,000 ms
コード長 563 bytes
コンパイル時間 2,303 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 64,492 KB
最終ジャッジ日時 2024-09-13 08:43:08
合計ジャッジ時間 5,682 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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