| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 285939 | evpipis | 친구 (IOI14_friend) | C++11 | 37 ms | 3456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "friend.h"
#include <bits/stdc++.h>
using namespace std;
const int len = 1e5+5;
int yes[len], no[len];
int findSample(int n, int con[], int host[], int prot[]){
for (int i = 0; i < n; i++)
yes[i] = con[i], no[i] = 0;
for (int y = n-1; y > 0; y--){
int x = host[y], tp = prot[y];
int p = 0, q = 0;
// case IAmYourFriend
if (tp == 0){
p = yes[x]+no[y];
q = max(no[x]+no[y], no[x]+yes[y]);
}
// case MyFriendsAreYourFriends
else if (tp == 1){
q = no[x]+no[y];
p = yes[x]+yes[y];
p = max(p, no[x]+yes[y]);
p = max(p, yes[x]+no[y]);
}
// case WeAreYourFriends
else{
q = no[x]+no[y];
p = max(yes[x]+no[y], no[x]+yes[y]);
}
yes[x] = p;
no[x] = q;
}
return max(yes[0], no[0]);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
