제출 #583554

#제출 시각아이디문제언어결과실행 시간메모리
583554EinsiteinPaint By Numbers (IOI16_paint)C++98
컴파일 에러
0 ms0 KiB
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> using namespace std; string solve_puzzle(string s, int c[]) { s = s; array<int, c.length()> arr = c; return (s.length() - arr[0] + 1); }

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

paint.cpp: In function 'std::string solve_puzzle(std::string, int*)':
paint.cpp:56:18: error: request for member 'length' in 'c', which is of non-class type 'int*'
   56 |     array<int, c.length()> arr = c;
      |                  ^~~~~~
paint.cpp:56:26: error: template argument 2 is invalid
   56 |     array<int, c.length()> arr = c;
      |                          ^
paint.cpp:56:34: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   56 |     array<int, c.length()> arr = c;
      |                                  ^
      |                                  |
      |                                  int*
paint.cpp:57:29: error: invalid types 'int[int]' for array subscript
   57 |     return (s.length() - arr[0] + 1);
      |                             ^