# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
74100 | charlies_moo | Tavan (COCI16_tavan) | C++14 | 2 ms | 852 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 <cstdio>
#include <iostream>
#include <string>
using namespace std;
char letter[]={"0123456789ABCDEFGHIJKLHIMNOPQRSTUVWXYZ"};
string to;
int num;
void change(int x)
{
if(x)
change(x/num);
to+=letter[x%num];
}
int main()
{
string voc,c[505],ans;
int n,m,k,x,count_=0;
cin>>n>>m>>k>>x;
cin>>voc;
for(int i=0;i<m;i++)
cin>>c[i];
num=k+1;
change(x);
while(to.size()<m)
{
char zero='0';
to.insert(0,"0");
}
for(int i=0;i<n;i++)
if(voc[i]!='#')
ans+=voc[i];
else
{
if(to[count_]>='0' && to[count_]<='9')
ans+=c[count_++][to[count_]-'0'];
else
ans+=c[count_++][to[count_]-'A'+10];
}
cout<<ans;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |