結果

問題 No.83 最大マッチング
ユーザー shiratamashiratama
提出日時 2016-08-14 09:17:25
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 58,328 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 06:32:10
合計ジャッジ時間 1,006 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>

auto main() -> int {
	long N;
	std::cin >> N;

	long max = 0;
	switch (N) {
		case 0: max = 0;  break;
		case 1: max = 0;  break;
		default:
			long last = std::pow(10, (N-2)/2);
			for (long n = 1; n < last; n *= 10) {
				max += n;
			}
			switch (N%2) {
			case 0: max += 1 * std::pow(10, (N-2)/2); break;
			case 1: max += 7 * std::pow(10, (N-2)/2); break;
			}
	}
	std::cout << max << std::endl;
}
0