結果
問題 | No.2608 Divide into two |
ユーザー |
![]() |
提出日時 | 2024-01-19 21:33:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 4,013 bytes |
コンパイル時間 | 3,932 ms |
コンパイル使用メモリ | 252,516 KB |
最終ジャッジ日時 | 2025-02-18 20:45:24 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 2 |
ソースコード
#if 1#include <bits/stdc++.h>using namespace std;#include <atcoder/all>using namespace atcoder;typedef modint998244353 mint93;typedef modint1000000007 mint17;typedef modint mint;using uint = unsigned int;using ll = long long;using ull = unsigned long long;using ld = long double;using pll = pair<ll, ll>;#define vec vectortemplate <class T>using v = vector<T>;template <class T>using vv = v<v<T>>;template <class T>using vvv = v<vv<T>>;using vl = v<ll>;using vvl = vv<ll>;using vvvl = vvv<ll>;using vpl = v<pll>;constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }#define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)#define rep(i, N) for (ll i = 0; i < (ll)(N); i++)#define rep1(i, N) for (ll i = 1; i <= (ll)(N); i++)#define rrep(i, N) for (ll i = N - 1; i >= 0; i--)#define rrep1(i, N) for (ll i = N; i > 0; i--)#define fore(i, a) for (auto &i : a)#define fs first#define sc second#define eb emplace_back#define pb push_back#define ps push#define elif else if#define all(x) (x).begin(), (x).end()#define UNIQUE(x) (x).erase(unique((x).begin(), (x).end()), (x).end());#define YES(x) cout << ((x) ? "YES\n" : "NO\n");#define Yes(x) cout << ((x) ? "Yes\n" : "No\n");#define yes(x) cout << ((x) ? "yes\n" : "no\n");ll sum(vl &x) { return accumulate(all(x), 0ll); }template <class T, class U>void chmin(T &t, const U &u) {if (t > u) t = u;}template <class T, class U>void chmax(T &t, const U &u) {if (t < u) t = u;}const int inf = (1ll << 29);const ll infl = (1ll << 60);const ll mod93 = 998244353ll;const ll mod17 = 1000000007ll;int popcnt(uint x) { return __builtin_popcount(x); }int popcnt(ull x) { return __builtin_popcountll(x); }int bsr(uint x) { return 32 - __builtin_clz(x); }int bsr(ull x) { return 64 - __builtin_clzll(x); }int bsf(uint x) { return __builtin_ctz(x); }int bsf(ull x) { return __builtin_ctzll(x); }ostream &operator<<(ostream &os, const mint93 &x) { return os << x.val(); }ostream &operator<<(ostream &os, const mint17 &x) { return os << x.val(); }template <class T, class S>istream &operator>>(istream &is, pair<T, S> &x) {return is >> x.first >> x.second;}template <class T, class S>ostream &operator<<(ostream &os, pair<T, S> &x) {return os << x.first << " " << x.second;}template <class T>istream &operator>>(istream &is, vector<T> &x) {for (auto &y : x) is >> y;return is;}template <class T>ostream &operator<<(ostream &os, vector<T> &x) {for (unsigned int i = 0, size = x.size(); i < size; i++)os << x[i] << (i == size - 1 ? "" : " ");return os;}template <class T>T popleft(queue<T> &q) {T a = q.front();q.pop();return a;}template <class T>void print(T &t) {fore(H, t) cout << H << ' ';cout << endl;}struct StopWatch {bool f = false;clock_t st;void start() {f = true;st = clock();}int msecs() {assert(f);return (clock() - st) * 1000 / CLOCKS_PER_SEC;}};ll rand_int(ll l, ll r) { // [l, r]static random_device rd;static mt19937 gen(rd());return uniform_int_distribution<ll>(l, r)(gen);}template <long long MOD>struct binomial {long long n;std::vector<atcoder::static_modint<MOD>> fact, ifact;binomial(long long n) : n(n), fact(n + 1), ifact(n + 1) {fact[0] = 1;for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * i;ifact[n] = fact[n].inv();for (int i = n; i > 0; i--) ifact[i - 1] = ifact[i] * i;}atcoder::static_modint<MOD> operator()(int n, int k) {if (k < 0 || k > n) return 0;return fact[n] * ifact[k] * ifact[n - k];}};#endif// #define _GLIBCXX_DEBUGvoid solve(){ll n;cin >> n;if ((n * (n + 1) / 2) & 1) {cout << -1 << endl;return;}string ans = "";rep(i, n) ans += '0';ll sm = 0;rrep(i, n){if (sm + i + 1 <= n * (n + 1) / 4) {ans[i] = '1';sm += i + 1;cout << sm << endl;}}cout << ans << endl;}int main() {ll t;cin >> t;while(t--) solve();}