제출 #819390

#제출 시각아이디문제언어결과실행 시간메모리
819390jlallas384Paint By Numbers (IOI16_paint)C++17
7 / 100
1 ms256 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; std::string solve_puzzle(std::string s, std::vector<int> c) { int n = s.size(), k = c.size(); int f = c[0]; vector<int> ans(n, 1); for(int i = 0; i + f - 1 < n; i++){ string res = ""; for(int j = 0; j < n; j++){ if(i <= j && j <= i + f - 1){ res += 'X'; }else{ res += '?'; } } for(int j = 0; j < n; j++){ if(res[j] == '?') ans[j] = 0; } } string res = ""; for(int x: ans){ res += "?X"[x]; } assert('?' == (char) (63)); assert('X' == (char) (88)); return res; }

컴파일 시 표준 에러 (stderr) 메시지

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:6:27: warning: unused variable 'k' [-Wunused-variable]
    6 |         int n = s.size(), k = c.size();
      |                           ^
#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...