제출 #404180

#제출 시각아이디문제언어결과실행 시간메모리
404180wmrmr친구 (IOI14_friend)C++17
컴파일 에러
0 ms0 KiB
{ int p = host[i]; if(protocol[i] != 1) adj[i][p] = adj[p][i] = 1; if(protocol[i] != 0) for(int j=0;j<i;j++) adj[i][j] = adj[j][i] = adj[j][i] || adj[p][j]; } int dbg = 0; for(int cur = 0 ; cur < (1<<n) ; cur++) { bool valid = 1; for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) { if( (cur&(1<<i)) && (cur&(1<<j)) ) if(adj[i][j]) valid = 0; } int temp = 0; for(int i=0;i<n;i++) if(cur&(1<<i)) temp += confidence[i]; if(valid) ans = max(ans,temp), dbg = cur; } return ans; } if(pt2) { for(int i=0;i<n;i++) ans += confidence[i]; return ans; } if(pt3) { for(int i=0;i<n;i++) ans = max(ans,confidence[i]); return ans; } return 0; }

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

friend.cpp:1:17: error: expected unqualified-id before '{' token
    1 |                 {
      |                 ^
friend.cpp:9:17: error: expected unqualified-id before 'for'
    9 |                 for(int cur = 0 ; cur < (1<<n) ; cur++)
      |                 ^~~
friend.cpp:9:35: error: 'cur' does not name a type
    9 |                 for(int cur = 0 ; cur < (1<<n) ; cur++)
      |                                   ^~~
friend.cpp:9:50: error: 'cur' does not name a type
    9 |                 for(int cur = 0 ; cur < (1<<n) ; cur++)
      |                                                  ^~~
friend.cpp:22:17: error: expected unqualified-id before 'return'
   22 |                 return ans;
      |                 ^~~~~~
friend.cpp:23:9: error: expected declaration before '}' token
   23 |         }
      |         ^
friend.cpp:24:9: error: expected unqualified-id before 'if'
   24 |         if(pt2)
      |         ^~
friend.cpp:29:9: error: expected unqualified-id before 'if'
   29 |         if(pt3)
      |         ^~
friend.cpp:34:9: error: expected unqualified-id before 'return'
   34 |         return 0;
      |         ^~~~~~
friend.cpp:35:1: error: expected declaration before '}' token
   35 | }
      | ^