| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1338438 | vjudge1 | Red-blue table (IZhO19_stones) | C++17 | 10 ms | 1392 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, m, i, j;
cin >> t;
while( t-- ) {
cin >> n >> m;
if( n == 1 ) {
cout << m << '\n';
for( i = 1; i <= m; i++ )
cout << '-';
cout << '\n';
} else if( m == 1 ) {
cout << n << '\n';
for( i = 1; i <= n; i++ )
cout << '+';
cout << '\n';
} else if( m & 1 ) {
/*
+-+-+...
+-+-+...
+-+-+...
*/
cout << n + m / 2 << '\n';
for( i = 1; i <= n; i++ ) {
for( j = 1; j <= m; j++ )
if( j & 1 )
cout << '+';
else
cout << '-';
cout << '\n';
}
} else {
/*
+++-
+++-
+++-
*/
cout << n + m / 2 - 1 << '\n';
for( i = 1; i <= n; i++ ) {
for( j = 1; j <= m; j++ )
if( j <= m / 2 + 1 )
cout << '+';
else
cout << '-';
cout << '\n';
}
}
}
return 0;
}
| # | 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... | ||||
