結果

問題 No.83 最大マッチング
ユーザー wf4n9wf4n9
提出日時 2017-10-12 13:28:09
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 504 bytes
コンパイル時間 2,364 ms
コンパイル使用メモリ 76,460 KB
実行使用メモリ 58,836 KB
最終ジャッジ日時 2024-04-28 17:03:02
合計ジャッジ時間 5,517 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
54,220 KB
testcase_01 AC 142 ms
54,236 KB
testcase_02 AC 140 ms
53,920 KB
testcase_03 AC 144 ms
53,800 KB
testcase_04 AC 140 ms
54,140 KB
testcase_05 AC 142 ms
53,968 KB
testcase_06 AC 141 ms
54,312 KB
testcase_07 AC 142 ms
53,760 KB
testcase_08 AC 133 ms
53,924 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	public static void main(String... args) {
		Scanner sc = new Scanner(System.in);
		int matchQty = sc.nextInt();
		System.out.println(matchNum(matchQty));
	}

	public static int matchNum(int matchQty) {
		String ans = "";
		if (matchQty % 2 == 0) {
			for (int i = 0; i < matchQty / 2; i++) {
				ans += "1";
			}
		} else {
			ans += "7";
			matchQty -= 3;
			for (int i = 0; i < matchQty / 2; i++) {
				ans += "1";
			}
		}
		return Integer.parseInt(ans);

	}
}
0