結果

問題 No.83 最大マッチング
ユーザー shinshin
提出日時 2022-05-17 15:00:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 807 bytes
コンパイル時間 5,651 ms
コンパイル使用メモリ 72,360 KB
実行使用メモリ 50,772 KB
最終ジャッジ日時 2023-10-13 12:47:40
合計ジャッジ時間 7,044 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
49,108 KB
testcase_01 AC 36 ms
47,232 KB
testcase_02 AC 37 ms
49,680 KB
testcase_03 AC 38 ms
49,136 KB
testcase_04 AC 38 ms
49,240 KB
testcase_05 AC 38 ms
49,312 KB
testcase_06 AC 39 ms
49,316 KB
testcase_07 AC 37 ms
49,372 KB
testcase_08 AC 37 ms
49,268 KB
testcase_09 AC 40 ms
49,200 KB
testcase_10 AC 54 ms
50,720 KB
testcase_11 AC 59 ms
50,748 KB
testcase_12 AC 56 ms
50,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No83 {

	public static void main(String[] args) throws IOException{
		//最大マッチング
		int N = Integer.parseInt(readStr()[0]);
		StringBuilder sb = new StringBuilder();
		
		if(N % 2 == 1){
			sb.append("7");
			N -= 3;
		}
		
		for(int i = 0 , m = N / 2;i < m;i++) {
			sb.append("1");
		}
		
		System.out.println(sb);

	}
	
	public static String[] readStr() throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<>();

		do {
			list.add(br.readLine());
		}while(br.ready());

		br.close();

		String[] text = new String[list.size()];
		list.toArray(text);

		return text;

	}

}
0