Submission #82064

#TimeUsernameProblemLanguageResultExecution timeMemory
82064heonTavan (COCI16_tavan)C++11
80 / 80
2 ms704 KiB
#include<bits/stdc++.h> using namespace std; string pretvori(int num, int base){ string t; while(num){ t += (num % base) + '0'; num /= base; } return t; } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n,m,k,x; cin >> n >> m >> k >> x; string s; cin >> s; vector <string> v(m); for(int i = 0; i < m; i++){ cin >> v[i]; sort(v[i].begin(), v[i].end()); } string rj = pretvori(x - 1, k); int lj = 0; for(auto x : s) if(x == '#') lj++; while(rj.size() != lj) rj.push_back('0'); reverse(rj.begin(), rj.end()); int ind = 0; for(auto x : rj){ s[s.find('#')] = v[ind++][x - '0']; } cout << s; }

Compilation message (stderr)

tavan.cpp: In function 'int main()':
tavan.cpp:31:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while(rj.size() != lj) rj.push_back('0');
        ~~~~~~~~~~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...