結果

問題 No.796 well known
ユーザー 2bit2bit
提出日時 2022-07-22 17:03:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 1,509 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 197,548 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 02:52:07
合計ジャッジ時間 3,206 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (long long  i = 0; i < (long long )(n); i++)
#define all(x) (x).begin(),(x).end()
#define fix(x) fixed << setprecision(x)
#define eb emplace_back
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using vs = vector<string>;
using pl = pair<long long, long long>;
template <typename t> inline bool chmin(t& a, const t& b) {bool compare = a > b; if (a > b) a = b; return compare;}
template <typename t> inline bool chmax(t& a, const t& b) {bool compare = a < b; if (a < b) a = b; return compare;}
template<class t>using rp_queue=priority_queue<t,vector<t>,greater<t>>;
void fast_io(){cin.tie(nullptr);ios_base::sync_with_stdio(false);}
template <typename t> t gcd(t a, t b) {if (b == 0)return a; else return gcd(b, a % b);}
template <typename t> inline t lcm(t a, t b) {return a /gcd(a, b)*b;}
const ll inf = 1ll << 60;
const ld pi = 3.14159265358979323846l;
void solve(){
  ll N;cin>>N;
  //条件を言い換えると
  //3で割ったあまりが1である->全ての総和を3の倍数にして1足す
  //全てを足した値が312456以下となるようにする。
  cout<<3<<" ";
  if((N-1)%3==0)cout<<2<<" ";
  if((N-1)%3==1)cout<<1<<" ";
  if((N-1)%3==2)cout<<3<<" ";
  rep(i,N-2)cout<<1<<" ";
  cout<<endl;
}
int main(){
  fast_io();
  int num_tc = 1;
  //cin >> num_tc;
  rep(tc,num_tc){
    //cout << "case #" << tc+1 << ": " ;// << endl;
    solve();
  }
}
0