結果

問題 No.83 最大マッチング
ユーザー jimanojimano
提出日時 2017-05-07 17:57:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 597 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 72,912 KB
実行使用メモリ 51,240 KB
最終ジャッジ日時 2023-10-12 16:11:49
合計ジャッジ時間 3,609 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,220 KB
testcase_01 AC 44 ms
49,300 KB
testcase_02 AC 45 ms
49,336 KB
testcase_03 AC 45 ms
49,292 KB
testcase_04 AC 45 ms
49,192 KB
testcase_05 AC 45 ms
49,332 KB
testcase_06 AC 49 ms
49,224 KB
testcase_07 AC 45 ms
49,164 KB
testcase_08 AC 45 ms
49,244 KB
testcase_09 AC 48 ms
49,360 KB
testcase_10 AC 62 ms
50,920 KB
testcase_11 AC 74 ms
51,240 KB
testcase_12 AC 74 ms
50,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			int n = Integer.parseInt(br.readLine());
			int cnt = n / 2;// 最大でマッチ棒の本数/2だけループ
			StringBuilder sb = new StringBuilder();

			if (n % 2 != 0) {
				sb.append(7);
				cnt--;
			}
			for (int i = 0; i < cnt; i++) {
				sb.append(1);
			}

			System.out.println(sb);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0