Submission #712575

#TimeUsernameProblemLanguageResultExecution timeMemory
712575gnhmhpTavan (COCI16_tavan)C++14
80 / 80
1 ms360 KiB
#include <bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr) using namespace std; const int maxn=1e3+5; int n, m, k; long long x; string s[maxn]; vector<int> v; int main() { fastio; cin >> n >> m >> k >> x; cin >> s[0]; v.push_back(0); for (int i=0; i<s[0].size(); ++i) if (s[0][i]=='#') v.push_back(i); for (int i=1; i<=m; ++i) { cin >> s[i]; sort(s[i].begin(), s[i].end()); } for (int i=1; i<=m && x; ++i) { long long cur=1; for (int j=m; j>i && cur<x; --j) cur*=1LL*k; long long p=(x-1)/cur; x-=(cur*p); s[0][v[i]]=s[i][p]; } cout << s[0]; }

Compilation message (stderr)

tavan.cpp: In function 'int main()':
tavan.cpp:17:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (int i=0; i<s[0].size(); ++i)
      |                   ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...