제출 #818872

#제출 시각아이디문제언어결과실행 시간메모리
818872Halym2007Paint By Numbers (IOI16_paint)C++11
0 / 100
0 ms308 KiB
#include <bits/stdc++.h> using namespace std; #define sz size() bool vis[105][2]; string solve_puzzle(string s, vector<int> c) { int n = (int)s.sz; int k = (int)c.sz; int k1 = k; int sum = 0; for (int i : c) { sum += i; } int l = 0; for (int i = 0; i < k1; ++i) { int val = n - (sum + k - 1); int val1 = n - (sum + k - 1) + c[i]; // cout << n << " " << k << " " << sum << " " << val << " " << val1 << " " << c[i] << " " << i << " " << l << "\n"; for (int j = l; j <= l + val - 1; ++j) { vis[j][0] = 1; } int jj = 0; if (i > 0) jj = 1; for (int j = l + jj; j <= l + val1 - 1; ++j) { vis[j][1] = 1; } l += c[i]; n -= c[i]; sum -= c[i]; k--; } n = (int)s.sz; while (l+1 < n) { l++; vis[l][0] = 1; } // cout << n; // exit(0); string jog; for (int i = 0; i < n; ++i) { if (vis[i][0] and vis[i][1]) { jog += '?'; } else if (vis[i][0]) jog += '_'; else if (vis[i][1]) jog += 'X'; } // cout << (int)jog.sz << "\n"; // cout << jog; // exit(0); return jog; }
#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...