제출 #1042305

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10423052024-08-02 20:13:10sofppUnscrambling a Messy Bug (IOI16_messy)C++14
컴파일 에러
0 ms0 KiB
vector<int> vs(n,0);
string c;
for(int i=0;i<n;i++){
c+='0';
}
string result=c;
for(int i=n;i>=0;i--){
c[i]='1';
add_element(c);
}
compile_set();
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
string h=result;
if(h[j]=='1'){
continue;
}
h[j]='1';
if(check_element(h)==true){
result[i]='1';
vs[i]=j;
}
}
}
return vs;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

messy.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> vs(n,0);
      | ^~~~~~
messy.cpp:2:5: error: 'string' does not name a type
    2 |     string c;
      |     ^~~~~~
messy.cpp:3:5: error: expected unqualified-id before 'for'
    3 |     for(int i=0;i<n;i++){
      |     ^~~
messy.cpp:3:17: error: 'i' does not name a type
    3 |     for(int i=0;i<n;i++){
      |                 ^
messy.cpp:3:21: error: 'i' does not name a type
    3 |     for(int i=0;i<n;i++){
      |                     ^
messy.cpp:6:5: error: 'string' does not name a type
    6 |     string result=c;
      |     ^~~~~~
messy.cpp:7:5: error: expected unqualified-id before 'for'
    7 |     for(int i=n;i>=0;i--){
      |     ^~~
messy.cpp:7:17: error: 'i' does not name a type
    7 |     for(int i=n;i>=0;i--){
      |                 ^
messy.cpp:7:22: error: 'i' does not name a type
    7 |     for(int i=n;i>=0;i--){
      |                      ^
messy.cpp:12:18: error: expected constructor, destructor, or type conversion before ';' token
   12 |     compile_set();
      |                  ^
messy.cpp:13:5: error: expected unqualified-id before 'for'
   13 |     for(int i=0;i<n;i++){
      |     ^~~
messy.cpp:13:17: error: 'i' does not name a type
   13 |     for(int i=0;i<n;i++){
      |                 ^
messy.cpp:13:21: error: 'i' does not name a type
   13 |     for(int i=0;i<n;i++){
      |                     ^
messy.cpp:27:5: error: expected unqualified-id before 'return'
   27 |     return vs;
      |     ^~~~~~
messy.cpp:28:1: error: expected declaration before '}' token
   28 | }
      | ^