結果
問題 | No.796 well known |
ユーザー |
![]() |
提出日時 | 2019-03-16 01:00:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 1,343 bytes |
コンパイル時間 | 1,009 ms |
コンパイル使用メモリ | 109,784 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 22:13:08 |
合計ジャッジ時間 | 1,966 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <climits> #include <set> #include <algorithm> #include <unordered_map> #include <queue> #include <iomanip> #include <map> #include <utility> #include <numeric> #include <chrono> #include <ctime> #include <bitset> #include <iterator> #include <cmath> #include <stack> #include <random> #define rep(i,n) for(int i=0; i<(int)(n); i++) #define debug(x) cerr << #x << ": " << x << ", " #define debugln(x) cerr << #x << ": " << x << '\n' template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; using ll = long long; using P = pair<ll, ll>; constexpr ll mod = 1e9+7; const double PI = acos(-1.0); mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count()); signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; int sum = 0; rep(i, n) { if (i==0) { cout << 3 << ' '; } else { if (i==n-1) { int r = sum%3; if (r==0) { cout << 1 << endl; } else if (r==1) { cout << 3 << endl; } else { cout << 2 << endl; } } else { cout << 1 << ' '; sum++; } } } }