# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
342313 | _ani | Red-blue table (IZhO19_stones) | C++17 | 45 ms | 1388 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
char s[1002][1002];
int main()
{
int t;
cin >> t;
while (t--)
{
int n, m;
cin >> n >> m;
if (min(n, m) > 2)
{
int ans = n + m - 2;
if (n % 2 == 0)ans--;
if (m % 2 == 0)ans--;
cout << ans << '\n';
int a = n, b = m;
if (a % 2)a--;
else a -= 2;
if (b % 2)b--;
else b -= 2;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++)
{
if (i < a / 2 && j < b / 2)
cout << '-';
else if (i >= a / 2 && i < a && j >= b / 2 && j < b)
cout << '-';
else if (i >= a)
cout << '-';
else if (j >= b)
cout << '+';
else cout << '+';
}
cout << '\n';
}
}
else
{
cout << max(m, n) << '\n';
char d;
if (m > n)
d = '-';
else d = '+';
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
cout << '-';
cout << '\n';
}
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |