結果

問題 No.83 最大マッチング
ユーザー marumaru
提出日時 2017-09-25 11:21:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 444 bytes
コンパイル時間 5,337 ms
コンパイル使用メモリ 73,000 KB
実行使用メモリ 56,044 KB
最終ジャッジ日時 2023-08-09 07:00:00
合計ジャッジ時間 8,161 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,620 KB
testcase_01 AC 121 ms
56,044 KB
testcase_02 AC 122 ms
56,040 KB
testcase_03 AC 122 ms
55,696 KB
testcase_04 AC 121 ms
55,620 KB
testcase_05 AC 124 ms
55,868 KB
testcase_06 AC 125 ms
55,472 KB
testcase_07 AC 127 ms
55,680 KB
testcase_08 AC 121 ms
55,796 KB
testcase_09 AC 137 ms
55,724 KB
testcase_10 AC 136 ms
55,848 KB
testcase_11 AC 135 ms
55,848 KB
testcase_12 AC 133 ms
55,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Macchi {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int one = 0;
		int seven = 0;

		if(n%2==0) {
			one = n/2;
		}else {
			seven = 1;
			one = (n-3)/2;
		}

		StringBuilder sb = new StringBuilder();
		if(seven==1) {
			sb.append(7);
		}
		for(int i=0; i<one; i++) {
			sb.append(1);
		}
		System.out.println(String.valueOf(sb));
	}

}
0