답안 #474710

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
474710 2021-09-19T13:58:36 Z levsog2004 Red-blue table (IZhO19_stones) C++14
27 / 100
72 ms 1988 KB
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <list>
#include <set>
#include <map>
#define all(x) x.begin(),x.end()
#define al(a,n)  (a,a+n)
#define se second
#define fr first
#define m_p make_pair
using namespace std;
typedef  long long ll;
const ll N = 2000004;
const ll mod = 1000 * 1000 * 100 + 7;
ll n, m, k, z, t, x, y,a[1006][1006], ans;
int main()
{
	cin >> t;
	while (t--)
	{
		cin >> x >> y;
		if (x < y)
		{
			cout << y + (x - 1) / 2 << endl;
			for (int i = 0; i < x; ++i)
			{
				for (int j = 0; j < y; ++j)
				{
					if (i < (x-1)/2 && j < y / 2 + 1)
					{
						a[i][j] = 1;
					}
					else
						a[i][j] = 2;
				}
			}

		}
		else
		{
			cout << x + (y - 1) / 2 << endl;
			for (int j = 0; j < y; ++j)
			{
				for (int i = 0; i < x; ++i)
				{
					if (j < (y - 1) / 2 && i < x / 2 + 1)
					{
						a[i][j] = 2;
					}
					else
						a[i][j] = 1;
				}
			}
		}
		for (int i = 0; i < x; ++i)
		{
			for (int j = 0; j < y; ++j)
				if (a[i][j] == 1)
					cout << '+';
				else
					cout << '-';
			cout << endl;
		}
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 9 ms 520 KB Output is correct
4 Incorrect 15 ms 460 KB Wrong answer in test 5 29: 31 < 32
# 결과 실행 시간 메모리 Grader output
1 Incorrect 72 ms 1760 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 58 ms 1988 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 9 ms 520 KB Output is correct
4 Incorrect 15 ms 460 KB Wrong answer in test 5 29: 31 < 32