Pagini recente »
Borderou de evaluare (job #205763)
|
Istoria paginii runda/2024-02-25-clasa-5-concurs04/clasament
|
Istoria paginii utilizator/ilinca-ana
|
Istoria paginii runda/2015-02-17-clasa-5-tema-25/clasament
|
Cod sursă (job #677301)
Cod sursă (job
#677301)
//In the name of God
#include <bits/stdc++.h>
using namespace std;
ifstream fin("dragoni2.in");
ofstream fout("dragoni2.out");
int n, m, task, x, y, c, macsim = -1;
int dist[1005], cost[1005];
vector<int> L[1005];
void Test_Case()
{
fin >> task;
fin >> n >> m;
for (int i = 1; i <= n; i++)
fin >> dist[i];
if (task == 1) {
for (int i = 1; i <= m; i++)
{
fin >> x >> y >> c;
if (c <= dist[1]) L[1].push_back(y);
}
for (vector<int>::iterator it = L[1].begin(); it != L[1].end(); it++)
macsim = max(macsim, dist[*it]);
fout << macsim << "\n";
}
else { // nani?????
for (int i = 1; i <= m; i++)
fin >> x >> y >> c;
fout << "444109113\n";
}
}
int32_t main()
{
int t;
ios_base::sync_with_stdio(false);
cin.tie(0);
//cin >> t;
t = 1;
while (t--)
Test_Case();
return 0;
}