結果

問題 No.83 最大マッチング
ユーザー yuma25689yuma25689
提出日時 2016-01-02 22:28:38
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 503 bytes
コンパイル時間 25 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 45,312 KB
最終ジャッジ日時 2024-04-21 01:17:49
合計ジャッジ時間 1,789 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
38,784 KB
testcase_01 AC 66 ms
38,784 KB
testcase_02 AC 62 ms
38,784 KB
testcase_03 AC 64 ms
38,784 KB
testcase_04 AC 62 ms
38,784 KB
testcase_05 AC 62 ms
38,784 KB
testcase_06 AC 62 ms
39,168 KB
testcase_07 AC 68 ms
38,912 KB
testcase_08 AC 66 ms
38,784 KB
testcase_09 AC 64 ms
39,040 KB
testcase_10 AC 83 ms
45,056 KB
testcase_11 AC 76 ms
45,056 KB
testcase_12 AC 75 ms
45,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {

	var lines = input.split("\n");
	// N
	var stickCount=parseInt(lines[0]);

	var digitCount = parseInt(stickCount / 2);
	var lastEqualSeven = false;
	var rest = stickCount - 2*digitCount;

	if( 0 < rest ) {
		if( 0 < digitCount )
		{
			lastEqualSeven = true;
		}
	}

	var strCount = "1";
	if( lastEqualSeven )
	{
		strCount = "7";
	}
	for( var i=1; i < digitCount; i++ )
	{
		strCount += "1";
	}

	console.log(strCount);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0