제출 #466739

#제출 시각아이디문제언어결과실행 시간메모리
466739habibaissaHandcrafted Gift (IOI20_gift)C++17
컴파일 에러
0 ms0 KiB
#include "gift.h" int construct(int n, int r, std::vector<int> a, std::vector<int> b, std::vector<int> x){ string s=""; for(int i=0;i<n;i++) { s+='B'; } craft(s); return 1; }

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

gift.cpp: In function 'int construct(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
gift.cpp:3:5: error: 'string' was not declared in this scope
    3 |     string s="";
      |     ^~~~~~
gift.cpp:3:5: note: suggested alternatives:
In file included from /usr/include/c++/10/string:39,
                 from gift.h:2,
                 from gift.cpp:1:
/usr/include/c++/10/bits/stringfwd.h:79:33: note:   'std::string'
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from gift.h:2,
                 from gift.cpp:1:
/usr/include/c++/10/string:67:11: note:   'std::pmr::string'
   67 |     using string    = basic_string<char>;
      |           ^~~~~~
gift.cpp:6:9: error: 's' was not declared in this scope
    6 |         s+='B';
      |         ^
gift.cpp:8:11: error: 's' was not declared in this scope
    8 |     craft(s);
      |           ^