Submission #74100

#TimeUsernameProblemLanguageResultExecution timeMemory
74100charlies_mooTavan (COCI16_tavan)C++14
0 / 80
2 ms852 KiB
#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)

tavan.cpp: In function 'int main()':
tavan.cpp:28:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while(to.size()<m)
        ~~~~~~~~~^~
tavan.cpp:30:8: warning: unused variable 'zero' [-Wunused-variable]
   char zero='0';
        ^~~~
tavan.cpp:39:18: warning: operation on 'count_' may be undefined [-Wsequence-point]
     ans+=c[count_++][to[count_]-'0'];
            ~~~~~~^~
tavan.cpp:41:18: warning: operation on 'count_' may be undefined [-Wsequence-point]
     ans+=c[count_++][to[count_]-'A'+10];
            ~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...