#include <bits/stdc++.h>
#include <friend.h>
using namespace std;
int findSample(int n, int confidence[], int host[], int protocol[]) {
int p = protocol[1];
bool st234 = true;
for (int idx=2; idx<n; idx++) {
if (protocol[idx] != p) {
st234=false;
break;
}
}
if (st234) {
// subtasks 2, 3, 4
if (p==0) { // IAmYourFriend, st4
// just get all pairs by host and host index
int res = 0;
for (int guest=1; guest<n; guest++) {
res = max(res, confidence[host[guest]] + confidence[guest] );
}
return res;
} else if (p==1) { // MyFriendsAreYourFriends, st2
// nobody is freinds lol, just get max
int res = 0;
for (int person=0; person<n; person++) {
res = max(res, confidence[person]);
}
return res;
} else if (p==2) { // WeAreYourFriends, st3
// it's just all of them summed up
int res = 0;
for (int person=0; person<n; person++) {
res += confidence[person];
}
return res;
} else {
// smtg weird
return -1;
}
} else {
// do whole graph with all. st1 or st5 (or unsolved st6)
return 0; // TODO
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
356 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |