제출 #293335

#제출 시각아이디문제언어결과실행 시간메모리
293335shrek12357Paint By Numbers (IOI16_paint)C++14
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <climits>
#include <cmath>
#include <fstream>
#include <queue>
using namespace std;

string solve_puzzle(string s, int c[]) {
	string ans = "";
	for (int i = 0; i < s.size(); i++) {
		ans += "?";
	}
	for (int i = s.size() - c[0]; i < c[0]; i++) {
		ans[i] = 'X';
	}
	return ans;
}

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

paint.cpp: In function 'std::string solve_puzzle(std::string, int*)':
paint.cpp:15:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  for (int i = 0; i < s.size(); i++) {
      |                  ~~^~~~~~~~~~
/tmp/ccsu1nS2.o: In function `main':
grader.cpp:(.text.startup+0x22a): undefined reference to `solve_puzzle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status