제출 #1184577

#제출 시각아이디문제언어결과실행 시간메모리
1184577Adrian_Soriaga친구 (IOI14_friend)C++20
컴파일 에러
0 ms0 KiB
#include "friend.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll MOD = 1000000007; int findSample(int n,int confidence[],int host[],int protocol[]){ vector<int> yes(n) , no(n); for (int i=0; i<n; i++){ yes[i] = confidence[i]; } for (int i=n-1; i>0; i--){ int cur = host[i]; if (protocol[i] == 0){ yes[cur] += no[i]; no[cur] = max(no[cur]+no[i], no[cur] +yes[i]); } else{ if (protocol[i] == 1){ //not including host yes[cur] = max(yes[cur]+yes[i], max(no[cur]+yes[i], yes[cur]+no[i])); } else{ yes[cur] = max(no[cur]+yes[i], yes[cur]+no[i]) } no[cur] += no[i]; } } return max(yes[0],no[0]); }

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:23:63: error: expected ';' before '}' token
   23 |                 yes[cur] = max(no[cur]+yes[i], yes[cur]+no[i])
      |                                                               ^
      |                                                               ;
   24 |             }
      |             ~