結果

問題 No.83 最大マッチング
ユーザー waganecowaganeco
提出日時 2020-03-13 04:00:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 303 ms / 5,000 ms
コード長 741 bytes
コンパイル時間 3,316 ms
コンパイル使用メモリ 76,584 KB
実行使用メモリ 56,912 KB
最終ジャッジ日時 2024-05-01 00:30:34
合計ジャッジ時間 6,063 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
52,992 KB
testcase_01 AC 96 ms
52,964 KB
testcase_02 AC 111 ms
54,180 KB
testcase_03 AC 102 ms
53,112 KB
testcase_04 AC 112 ms
54,396 KB
testcase_05 AC 99 ms
54,124 KB
testcase_06 AC 101 ms
52,964 KB
testcase_07 AC 112 ms
54,136 KB
testcase_08 AC 117 ms
54,044 KB
testcase_09 AC 124 ms
56,232 KB
testcase_10 AC 214 ms
56,912 KB
testcase_11 AC 303 ms
56,732 KB
testcase_12 AC 298 ms
56,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No83 {

	public static void main(String[] args) {
		

		int n;
		
		Scanner sc = new Scanner(System.in);
		n = Integer.parseInt(sc.next());
		sc.close();
		
		
		No83Solver sl = new No83Solver();
		
		sl.maxnum(n);

		
		
	}

}

class No83Solver{
	
	final int NINE = 6;
	final int EIGHT = 7;
	final int SEVEN = 3;
	final int SIX = 6;
	final int FIVE = 5;
	final int FOUR = 4;
	final int THREE = 5;
	final int TWO = 5;
	final int ONE = 2;
	final int ZERO = 6;
	
	
	
	public void maxnum(int n){
		
		String numstring = "";
		
		if (n % 2 == 1) {
			numstring = "7";
			n = n - SEVEN;
		}
		while(n > 0) {
			numstring = numstring + "1";
			n = n - ONE;
		}
		
		
		System.out.println(numstring);
	}
	
}
0