結果

問題 No.796 well known
ユーザー Mcpu3
提出日時 2019-03-15 21:59:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 483 ms
コンパイル使用メモリ 62,720 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 20:54:39
合計ジャッジ時間 1,452 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
	int N;
	cin >> N;
	if (N % 3 == 0) {
		for (int i = 0; i < N - 2; ++i) cout << "1 ";
		cout << "3 3";
	}
	else if (N % 3 == 1) {
		for (int i = 0; i < N - 2; ++i) cout << "1 ";
		cout << "2 3";
	}
	else {
		for (int i = 0; i < N - 1; ++i) cout << "1 ";
		cout << 3;
	}
}
0