# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
918608 | AnarTz | Red-blue table (IZhO19_stones) | C++14 | 174 ms | 201724 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
int t;
string s="",o = "+",s1="";
cin >> t;
while(t--){
int n,m,i,c,b;
cin >> n >> m;
bool row=true;
if (m>n)
{
c=n-(n/2+1);
b=m+c;
row=true;
}else{
c=m-(m/2+1);
b=n+c;
row=false;
}
cout << b<<endl;
if (row==true)
{
for (i = 0; i < m; i++)
{
s=s+o;
s1=s1+"-";
}
}else{
for (i = 0; i < m; i++)
{
s=s+o;
if (s.size()==m/2+1)
{
o = "-";
}
}
}
if (row==true)
{
for (i = 0; i < n; i++)
{
cout << s1<<endl;
if (i==n/2)
{
s1=s;
}
}
}else{
for (i = 0; i < n; i++)
{
cout << s<<endl;
}
}
}
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... |