답안 #240648

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
240648 2020-06-20T11:48:53 Z faremy 청소 (JOI20_sweeping) C++14
1 / 100
28 ms 640 KB
#include <iostream>
#include <algorithm>


const int MAXN = 7e3;

int x[MAXN], y[MAXN];


int main()
{
	std::ios::sync_with_stdio(false);
	std::cout.tie(nullptr);
	std::cin.tie(nullptr);

	int size, dusts, queries;
	std::cin >> size >> dusts >> queries;

	for (int iDst = 0; iDst < dusts; iDst++)
		std::cin >> x[iDst] >> y[iDst];
	for (int iQ = 0; iQ < queries; iQ++)
	{
		int type; std::cin >> type;
		switch (type)
		{
		case 1:
			int wanted; std::cin >> wanted;
			wanted--;
			std::cout << x[wanted] << ' ' << y[wanted] << '\n';
			break;

		case 2:
			int width; std::cin >> width;
			for (int iDst = 0; iDst < dusts; iDst++)
				if (y[iDst] <= width)
					x[iDst] = std::max(x[iDst], size - width);
			break;

		case 3:
			std::cin >> width;
			for (int iDst = 0; iDst < dusts; iDst++)
				if (x[iDst] <= width)
					y[iDst] = std::max(y[iDst], size - width);
			break;

		case 4:
			std::cin >> x[dusts] >> y[dusts];
			dusts++;
		}
	}

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 512 KB Output is correct
2 Correct 9 ms 512 KB Output is correct
3 Correct 7 ms 512 KB Output is correct
4 Correct 13 ms 512 KB Output is correct
5 Correct 28 ms 512 KB Output is correct
6 Correct 9 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 512 KB Output is correct
2 Correct 9 ms 512 KB Output is correct
3 Correct 7 ms 512 KB Output is correct
4 Correct 13 ms 512 KB Output is correct
5 Correct 28 ms 512 KB Output is correct
6 Correct 9 ms 384 KB Output is correct
7 Runtime error 7 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Halted 0 ms 0 KB -