제출 #672516

#제출 시각아이디문제언어결과실행 시간메모리
672516Trisanu_DasPaint By Numbers (IOI16_paint)C++17
32 / 100
1 ms340 KiB
#include<bits/stdc++.h> #include "paint.h" using namespace std; string solve_puzzle(string s, vector<int> c) { int n = s.size(), k = c.size(); string ans = ""; for(int i = 0; i < n; i++) ans.push_back('X'); int extra = n + 1; for(int i = 0; i < k; i++) extra -= c[i] + 1; if(!extra){ int sum = c[0]; for(int i = 1; i < k; i++) { ans[sum] = '_'; sum += c[i] + 1; } return ans; } int sum = 0; for(int i = 0; i < k; i++){ for(int j = sum; j < sum + extra; j++) ans[j] = '?'; sum += c[i]; for(int j = sum; j < sum + extra; j++) ans[j] = '?'; sum++; } return ans; }
#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...