結果

問題 No.796 well known
ユーザー aaaaaaiu
提出日時 2019-08-01 15:32:30
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 193,448 KB
最終ジャッジ日時 2025-01-07 10:26:50
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    if (n%3==0) {
        cout << 3 << ' ' << 3;
        for (int i = 2; i < n; i++) cout << ' ' << 1;
        cout << endl;
    } else if (n%3 == 1) {
        cout << 3 << ' ' << 2;
        for (int i = 2; i < n; i++) cout << ' ' << 1;
        cout << endl;
    } else {
        cout << 3;
        for (int i = 1; i < n; i++) cout << ' ' << 1;
        cout << endl;
    }
    return 0;
}
0