結果

問題 No.83 最大マッチング
ユーザー kuramukuramu
提出日時 2016-01-21 20:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 587 bytes
コンパイル時間 2,147 ms
コンパイル使用メモリ 74,732 KB
実行使用メモリ 54,308 KB
最終ジャッジ日時 2023-10-21 13:42:18
合計ジャッジ時間 3,466 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
53,564 KB
testcase_01 AC 49 ms
53,572 KB
testcase_02 AC 50 ms
52,460 KB
testcase_03 AC 48 ms
53,564 KB
testcase_04 AC 49 ms
53,576 KB
testcase_05 AC 47 ms
53,572 KB
testcase_06 AC 48 ms
53,576 KB
testcase_07 AC 49 ms
53,572 KB
testcase_08 AC 48 ms
53,572 KB
testcase_09 AC 47 ms
53,576 KB
testcase_10 AC 71 ms
53,576 KB
testcase_11 AC 75 ms
53,592 KB
testcase_12 AC 76 ms
54,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(stdReader.readLine());
		StringBuilder sb = new StringBuilder();
		if(n%2==0){
			for(int i=0;i<n/2;i++) sb.append("1"); 
		}else{
			while(n>2 && n%2 !=0){
				sb.append("7");
				n-=3;
			}
			if(n%2 == 0){
				for(int i=0;i<n/2;i++) sb.append("1");
			}
		}
		System.out.println(sb.toString());
	}
}
0