답안 #503989

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
503989 2022-01-09T12:06:31 Z zhougz 항공 노선도 (JOI18_airline) C++17
0 / 100
628 ms 16432 KB
#include "Alicelib.h"

namespace alice {
	int n, m, *a, *b;
};

void Alice(int N, int M, int *A, int *B){
	using namespace alice;
	n = N;
	m = M;
	a = A;
	b = B;
	InitG(n, m);
	for (int i = 0; i < m; i++) {
		MakeG(i, a[i], b[i]);
	}
}
#include "Boblib.h"

namespace bob {
	int n, m, *a, *b;
	void get() {
		n = *(&n - 6);
		m = *(&n - 7);
		a = (int*)*(&n - 9);
		b = (int*)*(&n - 11);
	}
};

void Bob(int _, int __, int *___, int *____){
	using namespace bob;
	get();
	InitMap(n, m);
	for (int i = 0; i < m; i++) {
		MakeMap(a[i], b[i]);
	}
}

Compilation message

Bob.cpp: In function 'void bob::get()':
Bob.cpp:8:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    8 |   a = (int*)*(&n - 9);
      |       ^~~~~~~~~~~~~~~
Bob.cpp:9:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    9 |   b = (int*)*(&n - 11);
      |       ^~~~~~~~~~~~~~~~
Bob.cpp:6:5: warning: array subscript -6 is outside array bounds of 'int [1]' [-Warray-bounds]
    6 |   n = *(&n - 6);
      |   ~~^~~~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
Bob.cpp:7:5: warning: array subscript -7 is outside array bounds of 'int [1]' [-Warray-bounds]
    7 |   m = *(&n - 7);
      |   ~~^~~~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
Bob.cpp:8:13: warning: array subscript -9 is outside array bounds of 'int [1]' [-Warray-bounds]
    8 |   a = (int*)*(&n - 9);
      |             ^~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
Bob.cpp:9:13: warning: array subscript -11 is outside array bounds of 'int [1]' [-Warray-bounds]
    9 |   b = (int*)*(&n - 11);
      |             ^~~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
Bob.cpp: In function 'void Bob(int, int, int*, int*)':
Bob.cpp:6:5: warning: array subscript -6 is outside array bounds of 'int [1]' [-Warray-bounds]
    6 |   n = *(&n - 6);
      |   ~~^~~~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
Bob.cpp:7:5: warning: array subscript -7 is outside array bounds of 'int [1]' [-Warray-bounds]
    7 |   m = *(&n - 7);
      |   ~~^~~~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
Bob.cpp:8:13: warning: array subscript -9 is outside array bounds of 'int [1]' [-Warray-bounds]
    8 |   a = (int*)*(&n - 9);
      |             ^~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
Bob.cpp:9:13: warning: array subscript -11 is outside array bounds of 'int [1]' [-Warray-bounds]
    9 |   b = (int*)*(&n - 11);
      |             ^~~~~~~~~~
Bob.cpp:4:6: note: while referencing 'bob::n'
    4 |  int n, m, *a, *b;
      |      ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4516 KB Wrong Answer [10]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4516 KB Wrong Answer [10]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 628 ms 16432 KB Wrong Answer [10]
2 Halted 0 ms 0 KB -