結果

問題 No.796 well known
ユーザー sinsincoscos
提出日時 2019-03-15 21:28:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 507 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 54,100 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 20:22:04
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

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