Submission #95560

#TimeUsernameProblemLanguageResultExecution timeMemory
95560oolimryTavan (COCI16_tavan)C++14
80 / 80
2 ms380 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k, x; //freopen("i.txt","r",stdin); scanf("%d %d %d %d",&n,&m,&k,&x); string s; cin >> s; string arr[m]; for(int i = 0;i < m;i++){ cin >> arr[i]; } reverse(arr, arr + m); char carr[m][k]; for(int i= 0;i < m;i++){ for(int j = 0;j < k;j++){ carr[i][j] = arr[i].at(j); } } for(int i =0;i < m;i++){ sort(carr[i], carr[i] + k); } int index = 0; x--; for(int i = n - 1;i >= 0 ;i--){ char c = s.at(i); if(c != '#'){ continue; } s[i] = carr[index][x % k]; x /= k; index++; } for(int i= 0;i < m;i++){ for(int j = 0;j < k;j++){ //printf("%c ",carr[i][j]); } // printf("\n"); } cout << s; return 0; }

Compilation message (stderr)

tavan.cpp: In function 'int main()':
tavan.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d %d",&n,&m,&k,&x);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...