結果

問題 No.83 最大マッチング
ユーザー GrenacheGrenache
提出日時 2015-09-23 01:09:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 631 bytes
コンパイル時間 3,443 ms
コンパイル使用メモリ 72,640 KB
実行使用メモリ 56,264 KB
最終ジャッジ日時 2023-09-26 14:33:51
合計ジャッジ時間 5,767 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,264 KB
testcase_01 AC 122 ms
55,852 KB
testcase_02 AC 122 ms
55,852 KB
testcase_03 AC 122 ms
55,984 KB
testcase_04 AC 120 ms
56,240 KB
testcase_05 AC 120 ms
55,880 KB
testcase_06 AC 120 ms
55,760 KB
testcase_07 AC 120 ms
55,756 KB
testcase_08 AC 120 ms
55,936 KB
testcase_09 AC 133 ms
55,860 KB
testcase_10 AC 133 ms
55,868 KB
testcase_11 AC 134 ms
55,764 KB
testcase_12 AC 135 ms
56,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder83 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        if (n % 2 == 0) {
        	StringBuilder sb = new StringBuilder();
        	for (int i = 0; i < n / 2; i++) {
        		sb.append('1');
        	}
        	System.out.println(sb);
        } else {
        	n -= 3;
        	StringBuilder sb = new StringBuilder();
        	sb.append('7');
        	for (int i = 0; i < n / 2; i++) {
        		sb.append('1');
        	}
        	System.out.println(sb);
        }

        sc.close();
    }
}
0