제출 #103790

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1037902019-04-02 16:25:26naoai친구 (IOI14_friend)C++14
16 / 100
4 ms384 KiB
#include "friend.h"
#include <bits/stdc++.h>
using namespace std;
const int nmax = 1e5 + 5;
int d[nmax + 1][2];
int findSample(int n,int confidence[],int host[],int protocol[]){
for (int i = 0; i < n; ++ i)
d[i][1] = confidence[i];
for (int i = n - 1; i > 0; -- i) {
int h = host[i];
if (protocol[i] == 0) {
d[h][0] = d[h][0] + max(d[i][0], d[i][1]);
} else if (protocol[i] == 1) {
d[h][0] = d[h][0] + d[i][0];
d[h][1] = max(d[h][1] + max(d[i][0], d[i][1]), d[h][0] + d[i][1]);
} else {
d[h][0] = d[h][0] + d[i][0];
d[h][1] = max(d[h][0] + d[i][1], d[h][1] + d[i][0]);
}
}
return max(d[0][0], d[0][1]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:11:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for (int i = 0; i < n; ++ i)
     ^~~
friend.cpp:14:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for (int i = n - 1; i > 0; -- i) {
  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...