# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
413320 | sebinkim | Weird Numeral System (CCO21_day1problem2) | C++14 | 14 ms | 24032 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
map<ll, ll> M;
queue<ll> Q;
vector<ll> A[1010101];
ll k, q, d, m;
void tc(ll n) {
ll t, u;
for (; !Q.empty(); Q.pop());
Q.push(n); M.clear();
for (; !Q.empty(); ) {
t = Q.front(); Q.pop();
if (t == 0) {
for (; t != n; t = M[t]) {
cout << (M[t] - t * k) << " ";
}
cout << "\n";
return;
}
for (ll &a: A[(t % k + k) % k]) {
assert((t - a) % k == 0);
u = (t - a) / k;
if (M.find(u) == M.end()) {
M[u] = t; Q.push(u);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |