結果

問題 No.83 最大マッチング
ユーザー marumaru
提出日時 2017-09-25 11:21:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 444 bytes
コンパイル時間 3,382 ms
コンパイル使用メモリ 74,860 KB
実行使用メモリ 41,468 KB
最終ジャッジ日時 2024-04-26 21:45:36
合計ジャッジ時間 5,632 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
40,144 KB
testcase_01 AC 115 ms
41,176 KB
testcase_02 AC 103 ms
40,028 KB
testcase_03 AC 120 ms
40,908 KB
testcase_04 AC 118 ms
40,884 KB
testcase_05 AC 114 ms
41,072 KB
testcase_06 AC 120 ms
41,156 KB
testcase_07 AC 120 ms
41,212 KB
testcase_08 AC 116 ms
41,008 KB
testcase_09 AC 134 ms
41,276 KB
testcase_10 AC 131 ms
41,468 KB
testcase_11 AC 125 ms
40,872 KB
testcase_12 AC 132 ms
41,436 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