結果

問題 No.83 最大マッチング
ユーザー ohreitetsuohreitetsu
提出日時 2018-06-11 21:44:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 64,032 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-13 03:26:23
合計ジャッジ時間 1,331 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
	int N;
	cin>>N;
	switch(N){
	case 2:
		cout<<1;
		break;
	case 3:
		cout<<7;
		break;
	case 4:
		cout<<11;
		break;
	default:
		if (N-3>=2){
			cout<<7;
			N-=3;
		}
		while (N>=2){
			cout<<1;
			N-=2;
		}
		break;

	}
	int n=N/2;
	for (int i=1;i<=n;i++){
		cout<<"1";
	}
	cout<<endl;
	return 0;
}
0