Submission #526389

# Submission time Handle Problem Language Result Execution time Memory
526389 2022-02-14T15:12:08 Z asdf2727 Red-blue table (IZhO19_stones) C++17
11 / 100
38 ms 1296 KB
#include <iostream>

int main() {
	int nrt, sizx, sizy;
	int sizx1, sizx2, sizy1, sizy2;
	std::cin >> nrt;
	while (nrt--) {
		std::cin >> sizx >> sizy;
		if (sizx <= sizy && sizx < 3) {
			std::cout << sizy << '\n';
			for (int index = 0; index < sizx; index++) {
				for (int index2 = 0; index2 < sizy; index2++) {
					std::cout << '-';
				}
				std::cout << '\n';
			}
		}
		else if (sizy < 3) {
			std::cout << sizx << '\n';
			for (int index = 0; index < sizx; index++) {
				for (int index2 = 0; index2 < sizy; index2++) {
					std::cout << '+';
				}
				std::cout << '\n';
			}
		}
		else {
			sizx1 = (sizx - 1) >> 1;
			sizx2 = (sizx >> 1) + 1;
			sizy1 = (sizy - 1) >> 1;
			sizy2 = (sizy >> 1) + 1;
			std::cout << sizx + sizy + sizx1 + sizy1 - sizx2 - sizy2 << '\n';
			for (int index = 0; index < sizx1; index++) {
				for (int index2 = 0; index2 < sizy1; index2++) {
					std::cout << '-';
				}
				for (int index2 = sizy1; index2 < sizy; index2++) {
					std::cout << '+';
				}
				std::cout << '\n';
			}
			for (int index = sizx1; index < sizx2; index++) {
				for (int index2 = 0; index2 < sizy; index2++) {
					std::cout << '-';
				}
				std::cout << '\n';
			}
			for (int index = sizx2; index < sizx; index++) {
				for (int index2 = 0; index2 < sizy2; index2++) {
					std::cout << '+';
				}
				for (int index2 = sizy2; index2 < sizy; index2++) {
					std::cout << '-';
				}
				std::cout << '\n';
			}
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Wrong answer in test 4 4: 4 < 5
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Wrong answer in test 4 3: 4 < 5
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Wrong answer in test 4 4: 4 < 5
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 32 ms 1296 KB Output is correct
2 Correct 38 ms 1052 KB Output is correct
3 Correct 26 ms 1056 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 1228 KB Wrong answer in test 4 4: 4 < 5
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Wrong answer in test 4 4: 4 < 5
3 Halted 0 ms 0 KB -