結果

問題 No.83 最大マッチング
ユーザー wf4n9
提出日時 2017-10-12 13:28:09
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 504 bytes
コンパイル時間 2,955 ms
コンパイル使用メモリ 76,992 KB
実行使用メモリ 45,456 KB
最終ジャッジ日時 2024-11-17 10:48:42
合計ジャッジ時間 5,459 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 RE * 4
権限があれば一括ダウンロードができます

ソースコード

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