제출 #1044470

#제출 시각아이디문제언어결과실행 시간메모리
1044470fv3Paint By Numbers (IOI16_paint)C++14
32 / 100
1 ms348 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; int N, M; string solve_puzzle(string s, vector<int> c) { N = s.size(); M = c.size(); vector<int> preSum(M + 1); vector<int> sufSum(M + 1, N); for (int i = 0; i < M; i++) preSum[i+1] = preSum[i] + c[i] + 1; for (int i = M - 1; i >= 0; i--) sufSum[i] -= (N - sufSum[i+1]) + c[i] + (int)(i != M - 1); string res(N, '?'); for (int i = 0; i < M; i++) { for (int j = sufSum[i]; j < preSum[i] + c[i]; j++) res[j] = 'X'; } int cnt = 0; for (auto c : res) c=='?'&&cnt++; if (cnt == M - 1) { for (auto&c : res) { if (c == '?') c = '_'; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...