제출 #424377

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4243772021-06-11 20:54:40APROHACK친구 (IOI14_friend)C++14
100 / 100
36 ms3148 KiB
#include "friend.h"
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define yo 0
#define ellos 1
#define nosotros 2
//vector<int>ady[100001];
//bool recorrido[100001];
//bool prendido[100001];
//int mem[1001][2];
//vector<int>conf;
// Find out best sample
int si[100002], no[100002];
int findSample(int n,int confidence[],int host[],int protocol[]){
for(int i = 0 ; i < n ; i++){
si[i]=confidence[i];
no[i]=0;
}
int mx=0;
for(int i = n-1 ; i >= 1 ; i--){
if(protocol[i]==yo){
si[host[i]]+=no[i];
no[host[i]]+=max(si[i], no[i]);
//mx=max(mx, max(si[host[i]], no[host[i]]));
}else if(protocol[i]==ellos){
si[host[i]] = max(max(si[host[i]]+no[i], no[host[i]]+si[i]), si[host[i]]+si[i]);
no[host[i]]+=no[i];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:22:6: warning: unused variable 'mx' [-Wunused-variable]
   22 |  int mx=0;
      |      ^~
#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...