| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 200161 | Saboon | Kotrljanje (COCI18_kotrljanje) | C++14 | 1466 ms | 3960 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e7 + 37;
int a[maxn];
int cntdig(ll x, ll b){
int ret = 0;
while (x){
ret += (x % b);
x /= b;
}
return ret;
}
int main(){
ios_base::sync_with_stdio(false);
ll c, d, b, m;
cin >> c >> d >> b >> m;
ll t = 1;
while (t <= d)
t *= b;
t /= b;
t *= (b - 1);
int can;
for (int i = 1; ; i++){
ll x = c * t * i + d;
int t = cntdig(x, b);
a[t] ++;
if (a[t] == m){
can = t;
break;
}
}
for (int i = 1; m; i++){
ll x = c * t * i + d;
if (cntdig(x, b) == can){
cout << t * i << " ";
m --;
}
}
cout << endl;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
