結果

問題 No.83 最大マッチング
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-26 22:40:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 275 ms / 5,000 ms
コード長 825 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 76,032 KB
実行使用メモリ 54,900 KB
最終ジャッジ日時 2023-10-11 14:08:01
合計ジャッジ時間 4,408 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
49,844 KB
testcase_01 AC 51 ms
49,692 KB
testcase_02 AC 50 ms
49,540 KB
testcase_03 AC 52 ms
49,952 KB
testcase_04 AC 51 ms
49,512 KB
testcase_05 AC 52 ms
49,476 KB
testcase_06 AC 50 ms
49,728 KB
testcase_07 AC 51 ms
47,532 KB
testcase_08 AC 51 ms
49,624 KB
testcase_09 AC 67 ms
53,796 KB
testcase_10 AC 179 ms
54,900 KB
testcase_11 AC 275 ms
54,856 KB
testcase_12 AC 271 ms
54,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {


    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(reader.readLine());
        if (N % 2 == 0) {
            System.out.println(createSequenceOfOne(N));
        } else {
            System.out.println("7"+createSequenceOfOne(N-3));
        }
    }

    public static String createSequenceOfOne(int n) {
        int i = 0;
        String acc = "";
        while (i < n) {
            acc = acc + "1";
            i += 2;
        }
        return acc;
    }

}
0