# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498680 | LittleCube | Paths (BOI18_paths) | C++14 | 140 ms | 21336 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>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;
ll N, M, K, color[300005], adj[300005][5];
pii edge[300005];
ll ans;
signed main()
{
ios::sync_with_stdio(0), cin.tie(0);
cin >> N >> M >> K;
for (int i = 1; i <= N; i++)
cin >> color[i];
for (int i = 1; i <= M; i++)
cin >> edge[i].F >> edge[i].S;
if (K >= 2)
{
for (int i = 1; i <= M; i++)
if (color[edge[i].F] != color[edge[i].S])
ans += 2;
}
cerr << ans << '\n';
if (K >= 3)
{
for (int i = 1; i <= M; i++)
# | 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... |