제출 #835365

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8353652023-08-23 13:50:46Liudas친구 (IOI14_friend)C++17
27 / 100
1095 ms15012 KiB
#include <cstdio>
#include <cassert>
#define __MAXSIZE__ 100002
#include "friend.h"
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>
#define __MAXSIZE__ 100002
using namespace std;
void getmax(int head, int N, vector<vector<int>> &arr, int &m, set<int> been, int score, int conf[]){
if(head == N){
m = max(m, score);
return;
}
set<int> nbeen = been;
for(int i : arr[head]){
nbeen.insert(i);
}
getmax(head + 1, N, arr, m, been, score, conf);
if(been.find(head) == been.end())
getmax(head + 1, N, arr, m, nbeen, score + conf[head], conf);
}
void dfs(int head, int par, vector<vector<int>> &arr, vector<int> &val, vector<int> &bel){
int v = 0;
for(int i : arr[head]){
if(i != par){
dfs(i, head, arr, val, bel);
v += max(bel[i], val[i]);
bel[head] += val[i];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:114:44: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  114 |                     if(arr[i].child.size() != mv)continue;
      |                        ~~~~~~~~~~~~~~~~~~~~^~~~~
friend.cpp:126:1: warning: control reaches end of non-void function [-Wreturn-type]
  126 | }
      | ^
#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...