제출 #1204528

#제출 시각아이디문제언어결과실행 시간메모리
1204528aritro_상형문자열 (IOI24_hieroglyphs)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> std::vector<int> ucs(std::vector<int> a, std::vector<int> b){ //subtask 1 vector<int> ans1(1,-1); if(a.size()!=b.size()) return ans1; int n=a.size(); vector<int> ans2(n); for(int i=0;i<n;i++) ans2[i]=i; for(int i=0;i<n;i++){ if(a[i]!=b[i]) return ans1; if(a[i]!=i) return ans1; } return ans2; }

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

hieroglyphs.cpp: In function 'std::vector<int> ucs(std::vector<int>, std::vector<int>)':
hieroglyphs.cpp:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> ans1(1,-1);
      |     ^~~~~~
hieroglyphs.cpp:5:5: note: suggested alternatives:
In file included from /usr/include/c++/11/vector:67,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from hieroglyphs.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from hieroglyphs.cpp:1:
/usr/include/c++/11/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
hieroglyphs.cpp:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> ans1(1,-1);
      |            ^~~
hieroglyphs.cpp:6:35: error: 'ans1' was not declared in this scope
    6 |     if(a.size()!=b.size()) return ans1;
      |                                   ^~~~
hieroglyphs.cpp:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> ans2(n);
      |            ^~~
hieroglyphs.cpp:9:26: error: 'ans2' was not declared in this scope
    9 |     for(int i=0;i<n;i++) ans2[i]=i;
      |                          ^~~~
hieroglyphs.cpp:11:31: error: 'ans1' was not declared in this scope
   11 |         if(a[i]!=b[i]) return ans1;
      |                               ^~~~
hieroglyphs.cpp:12:28: error: 'ans1' was not declared in this scope
   12 |         if(a[i]!=i) return ans1;
      |                            ^~~~
hieroglyphs.cpp:14:12: error: 'ans2' was not declared in this scope
   14 |     return ans2;
      |            ^~~~