# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
874054 | WongYiKai | Friend (IOI14_friend) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n,temp,temp2,test = 0,high = 0;
cin >> n;
int con[n],host[n],prot[n];
for (int i=0;i<n;i++){
cin >> temp;
con[i] = temp;
high = max(high,temp);
}
for (int i=1;i<n;i++){
cin >> temp >> temp2;
host[i] = temp;
prot[i] = temp2;
if (temp2 != 2) test = 1;
}
if (test == 0){
cout << high;
}
}