Submission #142493

#TimeUsernameProblemLanguageResultExecution timeMemory
142493KCSCKotrljanje (COCI18_kotrljanje)C++14
28 / 140
2099 ms2680 KiB
#include <bits/stdc++.h> using namespace std; const int DIM = 50005; int frq[DIM]; int convert(long long x, int b) { int s = 0; for (; x; x /= b) s += x % b; return s; } int main(void) { // freopen("kotrljanje.in", "r", stdin); // freopen("kotrljanje.out", "w", stdout); int c, d, b, m; cin >> c >> d >> b >> m; for (int i = 92852635; i; ++i) { int v = convert(1LL * c * i + d, b); ++frq[v]; if (frq[v] == m) { for (int j = 92852635; j <= i; ++j) if (convert(1LL * c * j + d, b) == v) printf("%d ", j); break; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...