답안 #153774

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
153774 2019-09-15T20:59:40 Z BabinSinko Tavan (COCI16_tavan) C++14
0 / 80
2 ms 380 KB
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
#include <string.h>
#include <algorithm>
#include <vector>

using namespace std;

long long n, m, k, x, nm, a, l;
vector<long long> key;
string s, sc;
char c[503][29];
int main(){
cin >> n >> m >> k >> x;
cin >> s;
a = x;
for (int i = 0; i < m; i++){
	cin >> sc;
	strcpy(c[i], sc.c_str());
	sort(c[i], c[i] + k);
	if (a != 0){
		key.insert(key.begin(), (a % (k + 1)) - 1);
		a = a / (k+1);
	}
	if (a == 0){
		key.insert(key.begin(), 0);
		
	}
}
cout << key[0] << endl;
for (int i = 0; i < n; i++){
	if (s[i] == '#'){
		s[i] = c[nm][key[nm]];
		nm = nm + 1;
	}
}
cout << s;
return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Incorrect 2 ms 256 KB Output isn't correct
4 Incorrect 2 ms 256 KB Output isn't correct
5 Incorrect 2 ms 376 KB Output isn't correct
6 Incorrect 2 ms 256 KB Output isn't correct
7 Incorrect 2 ms 256 KB Output isn't correct
8 Incorrect 2 ms 380 KB Output isn't correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Incorrect 2 ms 376 KB Output isn't correct