# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
918615 | AnarTz | Red-blue table (IZhO19_stones) | C++14 | 24 ms | 1368 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
string s="",o = "+",s1="";
int n,m,i,c,b;
cin >> n >> m;
bool row=true;
if (m<n)
{
c=m-(m/2+1);
b=n+c;
row=false;
}else{
c=n-(n/2+1);
b=m+c;
row=true;
}
cout << b<<endl;
if (row==true)
{
for (i = 0; i < m; i++)
{
s=s+o;
s1=s1+"-";
}
for (i = 0; i < n; i++)
{
cout << s1<<endl;
if (i==n/2)
{
s1=s;
}
}
}else{
for (i = 0; i < m; i++)
{
s=s+o;
if (s.size()==m/2+1)
{
o = "-";
}
}
for (i = 0; i < n; i++)
{
cout << s<<endl;
}
}
}
return 0;
}
Compilation message (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... |