QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#284841 | #7940. Impossible Numbers | ucup-team087# | AC ✓ | 2130ms | 22164kb | C++20 | 13.4kb | 2023-12-16 15:14:05 | 2023-12-16 15:14:05 |
Judging History
你现在查看的是最新测评结果
- [2023-12-17 13:41:15]
- hack成功,自动添加数据
- (/hack/501)
- [2023-12-16 17:44:29]
- hack成功,自动添加数据
- (//qoj.ac/hack/496)
- [2023-12-16 15:14:05]
- 提交
answer
#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'000'000'000;
template <>
constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;
using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
#define vv(type, name, h, ...) \
vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) \
vector<vector<vector<type>>> name( \
h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
vector<vector<vector<vector<type>>>> name( \
a, vector<vector<vector<type>>>( \
b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))
// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)
#define FOR_subset(t, s) \
for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define stoi stoll
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
int popcnt_mod_2(int x) { return __builtin_parity(x); }
int popcnt_mod_2(u32 x) { return __builtin_parity(x); }
int popcnt_mod_2(ll x) { return __builtin_parityll(x); }
int popcnt_mod_2(u64 x) { return __builtin_parityll(x); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
template <typename T>
T floor(T a, T b) {
return a / b - (a % b && (a ^ b) < 0);
}
template <typename T>
T ceil(T x, T y) {
return floor(x + y - 1, y);
}
template <typename T>
T bmod(T x, T y) {
return x - y * floor(x, y);
}
template <typename T>
pair<T, T> divmod(T x, T y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sm = 0;
for (auto &&a: A) sm += a;
return sm;
}
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) \
sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()
template <typename T>
T POP(deque<T> &que) {
T a = que.front();
que.pop_front();
return a;
}
template <typename T>
T POP(pq<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(pqg<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
if (check_ok) assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
(check(x) ? ok : ng) = x;
}
return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
FOR(iter) {
double x = (ok + ng) / 2;
(check(x) ? ok : ng) = x;
}
return (ok + ng) / 2;
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
return (a > b ? a = b, 1 : 0);
}
// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
vc<int> A(S.size());
FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
return A;
}
template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
int N = A.size();
vector<T> B(N + 1);
FOR(i, N) { B[i + 1] = B[i] + A[i]; }
if (off == 0) B.erase(B.begin());
return B;
}
// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
vector<int> ids(len(A));
iota(all(ids), 0);
sort(all(ids),
[&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
return ids;
}
// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
vc<T> B(len(I));
FOR(i, len(I)) B[i] = A[I[i]];
return B;
}
#endif
#line 1 "library/other/io.hpp"
#define FASTIO
#include <unistd.h>
// https://judge.yosupo.jp/submission/21623
namespace fastio {
static constexpr uint32_t SZ = 1 << 17;
char ibuf[SZ];
char obuf[SZ];
char out[100];
// pointer of ibuf, obuf
uint32_t pil = 0, pir = 0, por = 0;
struct Pre {
char num[10000][4];
constexpr Pre() : num() {
for (int i = 0; i < 10000; i++) {
int n = i;
for (int j = 3; j >= 0; j--) {
num[i][j] = n % 10 | '0';
n /= 10;
}
}
}
} constexpr pre;
inline void load() {
memcpy(ibuf, ibuf + pil, pir - pil);
pir = pir - pil + fread(ibuf + pir - pil, 1, SZ - pir + pil, stdin);
pil = 0;
if (pir < SZ) ibuf[pir++] = '\n';
}
inline void flush() {
fwrite(obuf, 1, por, stdout);
por = 0;
}
void rd(char &c) {
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
}
void rd(string &x) {
x.clear();
char c;
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
do {
x += c;
if (pil == pir) load();
c = ibuf[pil++];
} while (!isspace(c));
}
template <typename T>
void rd_real(T &x) {
string s;
rd(s);
x = stod(s);
}
template <typename T>
void rd_integer(T &x) {
if (pil + 100 > pir) load();
char c;
do
c = ibuf[pil++];
while (c < '-');
bool minus = 0;
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (c == '-') { minus = 1, c = ibuf[pil++]; }
}
x = 0;
while ('0' <= c) { x = x * 10 + (c & 15), c = ibuf[pil++]; }
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (minus) x = -x;
}
}
void rd(int &x) { rd_integer(x); }
void rd(ll &x) { rd_integer(x); }
void rd(i128 &x) { rd_integer(x); }
void rd(u32 &x) { rd_integer(x); }
void rd(u64 &x) { rd_integer(x); }
void rd(u128 &x) { rd_integer(x); }
void rd(double &x) { rd_real(x); }
void rd(long double &x) { rd_real(x); }
void rd(f128 &x) { rd_real(x); }
template <class T, class U>
void rd(pair<T, U> &p) {
return rd(p.first), rd(p.second);
}
template <size_t N = 0, typename T>
void rd_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
rd(x);
rd_tuple<N + 1>(t);
}
}
template <class... T>
void rd(tuple<T...> &tpl) {
rd_tuple(tpl);
}
template <size_t N = 0, typename T>
void rd(array<T, N> &x) {
for (auto &d: x) rd(d);
}
template <class T>
void rd(vc<T> &x) {
for (auto &d: x) rd(d);
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
rd(h), read(t...);
}
void wt(const char c) {
if (por == SZ) flush();
obuf[por++] = c;
}
void wt(const string s) {
for (char c: s) wt(c);
}
void wt(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) wt(s[i]);
}
template <typename T>
void wt_integer(T x) {
if (por > SZ - 100) flush();
if (x < 0) { obuf[por++] = '-', x = -x; }
int outi;
for (outi = 96; x >= 10000; outi -= 4) {
memcpy(out + outi, pre.num[x % 10000], 4);
x /= 10000;
}
if (x >= 1000) {
memcpy(obuf + por, pre.num[x], 4);
por += 4;
} else if (x >= 100) {
memcpy(obuf + por, pre.num[x] + 1, 3);
por += 3;
} else if (x >= 10) {
int q = (x * 103) >> 10;
obuf[por] = q | '0';
obuf[por + 1] = (x - q * 10) | '0';
por += 2;
} else
obuf[por++] = x | '0';
memcpy(obuf + por, out + outi + 4, 96 - outi);
por += 96 - outi;
}
template <typename T>
void wt_real(T x) {
ostringstream oss;
oss << fixed << setprecision(15) << double(x);
string s = oss.str();
wt(s);
}
void wt(int x) { wt_integer(x); }
void wt(ll x) { wt_integer(x); }
void wt(i128 x) { wt_integer(x); }
void wt(u32 x) { wt_integer(x); }
void wt(u64 x) { wt_integer(x); }
void wt(u128 x) { wt_integer(x); }
void wt(double x) { wt_real(x); }
void wt(long double x) { wt_real(x); }
void wt(f128 x) { wt_real(x); }
template <class T, class U>
void wt(const pair<T, U> val) {
wt(val.first);
wt(' ');
wt(val.second);
}
template <size_t N = 0, typename T>
void wt_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { wt(' '); }
const auto x = std::get<N>(t);
wt(x);
wt_tuple<N + 1>(t);
}
}
template <class... T>
void wt(tuple<T...> tpl) {
wt_tuple(tpl);
}
template <class T, size_t S>
void wt(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
template <class T>
void wt(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
void print() { wt('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
wt(head);
if (sizeof...(Tail)) wt(' ');
print(forward<Tail>(tail)...);
}
// gcc expansion. called automaticall after main.
void __attribute__((destructor)) _d() { flush(); }
} // namespace fastio
using fastio::read;
using fastio::print;
using fastio::flush;
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
read(__VA_ARGS__)
#define U32(...) \
u32 __VA_ARGS__; \
read(__VA_ARGS__)
#define U64(...) \
u64 __VA_ARGS__; \
read(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
read(__VA_ARGS__)
#define CHAR(...) \
char __VA_ARGS__; \
read(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
read(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
read(name)
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
read(name)
void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 3 "main.cpp"
void solve() {
LL(N, K);
vc<int> dp(1 << 10);
FOR(N) {
int s = 0;
FOR(6) {
INT(x);
s |= 1 << x;
}
FOR(t, 1024) if (s & t) dp[t]++;
}
dp[0] = infty<int>;
vc<string> ANS;
string ans = "";
auto dfs = [&](auto& dfs, int rest, int min_dp) -> void {
if (ans == "0") return; // 1桁も含めてだめ
if (K == 0) return;
if (min_dp >= rest) return;
if (rest == 0) {
ANS.eb(ans);
--K;
return;
}
int can = 1023;
if (min_dp == rest - 1) {
can = 0;
FOR(s, 1024) if (dp[s] == min_dp) can |= s;
}
FOR(x, 10) {
if (ans.empty() && x == 0) continue;
if (K == 0) break;
if (!(can >> x & 1)) continue;
// int before_K = K;
int mi = min_dp;
FOR(s, 1024) {
if (s >> x & 1) dp[s]--, mi = min(mi, dp[s]);
}
ans += '0' + x;
dfs(dfs, rest - 1, mi);
FOR(s, 1024) {
if (s >> x & 1) dp[s]++;
}
ans.pop_back();
// int after_K = K;
// assert(before_K > after_K);
}
};
FOR(keta, 1, 1000) { dfs(dfs, keta, MIN(dp)); }
print(ANS);
}
signed main() {
solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3576kb
input:
2 3 1 8 7 0 6 2 1 2 5 4 9 3
output:
33 34 35
result:
ok single line: '33 34 35'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
1 10 1 5 2 2 6 4
output:
3 7 8 9 10 11 12 13 14 15
result:
ok single line: '3 7 8 9 10 11 12 13 14 15'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
4 10 1 5 7 1 2 4 0 1 5 8 9 4 3 5 2 2 7 8 6 1 7 0 2 2
output:
33 66 99 133 166 199 233 266 299 303
result:
ok single line: '33 66 99 133 166 199 233 266 299 303'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
5 10 5 9 4 8 3 3 1 1 9 2 8 9 6 3 3 0 2 1 2 6 0 3 6 4 3 6 4 2 9 4
output:
7 17 27 37 47 55 57 67 70 71
result:
ok single line: '7 17 27 37 47 55 57 67 70 71'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
5 10 8 7 1 4 8 9 2 5 0 1 0 1 9 5 5 3 9 7 6 0 0 2 3 1 1 0 0 4 9 3
output:
66 88 166 188 222 226 262 266 288 366
result:
ok single line: '66 88 166 188 222 226 262 266 288 366'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
5 10 6 8 7 7 0 0 0 5 1 9 4 1 5 9 6 9 5 4 0 4 6 9 1 6 2 8 7 4 4 0
output:
3 13 22 23 30 31 32 33 34 35
result:
ok single line: '3 13 22 23 30 31 32 33 34 35'
Test #7:
score: 0
Accepted
time: 7ms
memory: 3672kb
input:
5 1000 0 4 1 3 9 6 9 6 2 1 8 6 5 3 0 7 7 3 0 2 8 0 8 4 2 4 1 2 9 7
output:
55 155 255 333 335 353 355 455 505 515 525 533 535 545 550 551 552 553 554 555 556 557 558 559 565 575 577 585 595 655 666 755 757 775 777 855 888 955 1055 1111 1116 1119 1155 1161 1166 1169 1191 1196 1199 1255 1333 1335 1353 1355 1455 1505 1515 1525 1533 1535 1545 1550 1551 1552 1553 1554 1555 1556...
result:
ok single line: '55 155 255 333 335 353 355 455...0 10053 10055 10111 10116 10119'
Test #8:
score: 0
Accepted
time: 51ms
memory: 4000kb
input:
5 10000 1 4 7 5 6 0 2 3 8 4 9 0 1 2 8 8 3 0 7 9 9 7 2 9 4 7 1 9 3 6
output:
55 155 255 355 455 505 515 525 535 545 550 551 552 553 554 555 556 557 558 559 565 566 575 585 595 655 656 665 666 755 855 888 955 1055 1111 1115 1116 1151 1155 1156 1161 1165 1166 1255 1355 1455 1505 1511 1515 1516 1525 1535 1545 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1561 1565 1566 1575...
result:
ok single line: '55 155 255 355 455 505 515 525...6 45507 45508 45509 45510 45511'
Test #9:
score: 0
Accepted
time: 56ms
memory: 4012kb
input:
6 10000 0 1 3 2 4 7 7 6 4 8 7 9 5 5 7 2 3 9 8 4 6 1 6 4 2 4 9 9 0 7 1 2 3 3 2 0
output:
55 155 255 355 455 505 515 525 535 545 550 551 552 553 554 555 556 557 558 559 565 575 585 595 655 666 668 686 688 755 855 866 868 886 888 955 1055 1111 1155 1255 1355 1455 1505 1515 1525 1535 1545 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1565 1575 1585 1595 1655 1666 1668 1686 1688 1755 18...
result:
ok single line: '55 155 255 355 455 505 515 525...6 66847 66848 66849 66850 66851'
Test #10:
score: 0
Accepted
time: 6ms
memory: 3584kb
input:
7 1000 5 2 1 6 3 7 7 9 8 1 8 1 8 7 2 0 6 2 3 8 6 0 5 1 8 8 3 7 0 8 1 0 6 3 5 6 6 7 5 0 9 1
output:
4 14 24 34 40 41 42 43 44 45 46 47 48 49 54 64 74 84 94 104 114 124 134 140 141 142 143 144 145 146 147 148 149 154 164 174 184 194 204 214 222 224 234 240 241 242 243 244 245 246 247 248 249 254 264 274 284 294 304 314 324 334 340 341 342 343 344 345 346 347 348 349 354 364 374 384 394 400 401 402 ...
result:
ok single line: '4 14 24 34 40 41 42 43 44 45 4...3 3474 3475 3476 3477 3478 3479'
Test #11:
score: 0
Accepted
time: 7ms
memory: 3684kb
input:
8 1000 3 8 1 9 7 6 6 5 2 1 8 9 3 8 7 9 2 3 0 5 7 7 7 3 2 9 0 4 2 9 2 7 5 0 5 3 5 9 2 7 0 8 8 3 1 3 0 5
output:
44 144 244 344 404 414 424 434 440 441 442 443 444 445 446 447 448 449 454 464 474 484 494 544 644 666 744 844 944 1044 1111 1116 1144 1161 1166 1244 1344 1404 1414 1424 1434 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1454 1464 1474 1484 1494 1544 1611 1616 1644 1661 1666 1744 1844 1944 2044 ...
result:
ok single line: '44 144 244 344 404 414 424 434...4 14540 14541 14542 14543 14544'
Test #12:
score: 0
Accepted
time: 64ms
memory: 3868kb
input:
9 10000 0 8 4 7 2 8 7 8 3 1 8 4 1 2 6 5 4 9 1 1 3 0 8 2 6 3 0 2 4 5 2 0 8 8 0 0 6 8 5 2 7 7 7 5 4 3 7 6 2 7 1 0 1 5
output:
99 199 299 399 499 599 699 799 899 909 919 929 939 949 959 969 979 989 990 991 992 993 994 995 996 997 998 999 1099 1199 1299 1399 1499 1599 1699 1799 1899 1909 1919 1929 1939 1949 1959 1969 1979 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2099 2199 2299 2399 2499 2599 2699 2799 2899 2909...
result:
ok single line: '99 199 299 399 499 599 699 799...799 134899 134909 134919 134929'
Test #13:
score: 0
Accepted
time: 61ms
memory: 3984kb
input:
20 10000 5 9 4 8 3 3 1 1 9 2 8 9 6 3 3 0 2 1 2 6 0 3 6 4 3 6 4 2 9 4 8 6 7 3 7 3 3 6 2 0 5 9 5 3 3 5 8 9 1 4 4 5 8 0 1 3 1 4 7 8 6 9 9 8 3 3 1 7 2 8 9 3 0 2 2 8 5 9 9 0 1 2 2 5 5 0 9 1 6 9 0 8 7 7 3 2 7 7 2 7 3 3 3 6 6 6 0 0 7 5 3 5 5 9 9 2 0 0 8 0
output:
444444 1444444 2444444 3444444 4044444 4144444 4244444 4344444 4404444 4414444 4424444 4434444 4440444 4441444 4442444 4443444 4444044 4444144 4444244 4444344 4444404 4444414 4444424 4444434 4444440 4444441 4444442 4444443 4444444 4444445 4444446 4444447 4444448 4444449 4444454 4444464 4444474 44444...
result:
ok single line: '444444 1444444 2444444 3444444...4 404094444 404104444 404114444'
Test #14:
score: 0
Accepted
time: 64ms
memory: 3992kb
input:
20 10000 8 7 1 4 8 9 2 5 0 1 0 1 9 5 5 3 9 7 6 0 0 2 3 1 1 0 0 4 9 3 5 6 6 1 6 0 9 1 3 0 8 2 8 7 1 1 1 2 0 8 2 2 2 8 8 3 1 1 5 7 0 2 2 9 6 5 9 9 6 7 1 6 4 2 7 5 3 3 8 4 4 0 1 0 3 0 2 0 0 8 4 6 8 2 6 1 2 7 4 6 0 5 0 2 9 6 0 1 5 6 3 1 9 9 6 0 2 5 0 3
output:
4444444 14444444 24444444 34444444 40444444 41444444 42444444 43444444 44044444 44144444 44244444 44344444 44404444 44414444 44424444 44434444 44440444 44441444 44442444 44443444 44444044 44444144 44444244 44444344 44444404 44444414 44444424 44444434 44444440 44444441 44444442 44444443 44444444 4444...
result:
ok single line: '4444444 14444444 24444444 3444...443444484 3443444494 3443444544'
Test #15:
score: 0
Accepted
time: 910ms
memory: 15896kb
input:
50 100000 5 9 4 8 3 3 1 1 9 2 8 9 6 3 3 0 2 1 2 6 0 3 6 4 3 6 4 2 9 4 8 6 7 3 7 3 3 6 2 0 5 9 5 3 3 5 8 9 1 4 4 5 8 0 1 3 1 4 7 8 6 9 9 8 3 3 1 7 2 8 9 3 0 2 2 8 5 9 9 0 1 2 2 5 5 0 9 1 6 9 0 8 7 7 3 2 7 7 2 7 3 3 3 6 6 6 0 0 7 5 3 5 5 9 9 2 0 0 8 0 2 1 9 7 9 9 3 4 2 1 9 6 8 9 8 8 6 7 9 9 1 7 2 5 0 ...
output:
4444444444444444444 14444444444444444444 24444444444444444444 34444444444444444444 40444444444444444444 41444444444444444444 42444444444444444444 43444444444444444444 44044444444444444444 44144444444444444444 44244444444444444444 44344444444444444444 44404444444444444444 44414444444444444444 4442444...
result:
ok single line: '4444444444444444444 1444444444...44444444 4154449444444444444444'
Test #16:
score: 0
Accepted
time: 1627ms
memory: 18936kb
input:
100 100000 5 9 4 8 3 3 1 1 9 2 8 9 6 3 3 0 2 1 2 6 0 3 6 4 3 6 4 2 9 4 8 6 7 3 7 3 3 6 2 0 5 9 5 3 3 5 8 9 1 4 4 5 8 0 1 3 1 4 7 8 6 9 9 8 3 3 1 7 2 8 9 3 0 2 2 8 5 9 9 0 1 2 2 5 5 0 9 1 6 9 0 8 7 7 3 2 7 7 2 7 3 3 3 6 6 6 0 0 7 5 3 5 5 9 9 2 0 0 8 0 2 1 9 7 9 9 3 4 2 1 9 6 8 9 8 8 6 7 9 9 1 7 2 5 0...
output:
7777777777777777777777777777777777 17777777777777777777777777777777777 27777777777777777777777777777777777 37777777777777777777777777777777777 47777777777777777777777777777777777 57777777777777777777777777777777777 67777777777777777777777777777777777 70777777777777777777777777777777777 7177777777777...
result:
ok single line: '777777777777777777777777777777...7777797777777777777777777777777'
Test #17:
score: 0
Accepted
time: 2109ms
memory: 22164kb
input:
100 100000 8 7 1 4 8 9 2 5 0 1 0 1 9 5 5 3 9 7 6 0 0 2 3 1 1 0 0 4 9 3 5 6 6 1 6 0 9 1 3 0 8 2 8 7 1 1 1 2 0 8 2 2 2 8 8 3 1 1 5 7 0 2 2 9 6 5 9 9 6 7 1 6 4 2 7 5 3 3 8 4 4 0 1 0 3 0 2 0 0 8 4 6 8 2 6 1 2 7 4 6 0 5 0 2 9 6 0 1 5 6 3 1 9 9 6 0 2 5 0 3 4 9 2 2 4 7 5 4 0 1 3 3 1 7 1 8 0 0 8 7 3 3 5 2 3...
output:
44444444444444444444444444444444444444444444 77777777777777777777777777777777777777777777 144444444444444444444444444444444444444444444 177777777777777777777777777777777777777777777 244444444444444444444444444444444444444444444 277777777777777777777777777777777777777777777 34444444444444444444444444...
result:
ok single line: '444444444444444444444444444444...7777777777777777777777777777777'
Test #18:
score: 0
Accepted
time: 2130ms
memory: 22144kb
input:
100 100000 6 8 7 7 0 0 0 5 1 9 4 1 5 9 6 9 5 4 0 4 6 9 1 6 2 8 7 4 4 0 0 1 4 3 9 2 3 0 2 1 3 4 6 5 4 1 6 3 7 1 3 6 9 4 4 5 1 3 6 2 4 3 0 2 4 7 8 8 3 5 8 6 9 7 7 0 3 1 9 5 9 9 8 3 2 0 9 1 2 5 8 0 0 0 0 3 1 2 5 9 3 2 2 3 5 6 1 2 0 0 4 0 6 2 4 6 9 4 0 8 2 9 7 1 7 4 0 3 1 8 0 9 7 5 9 6 2 7 7 0 0 4 8 4 6...
output:
222222222222222222222222222222222222222222 888888888888888888888888888888888888888888 1222222222222222222222222222222222222222222 1888888888888888888888888888888888888888888 2022222222222222222222222222222222222222222 2122222222222222222222222222222222222222222 22022222222222222222222222222222222222...
result:
ok single line: '222222222222222222222222222222...8888888888888880888888888888888'
Test #19:
score: 0
Accepted
time: 1726ms
memory: 18932kb
input:
100 100000 0 4 1 3 9 6 9 6 2 1 8 6 5 3 0 7 7 3 0 2 8 0 8 4 2 4 1 2 9 7 9 3 2 7 4 4 6 2 5 4 2 1 8 4 7 8 0 9 8 7 9 0 6 3 6 5 6 3 7 2 5 9 5 2 3 4 7 9 1 7 8 0 1 2 6 2 5 6 0 7 5 6 4 2 9 5 2 1 1 0 3 9 9 0 3 2 1 0 3 1 3 7 6 7 7 4 9 6 9 6 1 2 8 2 6 7 8 8 7 0 3 6 9 3 9 6 0 6 7 1 2 7 2 4 6 0 4 3 9 9 8 0 6 4 5...
output:
777777777777777777777777777777777777 1777777777777777777777777777777777777 2777777777777777777777777777777777777 3777777777777777777777777777777777777 4777777777777777777777777777777777777 5777777777777777777777777777777777777 6777777777777777777777777777777777777 70777777777777777777777777777777777...
result:
ok single line: '777777777777777777777777777777...7777777777777777777777677777772'
Test #20:
score: 0
Accepted
time: 1989ms
memory: 22048kb
input:
100 100000 1 4 7 5 6 0 2 3 8 4 9 0 1 2 8 8 3 0 7 9 9 7 2 9 4 7 1 9 3 6 4 4 5 4 0 5 7 4 5 9 6 3 4 7 0 2 9 2 6 0 2 2 6 9 9 1 7 2 6 4 1 7 9 0 5 3 9 4 6 7 2 6 7 1 7 0 9 3 9 9 4 3 5 3 9 7 9 4 2 4 0 7 7 4 5 0 3 0 1 1 2 1 6 9 2 1 2 8 6 9 0 1 6 4 8 1 9 6 5 4 2 0 4 6 0 9 0 7 5 9 4 0 1 0 0 5 1 8 8 9 8 1 4 9 5...
output:
6666666666666666666666666666666666666666 16666666666666666666666666666666666666666 26666666666666666666666666666666666666666 36666666666666666666666666666666666666666 46666666666666666666666666666666666666666 56666666666666666666666666666666666666666 60666666666666666666666666666666666666666 6166666...
result:
ok single line: '666666666666666666666666666666...6666636666666666666666666666966'
Test #21:
score: 0
Accepted
time: 428ms
memory: 9660kb
input:
10 100000 9 1 5 4 8 4 7 3 8 5 4 2 9 3 4 4 8 4 0 3 0 9 3 8 8 3 2 7 6 4 1 1 1 8 6 4 0 1 5 5 4 4 8 0 0 2 2 4 4 9 8 6 5 5 0 6 5 7 5 9
output:
1111 2222 7777 10111 11011 11101 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11121 11131 11141 11151 11161 11171 11181 11191 11211 11311 11411 11511 11611 11711 11811 11911 12111 12222 13111 14111 15111 16111 17111 17777 18111 19111 20222 21111 21222 22022 22122 22202 22212 22220 222...
result:
ok single line: '1111 2222 7777 10111 11011 111...7729224 7729225 7729226 7729227'
Test #22:
score: 0
Accepted
time: 581ms
memory: 9764kb
input:
10 100000 0 3 3 7 7 4 0 5 0 3 4 2 7 8 2 2 9 7 0 5 2 5 3 4 6 3 4 2 3 7 7 2 6 4 9 6 5 1 6 2 3 2 1 2 7 7 1 6 4 9 4 0 5 3 6 1 1 5 5 4
output:
88 188 288 388 488 588 688 788 808 818 828 838 848 858 868 878 880 881 882 883 884 885 886 887 888 889 898 988 1088 1111 1188 1288 1388 1488 1588 1688 1788 1808 1818 1828 1838 1848 1858 1868 1878 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1898 1988 2088 2188 2288 2388 2488 2588 2688 2788 2808...
result:
ok single line: '88 188 288 388 488 588 688 788...137 884138 884139 884140 884141'
Test #23:
score: 0
Accepted
time: 385ms
memory: 9764kb
input:
10 100000 8 6 2 1 9 5 3 6 5 2 9 8 5 2 5 7 3 6 4 1 7 1 5 9 8 4 6 3 8 0 3 1 7 0 6 4 8 6 8 1 9 9 4 6 5 2 3 7 3 6 3 3 0 8 1 6 7 5 3 6
output:
10000 20000 22222 30000 40000 44444 50000 60000 70000 80000 90000 99999 100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100020 100030 100040 100050 100060 100070 100080 100090 100100 100200 100300 100400 100500 100600 100700 100800 100900 101000 102000 103000 104000 1050...
result:
ok single line: '10000 20000 22222 30000 40000 ...5000 23016000 23017000 23018000'
Test #24:
score: 0
Accepted
time: 37ms
memory: 3976kb
input:
5 10000 1 6 3 7 1 6 8 1 8 1 8 7 6 2 3 6 2 3 0 0 0 0 0 0 8 8 3 7 8 8
output:
4 5 9 14 15 19 22 24 25 29 34 35 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 64 65 69 74 75 79 84 85 89 90 91 92 93 94 95 96 97 98 99 100 104 105 109 111 114 115 119 122 124 125 129 134 135 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 164 165...
result:
ok single line: '4 5 9 14 15 19 22 24 25 29 34 ...6 11997 11998 11999 12000 12001'
Test #25:
score: 0
Accepted
time: 46ms
memory: 3996kb
input:
10 10000 1 9 7 6 1 9 2 1 8 9 2 1 7 9 7 9 7 9 0 5 0 5 0 5 7 3 2 9 7 3 2 9 2 2 9 2 0 5 3 5 9 2 8 8 8 8 8 8 3 0 5 5 3 0 5 7 3 5 7 3
output:
4 14 24 34 40 41 42 43 44 45 46 47 48 49 54 64 66 74 84 94 104 111 114 116 124 134 140 141 142 143 144 145 146 147 148 149 154 161 164 166 174 184 194 204 214 224 234 240 241 242 243 244 245 246 247 248 249 254 264 266 274 284 294 304 314 324 334 340 341 342 343 344 345 346 347 348 349 354 364 366 3...
result:
ok single line: '4 14 24 34 40 41 42 43 44 45 4...0 22841 22842 22843 22844 22845'
Test #26:
score: 0
Accepted
time: 485ms
memory: 9688kb
input:
20 100000 4 7 2 8 7 4 1 8 1 8 1 8 2 6 5 4 2 6 1 3 0 8 1 3 3 3 3 3 3 3 4 4 4 4 4 4 0 8 8 0 8 8 6 6 6 6 6 6 2 7 7 2 7 7 4 3 4 3 4 3 2 2 2 2 2 2 0 1 5 2 0 1 7 0 6 2 7 0 6 8 6 8 6 8 1 1 1 1 1 1 2 4 8 2 4 8 9 9 0 9 9 0 6 6 6 6 6 6 5 0 0 9 4 5 4 3 1 7 4 3
output:
999 1999 2999 3999 4999 5555 5999 6999 7999 8999 9099 9199 9299 9399 9499 9599 9699 9799 9899 9909 9919 9929 9939 9949 9959 9969 9979 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10999 11999 12999 13999 14999 15555 15999 16999 17999 18999 19099 19199 19299 19399 19499 19599 19699 19799 198...
result:
ok single line: '999 1999 2999 3999 4999 5555 5...5505591 5505592 5505593 5505594'
Test #27:
score: 0
Accepted
time: 469ms
memory: 9648kb
input:
60 100000 0 7 3 7 0 7 7 7 7 7 7 7 0 5 4 4 5 0 8 1 8 8 1 8 9 2 3 9 2 3 0 1 0 1 0 1 0 5 0 5 0 5 3 4 3 4 3 4 9 9 9 9 9 9 7 9 7 9 7 9 1 2 5 1 2 5 1 2 1 1 2 1 4 0 2 5 4 0 9 9 9 9 9 9 6 1 6 1 6 1 0 9 0 9 0 9 9 2 6 8 9 2 5 7 7 5 7 7 9 9 9 9 9 9 2 5 2 5 2 5 9 9 9 9 9 9 4 0 8 4 0 8 7 7 7 7 7 7 8 9 8 9 8 9 1 ...
output:
666666666 1666666666 2666666666 3666666666 4666666666 5666666666 6066666666 6166666666 6266666666 6366666666 6466666666 6566666666 6606666666 6616666666 6626666666 6636666666 6646666666 6656666666 6660666666 6661666666 6662666666 6663666666 6664666666 6665666666 6666066666 6666166666 6666266666 6666...
result:
ok single line: '666666666 1666666666 266666666...06166 666666006266 666666006366'
Test #28:
score: 0
Accepted
time: 738ms
memory: 15880kb
input:
80 100000 2 7 2 7 2 7 9 3 9 3 9 3 4 4 4 4 4 4 5 9 1 2 7 5 2 2 2 2 2 2 4 7 4 7 4 7 1 8 1 8 1 8 5 2 5 2 5 2 0 8 0 8 0 8 2 2 4 3 1 2 0 6 0 6 0 6 3 3 3 3 3 3 9 2 9 5 9 2 0 6 0 6 0 6 5 5 5 5 5 5 1 1 1 1 1 1 9 8 1 7 1 5 0 8 4 8 7 0 8 0 4 8 0 4 1 5 4 1 8 1 9 0 9 0 9 0 7 1 7 1 7 1 4 3 8 7 4 3 6 5 6 5 6 5 3 ...
output:
222222222222222 555555555555555 1222222222222222 1555555555555555 2022222222222222 2122222222222222 2202222222222222 2212222222222222 2220222222222222 2221222222222222 2222022222222222 2222122222222222 2222202222222222 2222212222222222 2222220222222222 2222221222222222 2222222022222222 2222222122222...
result:
ok single line: '222222222222222 55555555555555...222262222229 222202222262222232'
Test #29:
score: 0
Accepted
time: 752ms
memory: 15816kb
input:
100 100000 4 6 8 6 6 4 8 8 8 8 8 8 0 0 0 0 0 0 6 6 6 6 6 6 5 2 3 3 8 5 9 9 9 9 9 9 1 4 5 9 1 4 4 4 1 4 4 4 2 8 5 2 8 5 3 4 3 6 3 4 1 4 1 3 3 1 5 6 5 6 5 6 6 7 1 6 7 1 8 8 8 8 8 8 3 3 3 3 3 3 6 6 6 6 6 6 9 9 9 9 9 9 0 5 9 0 5 9 1 3 7 1 3 7 5 6 5 6 5 6 1 1 1 1 1 1 7 7 7 7 7 7 5 3 5 3 5 3 6 0 5 7 6 0 9...
output:
111111111111111111 1011111111111111111 1101111111111111111 1110111111111111111 1111011111111111111 1111101111111111111 1111110111111111111 1111111011111111111 1111111101111111111 1111111110111111111 1111111111011111111 1111111111101111111 1111111111110111111 1111111111111011111 1111111111111101111 1...
result:
ok single line: '111111111111111111 10111111111...111111519 111111111110111111521'
Test #30:
score: 0
Accepted
time: 967ms
memory: 15808kb
input:
100 100000 4 4 4 4 4 4 7 2 4 7 2 4 2 3 6 2 3 6 1 3 1 3 1 3 2 2 2 2 2 2 9 0 2 8 4 9 1 2 1 1 2 1 5 9 1 5 9 1 3 5 0 1 7 3 5 7 1 5 7 1 8 5 0 8 8 5 7 4 7 4 7 4 5 5 5 5 5 5 9 7 7 7 1 9 9 0 3 5 9 0 1 5 5 2 1 5 0 2 0 0 2 0 4 2 8 4 4 2 5 5 5 5 5 5 3 3 3 3 3 3 0 8 9 2 5 5 9 6 9 6 9 6 8 2 2 5 6 9 7 7 7 7 7 7 3...
output:
8888888888888888888 10000000000000000000 18888888888888888888 20000000000000000000 28888888888888888888 30000000000000000000 38888888888888888888 40000000000000000000 48888888888888888888 50000000000000000000 58888888888888888888 60000000000000000000 68888888888888888888 70000000000000000000 7888888...
result:
ok single line: '8888888888888888888 1000000000...00000000 3000700000000300000000'
Test #31:
score: 0
Accepted
time: 975ms
memory: 15896kb
input:
100 100000 0 0 0 0 0 0 4 4 1 9 4 4 0 7 0 7 0 7 5 1 9 4 4 0 1 3 1 7 2 1 9 3 4 1 4 9 9 9 9 9 9 9 3 2 4 9 0 3 9 9 9 9 9 9 0 4 2 3 2 0 2 2 2 2 2 2 7 8 7 8 7 8 5 7 5 5 7 5 8 8 8 8 8 8 7 6 4 5 7 6 0 0 0 0 0 0 0 3 4 0 3 4 1 8 3 1 8 3 5 7 1 0 5 7 2 2 2 2 2 2 3 4 2 3 4 2 0 0 0 0 0 0 7 7 7 7 7 7 2 6 7 2 8 2 2...
output:
666666666666666666 1666666666666666666 2666666666666666666 3666666666666666666 4666666666666666666 5666666666666666666 6066666666666666666 6166666666666666666 6266666666666666666 6366666666666666666 6466666666666666666 6566666666666666666 6606666666666666666 6616666666666666666 6626666666666666666 6...
result:
ok single line: '666666666666666666 16666666666...666666666 606666663669666666666'
Extra Test:
score: 0
Extra Test Passed