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>
#include <cassert>
#include <cstdio>
#include "Alicelib.h"
using namespace std;
void Alice( int N, int M, int A[], int B[] ){
vector<array<int, 2>> v;
for(int i = 0; i < M; i++)
{
v.push_back({A[i], B[i]});
}
for(int i = N; i < 3*N; i++)
{
for(int j = i+1; j < 3*N; j++)
{
v.push_back({i, j});
}
}
for(int i = 0; i < N; i++)
{
for(int j = N; j < N+i; j++)
{
v.push_back({i, j});
}
}
InitG(3*N, v.size());
for(int i = 0; i < v.size(); i++)
{
MakeG(i, v[i][0], v[i][1]);
}
}
#include <bits/stdc++.h>
#include <cassert>
#include <cstdio>
#include "Boblib.h"
using namespace std;
void Bob( int V, int U, int C[], int D[] ){
int N = V/3;
int deg[V], p[V];
memset(deg, 0, sizeof(deg));
memset(p, 0, sizeof(p));
for(int i = 0; i < U; i++)
{
deg[C[i]]++;
deg[D[i]]++;
}
vector<array<int, 2>> v;
for(int i = 0; i < U; i++)
{
if(deg[C[i]] > N*2-2 || deg[D[i]] > N*2-2)
{
p[D[i]]++, p[C[i]]++;
continue;
}
v.push_back({C[i], D[i]});
}
InitMap(N, v.size());
for(auto [a, b] : v) MakeMap(p[a], p[b]);
}
Compilation message (stderr)
Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:29:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
29 | for(int i = 0; i < v.size(); 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... |