이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
bool IsInRange(pair <int,int> m, int x) {
return m.first <= x && m.second >= x;
}
string solve_puzzle(string s, vector<int> c) {
pair <int,int> beg = make_pair (1, c[0]);
//cout << "[1, " << c[0] << "]\n";
pair <int,int> end = make_pair (s.size()-c[0]+1, s.size());
//cout << "[" << s.size()-c[0] << ", " << s.size() << "]\n";
pair <int,int> mixed = make_pair (end.first, beg.second);
//cout << "[" << mixed.first << ", " << mixed.second << "]\n";
string res = "";
for (int i=1; i<=s.size(); i++) {
if (IsInRange(mixed, i)) res += "X";
else res += "?";
}
return res;
}
컴파일 시 표준 에러 (stderr) 메시지
paint.cpp: In function 'std::__cxx11::string solve_puzzle(std::__cxx11::string, std::vector<int>)':
paint.cpp:19:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i=1; i<=s.size(); i++) {
~^~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |