Submission #315461

# Submission time Handle Problem Language Result Execution time Memory
315461 2020-10-22T23:49:27 Z ly20 Airline Route Map (JOI18_airline) C++17
0 / 100
411 ms 7272 KB
#include "Alicelib.h"
#include <cassert>
#include <cstdio>

void Alice( int N, int M, int A[], int B[] ){
	InitG( 3 * N, M + N * N + N * (N + 1) / 2);
	int at = 0;
	for(int i = 0; i < M; i++) MakeG(at++, A[i], B[i]);
	for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            MakeG(at++, i, j + N);
        }
	}
	for(int i = 0; i < N; i++) {
        for(int j = 0; j <= i; j++) {
            MakeG(at++, i, 2 * N + j);
        }
	}
}

#include "Boblib.h"
#include <cassert>
#include <cstdio>

void Bob( int V, int U, int C[], int D[] ){
    int n = V / 3;
	InitMap( V / 3, U - n * (n + 1) / 2 - n * n);
	int grau[V];
	int id[V];
	for(int i = 0; i < V; i++) {
        grau[i] = 0;
	}
	int mn[V];
	for(int i = 0; i < U; i++) {
        grau[C[i]]++; grau[D[i]]++;
        id[C[i]]++; id[D[i]]++;
	}
	for(int i = 0; i < U; i++) {
        if(grau[C[i]] > n && grau[D[i]] <= n) {
            id[C[i]]--;
        }
        if(grau[D[i]] > n && grau[C[i]] <= n) {
            id[D[i]]--;
        }
	}
	for(int i = 0; i < U; i++) {
        if(grau[C[i]] > n && grau[D[i]] > n) MakeMap(id[C[i]], id[D[i]]);
	}
}

Compilation message

Bob.cpp: In function 'void Bob(int, int, int*, int*)':
Bob.cpp:13:6: warning: unused variable 'mn' [-Wunused-variable]
   13 |  int mn[V];
      |      ^~
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 6912 KB Wrong Answer [120]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 6912 KB Wrong Answer [120]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 411 ms 7272 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -