# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
443160 | penguinhacker | Tavan (COCI16_tavan) | C++14 | 1 ms | 332 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int n, m, k, x;
string s, cand[500];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> k >> x >> s, --x;
vector<int> d;
for (int i=0; i<m; ++i) {
cin >> cand[i];
sort(cand[i].begin(), cand[i].end());
d.push_back(x%k);
x/=k;
}
reverse(d.begin(), d.end());
int seen=0;
for (int i=0; i<n; ++i)
if (s[i]=='#')
s[i]=cand[seen][d[seen]], ++seen;
cout << s;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |