제출 #503989

#제출 시각아이디문제언어결과실행 시간메모리
503989zhougz항공 노선도 (JOI18_airline)C++17
0 / 100
628 ms16432 KiB
#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]);
	}
}

컴파일 시 표준 에러 (stderr) 메시지

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;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...